Ejemplo n.º 1
0
 function GetTitle()
 {
     $id = get('id', 0, 'gp');
     if (!$id) {
         return $this->str('edit');
     }
     $row = $this->getRow($id);
     if (defined('LANG_SELECT') && LANG_SELECT) {
         $row['name'] = $row['name_' . lang()] ? $row['name_' . lang()] : $row['name_' . LANG_DEFAULT];
     }
     $GLOBALS['str'][get_class_name($this)]['basic_tab'][int_langID()] = $row['name'];
     $GLOBALS['str'][get_class_name($this)]['basic_caption'][int_langID()] = $GLOBALS['cfg']['types'][$row['root_id']][$row['type']][int_langID()];
     return $this->str('edit') . ' - "' . $row['name'] . '"';
 }
Ejemplo n.º 2
0
 function Show()
 {
     if (!empty($_POST)) {
         $action = get('actions', '', 'p');
         if ($action) {
             if ($this->Allow($action)) {
                 return $this->{$action}();
             } else {
                 return $this->alert_method_not_allowed();
             }
         }
     }
     require_once core('ajax_table');
     $data['thisname'] = $this->name;
     $this->AddStrings($data);
     $options_pos = array();
     foreach ($this->position as $key => $val) {
         $options_pos[$key] = utf($val['display'][int_langID()]);
     }
     $data['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SORT), array('select' => 'image', 'display' => 'preview', 'type' => 'image'), array('select' => 'link', 'display' => 'link', 'type' => 'link'), array('select' => 'position', 'display' => 'position', 'type' => 'position', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array('') + $options_pos), array('select' => 'visible', 'display' => 'visible', 'type' => 'visible', 'align' => 'center', 'flags' => FLAG_SORT), array('select' => 'priority', 'display' => 'priority', 'type' => 'text', 'align' => 'center', 'flags' => FLAG_SORT), array('select' => "clicks"), array('select' => "views", 'display' => 'ctr', 'type' => 'ctr', 'align' => 'center', 'flags' => FLAG_SORT)), 'where' => "lang='" . lang() . "' AND visible>=0 AND root_id=" . domainRootID(), 'orderby' => 'priority', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => 'editItem(id)', 'click' => 'ID = cb.value'), $this);
     $data['root_id'] = domainRootID();
     return $this->Parse($data, $this->name . '.tmpl');
 }