示例#1
0
 function importSettings(DOMElement $e)
 {
     $res = parent::importSettings($e);
     if ($e->hasAttribute($name = 'sort')) {
         $this->params['sortdirect'] = $e->getAttribute($name);
     }
     return $res;
 }
示例#2
0
 function getList($users)
 {
     $xml = $this->getSection()->getXML();
     if ($list_element = $xml->getElementById('user_list')) {
         $rl = new rowlist($list_element, $users->getNum(), param('page'));
         $s = $rl->getStartIndex();
         $f = $rl->getFinishIndex();
         foreach ($users as $i => $usr) {
             if ($i < $s) {
                 continue;
             } elseif ($i > $f) {
                 break;
             }
             $rl->addRow($usr->getLogin(), array('sort' => $i + 1, 'login' => $usr->getLogin(), 'name' => $usr->getName(), 'active' => $usr->getDisabled()));
         }
         $rl->setFormAction(preg_replace('/&?mess=[\\w_]*/', '', $_SERVER['REQUEST_URI']));
         return $rl;
     }
 }
示例#3
0
 function getRowList()
 {
     if ($list_element = $this->query('rowlist')->item(0)) {
         $tl = $this->getPackages();
         $rl = new rowlist($list_element, $tl->getNum(), param('page'));
         $s = $rl->getStartIndex();
         $f = $rl->getFinishIndex();
         $i = 0;
         foreach ($tl as $package) {
             if ($i < $s) {
                 continue;
             } elseif ($i > $f) {
                 break;
             }
             $rl->addRow($package->getAttribute('id'), array('sort' => $i + 1, 'title' => $package->getAttribute('title')));
             $i++;
         }
         $rl->setFormAction(preg_replace('/&?mess=[\\w_]*/', '', $_SERVER['REQUEST_URI']));
         return $rl;
     }
 }
示例#4
0
 function getList($param = false)
 {
     $xml = new xml(PATH_MODULE . $this->getName() . '/data.xml');
     if ($e = $xml->query('/data/rowlist')->item(0)) {
         $modules = $this->getModuleList();
         $modules_this_section = $this->getModules();
         $rl = new rowlist($e, $modules_this_section->getNum(), param('page'));
         if (!$param) {
             $modules_sec = array();
             foreach ($modules_this_section as $m) {
                 $modules_sec[$m->getId()] = array('idmodule' => $m->getId(), 'title' => $m->getTitle(), 'name' => $m->getName(), 'active' => $m->getRootElement()->hasAttribute('readonly'));
             }
             $modules_new = array();
             foreach ($modules_sec as $key => $m) {
                 if (isset($modules[$m['name']])) {
                     $modules_new[$key] = $modules_sec[$key];
                     $modules_new[$key]['name'] = $modules[$m["name"]]['name'];
                     $modules_new[$key]['version'] = $modules[$m["name"]]['version'];
                     $modules_new[$key]['description'] = $modules[$m["name"]]['description'];
                     $modules_new[$key]['data'] = $modules[$m["name"]]['data'];
                 } else {
                     //модуль в разделе есть а в папке с модулями его нет, непонятно !(
                     $modules_new[$key] = $m;
                 }
             }
             $modules = $modules_new;
         }
         if (count($modules)) {
             foreach ($modules as $i => $module) {
                 if ($i >= $rl->getStartIndex() && $i <= $rl->getFinishIndex()) {
                     $rl->addRow($i, $module);
                 }
             }
         }
         return $rl->getRootElement();
     }
 }
示例#5
0
 function getList()
 {
     $xml = $this->getSection()->getXML();
     if (($e = $this->query('rowlist')->item(0)) && ($tl = $this->getTagList())) {
         $rl = new rowlist($e, $tl->getNum(), param('page'));
         $s = $rl->getStartIndex();
         $f = $rl->getFinishIndex();
         $i = 0;
         foreach ($tl as $e) {
             if ($i >= $s) {
                 if ($i > $f) {
                     break;
                 }
                 $rl->addRow($i + 1, $this->getListRow($i, $e));
             }
             $i++;
         }
         $rl->setFormAction(preg_replace('/&?mess=[\\w_]*/', '', $_SERVER['REQUEST_URI']));
         return $rl;
     }
 }
示例#6
0
 function getList()
 {
     $types = array('text' => 'Text field', 'email' => 'Email', 'password' => 'Password', 'textarea' => 'Textarea');
     if ($e = $this->xml->getElementById("feedback_list_fields")) {
         //$q = './field[not(@type = "captcha")]';
         $q = './field[(@type = "text") or (@type = "textarea") or (@type = "email") or (@type = "password")]';
         $from = $this->sec->getElementById("feedback_form");
         $list = $this->sec->query($q, $from);
         $rl = new rowlist($e, $list->length, param('page'));
         $s = $rl->getStartIndex();
         $f = $rl->getFinishIndex();
         foreach ($list as $i => $row) {
             if ($i < $s) {
                 continue;
             } elseif ($i > $f) {
                 break;
             }
             $rl->addRow($row->getAttribute('name'), array('sort' => $i + 1, 'type' => $types[$row->getAttribute('type')], 'label' => $row->getAttribute('label')));
         }
         $rl->setFormAction(preg_replace('/&?mess=[\\w_]*/', '', $_SERVER['REQUEST_URI']));
         return $rl;
     }
 }
示例#7
0
 function getList()
 {
     if ($list_element = $this->query('./rowlist')->item(0)) {
         $res = $this->getSection()->query('sec');
         $rl = new rowlist($list_element, $res->length, param('page'));
         $s = $rl->getStartIndex();
         $f = $rl->getFinishIndex();
         foreach ($res as $i => $sec) {
             if ($i < $s) {
                 continue;
             } elseif ($i > $f) {
                 break;
             }
             $rl->addRow($sec->getAttribute('id'), array('sort' => $i + 1, 'title' => $sec->getAttribute('title')));
         }
         $rl->setFormAction(preg_replace('/&?mess=[\\w_]*/', '', $_SERVER['REQUEST_URI']));
         return $rl;
     }
 }
示例#8
0
 function getList($param)
 {
     $rl_xml = new xml(PATH_MODULE . __CLASS__ . '/form/rowlist.xml');
     if ($list_element = $rl_xml->de()) {
         $templates = $this->getTemplate();
         $rl = new rowlist($list_element, count($templates), param('page'));
         $headers = $rl->getHeaders();
         if (!$param['count']) {
             $list_elem = $rl->getRootElement();
             $list_elem->removeAttribute('add');
         }
         if ($templates) {
             foreach ($templates as $i => $template) {
                 if ($i >= $rl->getStartIndex() && $i <= $rl->getFinishIndex()) {
                     $rl->addRow($template->getAttribute('id'), array('id_template' => $template->getAttribute('id')));
                 }
             }
         }
         return $rl->getRootElement();
     }
 }