Ejemplo n.º 1
0
 function Show($error = '')
 {
     session_start();
     $_SESSION['token'] = md5(uniqid(rand(), 1));
     $data = array('today_date' => date('l, d F Y'), 'today_time' => date('H:i a'), 'time_zone' => "+0" . (date('O') / 100 - date('I')) . "00", 'season_name' => date('I') ? $this->str('summer') : $this->str('winter'), 'uri' => htmlspecialchars(get('uri', $GLOBALS['_SERVER']['REQUEST_URI'], 'p')), 'login' => htmlspecialchars(get('login', '', 'p')), 'pwd' => htmlspecialchars(get('pwd', '', 'g')), 'error' => $error, 'title' => $this->str('title'), 'win' => htmlspecialchars(get('win', '', 'pg')), 'token' => $_SESSION['token']);
     session_write_close();
     $this->AddStrings($data);
     $GLOBALS['title'] = $this->str('title');
     global $intlangs;
     if (count($intlangs) > 1) {
         $data['options'] = $intlangs;
         $data['default_language'] = get('intlang', 0, 'c');
     }
     $data['int_lang'] = int_lang();
     return $this->Parse($data, $this->name . '.show.tmpl');
 }
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['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'display_' . int_lang(), 'display' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT), array('select' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT), array('select' => 'type', 'display' => 'type', 'flags' => FLAG_SEARCH | FLAG_SORT), array('select' => 'allowed', 'display' => is_devel() ? 'allowed' : NULL, 'type' => 'allowed', 'align' => 'center'), array('select' => 'required', 'display' => 'required', 'type' => 'required', 'align' => 'center'), array('select' => 'enabled', 'display' => 'enabled', 'type' => 'enabled', 'align' => 'center')), 'from' => $this->table, 'orderby' => 'required DESC, id', 'params' => array('page' => $this->name, 'do' => 'show'), 'where' => !is_devel() ? 'allowed=1' : '', 'dblclick' => 'editItem(id)', 'click' => 'ID = cb.value'), $this);
     $this->AddStrings($data);
     return $this->Parse($data, $this->name . '.tmpl');
 }
Ejemplo n.º 3
0
 function GetActions($actions, $pos = '')
 {
     $frame = get("is_fancy", "");
     if (!empty($pos)) {
         $pos = '_' . $pos;
     }
     $data = array();
     foreach ($actions as $key => $val) {
         // Чтобы у fancybox закрывалось окно а не отображался сайт
         if ($frame && $key == 'cancel') {
             $val['onclick'] = "window.top.parent.\$.fancybox.close();";
         }
         $data['actions'][] = array('title' => utf($val['title'][int_lang()]), 'show_title' => isset($val['show_title']) ? $val['show_title'] : false, 'onclick' => $val['onclick'], 'img' => $val['img'], 'hint' => isset($val['hint']) ? utf($val['hint'][int_lang()]) : '', 'display' => $val['display'], 'ondrop' => isset($val['ondrop']) ? $val['ondrop'] : '', 'ondragenter' => isset($val['ondrop']) ? 'window.event.dataTransfer.dropEffect = \'link\';window.event.returnValue = false' : '', 'ondragleave' => isset($val['ondrop']) ? 'window.event.returnValue = false' : '', 'ondragover' => isset($val['ondrop']) ? 'window.event.returnValue = false' : '');
     }
     return $this->Parse($data, 'actions' . $pos . '.tmpl');
 }