$options[$year->year] = $year->year; } if ($filteractualloc) { $params1['factualloc'] = (int) $filteractualloc; } $sel = new single_select(praxe_get_base_url($params1), 'fyearloc', $options, $filteryearloc, null, 'praxepop_praxelocationsselectyear'); $sel->label = get_string('year', 'praxe'); $tab_content .= $OUTPUT->render($sel); } } break; default: break; } if (false === praxe_object_search($tab, $viewtabrows, 'id')) { if (false === praxe_object_search($tab, $subtabrows, 'id')) { $msg = get_string('notallowedaction', 'praxe'); //redirect($CFG->wwwroot.'/mod/praxe/view.php?id='.$cm->id.'&mode='.$tab_modes[strtolower($viewrole)][0], $msg); } } /// Put all this info together $tabrows = array(); $tabrows[] = $viewtabrows; // Always put these at the top if (count($subtabrows)) { $tabrows[] = $subtabrows; } ?> <div class="praxedisplay">
function praxe_object_search($needle, $haystack, $arraykey = false) { if (!is_array($haystack)) { return false; } foreach ($haystack as $key => $value) { $current_key = $key; if ($arraykey) { if ($needle == $value->{$arraykey}) { return $key; } if (praxe_object_search($needle, $value->{$arraykey}) == true) { return $current_key; } } else { if ($needle == $value) { return $value; } if (praxe_object_search($needle, $value) == true) { return $current_key; } } } return false; }