Beispiel #1
0
 function wfitem($wf)
 {
     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++) {
         if ($_REQUEST['node'] == $this->adminnodes[$i]->link) {
             $this->curnode = $this->adminnodes[$i];
             $this->curadmin = new wfadmin($this->curnode->link);
             break;
         }
     }
     $this->art = json_decode(stripslashes($_REQUEST['ids']));
     if (!is_array($this->art)) {
         $this->art = array();
         $this->art[] = $_REQUEST['ids'];
     }
     $this->header = $this->curnode->name;
     if (!$this->curadmin->multilanguages) {
         $this->currows = $this->curadmin->getrows('', $this->page * $this->onpage, $this->onpage);
     } else {
         $this->currows = $this->curadmin->getrows('_' . WRA_CONF::$language, $this->page * $this->onpage, $this->onpage);
     }
 }
Beispiel #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);
 }
Beispiel #3
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');
 }
Beispiel #4
0
 function wfitem($wf)
 {
     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 . '/edit') {
             if (!$r) {
                 $wf->set404();
                 break;
             }
             $this->curnode = $this->adminnodes[$i];
             $this->curadmin = new wfadmin($this->curnode->link);
             // $this->load();
             break;
         }
         if (!$r) {
             unset($this->adminnodes[$i]);
         }
     }
     if (!empty($_REQUEST["id"])) {
         $this->curadmin->curid = intval($_REQUEST["id"]);
     } else {
         $this->curadmin->curid = -1;
     }
     $this->load($wf);
     if ($_REQUEST["act"] == "delete") {
         if ($this->curadmin->multilanguages) {
             foreach ($wf->languages as $v) {
                 $this->curadmin->deletefirst('_' . $v->alias);
             }
         } else {
             $this->curadmin->deletefirst('');
         }
         WRA::gotopage(WRA::base_url() . $this->curnode->link);
     }
     $this->header = $this->curnode->name;
 }
Beispiel #5
0
 static function routetable()
 {
     $result = WRA_ENV::routes();
     $adminresult = WRA_ENV::adminnodes();
     for ($i = 0; $i < count($adminresult); $i++) {
         $aresult = $adminresult[$i];
         if ($aresult->defaultadmin) {
             $result[] = new wfroute($aresult->link, $aresult->link, 'admin/table.php');
         }
         if ($aresult->defaultedit) {
             $result[] = new wfroute($aresult->link . '/edit', $aresult->link . '/edit', 'admin/edit.php');
         }
         if ($aresult->defaultview) {
             $result[] = new wfroute($aresult->link . '/view', $aresult->link . '/view', 'admin/view.php');
         }
     }
     return $result;
 }