Esempio n. 1
0
 function doEdit()
 {
     global $_TABLES, $_TAG_CONF;
     $dir = TAG_get('dir');
     $menu_id = TAG_get('id');
     if ($dir == 'up') {
         $this->heightenDisplayOrder($menu_id);
         return;
     } else {
         if ($dir == 'down') {
             $this->lowerDisplayOrder($menu_id);
             return;
         }
     }
     $menu_id = TAG_post('menu_id');
     $menu_name = TAG_post('menu_name');
     $menu_tags = TAG_post('menu_tags');
     $parent_id = TAG_post('parent_id');
     $menu_tags = TAG_scanTag('[' . $_TAG_CONF['tag_name'] . ':' . $menu_tags . ']');
     $tag_ids = $this->_getIdList($menu_tags);
     if (count($tag_ids) > 0) {
         $tag_ids = implode(',', $tag_ids);
     } else {
         $tag_ids = '';
     }
     $sql = "UPDATE {$_TABLES['tag_menu']} " . "SET menu_name = '" . addslashes($menu_name) . "', " . "tag_ids = '" . addslashes($tag_ids) . "', " . "parent_id = '" . addslashes($parent_id) . "' " . "WHERE (menu_id = '" . addslashes($menu_id) . "')";
     $result = DB_query($sql);
     return DB_error() ? TAG_str('edit_fail') : TAG_str('edit_success');
 }
Esempio n. 2
0
    exit;
}
TAG_checkAdmin();
// Main
$this_script = $_CONF['site_admin_url'] . '/plugins/tag/index.php';
$commands = array('stats', 'badword', 'menuconfig');
$actions = array('view', 'add', 'edit', 'delete', 'doAdd', 'doEdit', 'doDelete');
// Retrieves request vars
$cmd = TAG_get('cmd');
if ($cmd === FALSE) {
    $cmd = TAG_post('cmd');
}
if ($cmd === FALSE or !in_array($cmd, $commands)) {
    $cmd = 'stats';
}
$action = TAG_get('action');
if ($action === FALSE) {
    $action = TAG_post('action', true);
}
if ($action === FALSE or !in_array($action, $actions)) {
    $action = 'view';
}
// Processes command
require_once $cmd . '.class.php';
$class = 'Tag' . ucfirst($cmd);
$obj = new $class();
switch ($action) {
    case 'doAdd':
        $msg = $obj->doAdd();
        break;
    case 'doEdit':