0) {
echo $vars["value"];
}
if (!empty($vars["value"]) && !(substr_count($vars["value"], "[") > 0)) {
if (!is_array($vars["value"])) {
$vars["value"] = array($vars['value']);
}
$result = "";
if (sizeof($vars['value']) < 5) {
foreach ($vars['value'] as $elem) {
if (!empty($result)) {
$result .= ", ";
}
$subj_elem = getSubject($elem);
$result .= "wwwroot . "pg/waramu/subjects/" . $subj_elem->id . "\">" . $subj_elem->title ."";
}
} else {
// First 5 elements
$part_1_arr = array_slice($vars['value'], 0, 5);
$part_1_res = "";
foreach ($part_1_arr as $elem) {
if (!empty($part_1_res)) {
$part_1_res .= ", ";
}
$subj_elem = getSubject($elem);
$part_1_res .= "wwwroot . "pg/waramu/subjects/" . $subj_elem->id . "\">" . $subj_elem->title ."";
}
$result .= "";
$result .= "" . $part_1_res . "... +";
$result .= "" . $part_1_res . "... +";
// All elements
$part_2_arr = $vars['value'];
$part_2_res = "";
foreach ($part_2_arr as $elem) {
if (!empty($part_2_res)) {
$part_2_res .= ", ";
}
$subj_elem = getSubject($elem);
$part_2_res .= "wwwroot . "pg/waramu/subjects/" . $subj_elem->id . "\">" . $subj_elem->title ."";
}
$result .= "" . $part_2_res . " -";
$result .= "";
}
echo $result;
}
?>