static function adminit($wfadmin)
 {
     $wfadmin->table = 'adminnotices';
     $wfadmin->multilanguages = false;
     $wfadmin->columns[] = new admincolumn("DateTime", "dateadd", "Добавлено", admincolumntype::text, admincolumntype::datetime, 2);
     $wfadmin->columns[] = new admincolumn("String", "ip", "ip-адрес", admincolumntype::text, admincolumntype::text, 2);
     $wfadmin->columns[] = new admincolumn("String", "message", "Сообщение", admincolumntype::text, admincolumntype::bigtext, 2);
     $wfadmin->columns[] = new admincolumn("Int32", "status", "Статус", admincolumntype::fromdrop, admincolumntype::dropdown, 2, wra_adminnotices::getstatuses());
     $wfadmin->order = " order by id desc";
 }
Esempio n. 2
0
 function wfitem($wf)
 {
     $this->noticecount = wra_adminnotices::getcount();
     if (wra_userscontext::isloged($wf) && wra_userscontext::hasright('adminpage')) {
         $wf->cp->baseico = true;
         $wf->cp->norobots();
         $wf->cp->bodyclass = "admin_login";
     } else {
         WRA::gotopage(WRA::base_url() . 'admin/login');
         $wf->nicedie();
     }
     $this->adminnodes = WRA_ENV::adminnodes();
     for ($i = 0; $i < count($this->adminnodes); $i++) {
         $r = wra_userscontext::getaccess($this->adminnodes[$i]->link);
         if ($wf->requestedpage == $this->adminnodes[$i]->link) {
             if (!$r) {
                 $wf->set404();
                 break;
             }
             $this->curnode = $this->adminnodes[$i];
             $this->curadmin = new wfadmin($this->curnode->link);
             break;
         }
         if (!$r) {
             unset($this->adminnodes[$i]);
         }
     }
     $this->header = $this->curnode->name;
     if (isset($_POST['btnclicked'])) {
         switch ($_POST['btnclicked']) {
             case 'btnfind':
                 $this->curadmin->search = addslashes($_REQUEST['txtfind']);
                 break;
         }
     }
     if (isset($_GET['page'])) {
         $this->page = intval($_GET['page']);
     }
     if (!$this->curadmin->multilanguages) {
         $this->currows = $this->curadmin->getrows('', $this->page + 1, $this->onpage);
         $this->totalcount = $this->curadmin->getcount();
     } else {
         $this->currows = $this->curadmin->getrows('_' . WRA_CONF::$language, $this->page + 1, $this->onpage);
         $this->totalcount = $this->curadmin->getcount('_' . WRA_CONF::$language);
     }
     $this->pagescount = $this->getcount();
     // WRA::debug($this->pagescount);
     // WRA::debug($this->totalcount);
 }
Esempio n. 3
0
 function load(wf $wf)
 {
     $this->noticecount = wra_adminnotices::getcount();
     $this->curadmin->clear();
     if ($this->curadmin->multilanguages) {
         foreach ($wf->languages as $v) {
             // WRA::debug($v);
             $this->currow[$v->alias] = $this->curadmin->currow('_' . $v->alias);
         }
     } else {
         $this->currow[WRA_CONF::$language] = $this->curadmin->currow('');
     }
     // WRA::debug($this->curadmin);
     // WRA::debug($this->currow);
     // die();
 }
Esempio n. 4
0
 function wfitem($wf)
 {
     //include  WRA_Path. '/modules/admin/admintable.php';
     //include WRA_Path.'/modules/admin/adminpages.php';
     $this->header = 'Администрирование';
     $this->adminnodes = WRA_ENV::adminnodes();
     $this->noticecount = wra_adminnotices::getcount();
     if (wra_userscontext::isloged($wf) && wra_userscontext::hasright('adminpage')) {
         $wf->cp->baseico = true;
         $wf->cp->norobots();
         $wf->cp->bodyclass = "admin_login";
     } else {
         WRA::gotopage(WRA::base_url() . 'admin/login');
         $wf->nicedie();
     }
     // wra_adminnotices:: message('hello','hello');
 }