function directives_select() { $conf = $GLOBALS['CONF']; $engine_id = $conf->get_conf('default_engine_id'); $directive_editor = new Directive_editor($engine_id); $dirs = $directive_editor->get_categories(); $select = "<select id='linkname' name='newlinkname' style='width:300px'>"; if (is_array($dirs) && count($dirs) > 0) { foreach ($dirs as $dir) { $dir = $dir['directives']; $dir = is_array($dir) ? $dir : array(); foreach ($dir as $did => $ddata) { $name = strlen($ddata['name']) > 60 ? substr($ddata['name'], 0, 57) . "..." : $ddata['name']; $select .= "<option value='{$did}' title='" . $ddata['name'] . "'>" . $name; } } } else { $select .= "<option value=''>" . _('No items found') . "</option>"; } $select .= "</select>"; return $select; }
$msg_success = _("The directive was successfully disabled"); $toggled = POST('file'); } if (POST('touser_directive_id') != "") { ossim_valid(POST('touser_directive_id'), OSS_DIGIT, 'illegal:' . _("Directive ID")); ossim_valid(POST('file'), OSS_ALPHA, OSS_PUNC, 'illegal:' . _("File")); if (ossim_error()) { die(ossim_error()); } if ($directive_editor->clone_directive_touser(POST('touser_directive_id'), POST('file'))) { $msg_success = _("The directive was successfully cloned to User Contributed"); } else { $msg_error = _("Unable to clone this directive"); } } $categories = $directive_editor->get_categories($query); $disabled_directives = $directive_editor->get_disabled_directives(); // Get toggled category if there is a directive parameter if ($toggled_dir != "") { foreach ($categories as $category) { foreach ($category['directives'] as $directive_id => $directive_name) { if ($directive_id == $toggled_dir) { $toggled = $category['xml_file']; } } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head>