示例#1
0
 protected function action_edit()
 {
     if ($this->in_embedded_admin()) {
         CMS::$globals['is_embedded_admin'] = true;
         $this->use_layout('admin');
     }
     return parent::action_edit();
 }
示例#2
0
 protected function load($id)
 {
     $item = parent::load($id);
     if ($item && ($type = $this->get_type($item))) {
         $type->deserialize($item);
     }
     return $item;
 }
示例#3
0
 public function action_url($action, $p = false, $args = false, $extra = false)
 {
     $res = parent::action_url($action, $p, $args, $extra);
     if ($this->default_action($action, $args) !== 'tree') {
         return $res;
     }
     $res = preg_replace('!/list!', '', $res);
     if (preg_match('!/page-(\\d+)!', $res, $m)) {
         $page = $m[1];
         $res = str_replace('/page-' . $page, '', $res);
         $res .= (Core_Strings::contains($res, '?') ? '&' : '?') . "page={$page}";
     }
     return $res;
 }
示例#4
0
文件: Stockroom.php 项目: techart/tao
 public function setup()
 {
     $url = $this->rep_query('tags.json');
     $this->tags = $this->get_query($url);
     return parent::setup()->render_defaults('connect_error', 'tags');
 }
示例#5
0
 public function index($action, $args)
 {
     // Log::logger()->debug($action);
     $res = parent::index($action, $args);
     return $res;
 }
示例#6
0
 protected function process_form($item)
 {
     $errors = parent::process_form($item);
     if (isset($this->form['_name']) && sizeof($errors) == 0) {
         $name = trim($this->form['_name']);
         if (Core_Regexps::match('{^[a-z0-9_-]+$}i', $name)) {
             return array();
         }
         if (Core_Regexps::match('{^[a-z0-9_-]+\\.[a-z0-9_-]+$}i', $name)) {
             return array();
         }
         return array('_name' => CMS::lang('%LANG{en}Invalid name!%LANG{ru}Некорректный мнемокод!'));
     }
     return $errors;
 }