Exemplo n.º 1
0
 function onAdd()
 {
     if (($id = param('alias')) && ($title = param('title')) && ($tpl = $this->evaluate('string(template/@id)')) && ($sec = apSectionAdd::addSection($id, $title, ap::getClientSection($this->getSection()->getId())))) {
         apSectionTemplate::applyTemplate($id, $tpl);
         param('row', $sec->getId());
         return true;
     }
 }
Exemplo n.º 2
0
 static function seclist($e, &$ff, &$exclude)
 {
     //список разделов для селекта
     $xml = new xml($e);
     $shift = str_repeat('- ', $xml->evaluate('count(ancestor-or-self::sec)', $e));
     $res = $xml->query('sec', $e);
     foreach ($res as $sec) {
         if (!in_array($sec->getAttribute('id'), $exclude)) {
             $ff->addOption($sec->getAttribute('id'), $shift . $sec->getAttribute('title'));
             apSectionAdd::seclist($sec, $ff, $exclude);
         }
     }
 }