Example #1
0
 /**
  * @return HTML
  * @param string $templ_name - шаблон оформления по которому будет строится меню
  * @param int $max_level - Максимальное количество уровней вложенности
  * @param int $section_id - ID раздела сайта, с которого будет строится меню
  * @param int $max_count - Максимальное количество элементов в меню. Если указано 0 - без ограничений
  * @desc МАКРОС: Выполняет построение меню сайта в виде дерева
  */
 public function menu($templ_name = 'default', $max_level = 0, $section_id = 0, $max_count = 0)
 {
     $templ_file = '/structure/menu/' . $templ_name . '.tpl';
     $TEMPLATE = page::getTemplate($templ_file);
     if (!is_array($TEMPLATE)) {
         return page::errorNotFound('structure.menu', $templ_file);
     } else {
         ormPages::reset();
         $info = ormPages::getSectionByPath($section_id);
         if ($info['section'] instanceof ormPage) {
             $section_id = $info['section']->id;
         }
         $no_view = reg::getList(ormPages::getPrefix() . '/no_view');
         return $this->getMenuListFor($section_id, 1, $max_level, $max_count, $TEMPLATE, $templ_file, $no_view);
     }
 }