Пример #1
0
 function run()
 {
     $id = 1;
     if (is_numeric(Funcs::$uri[2])) {
         $id = Funcs::$uri[2];
     } elseif (is_numeric($_GET['parent'])) {
         $id = $_GET['parent'];
     } elseif (is_numeric($_GET['id'])) {
         $sql = 'SELECT parent FROM {{tree}} WHERE id=' . $_GET['id'];
         $id = DB::getOne($sql);
     }
     View::$layout = 'empty';
     View::render('tree/tree', array('tree' => TreeWidget::getTree($id)));
 }
Пример #2
0
 function getBranch($parent, $tree)
 {
     $data = array();
     if (count(TreeWidget::$tree[$parent]) > 0) {
         foreach (TreeWidget::$tree[$parent] as $id => $item) {
             if (in_array($id, $tree)) {
                 $item['sub'] = TreeWidget::getBranch($id, $tree);
                 $item['selected'] = 'selected';
             } elseif (count(TreeWidget::$tree[$id]) > 0) {
                 $item['inner'] = 'inner';
             }
             $data[] = $item;
         }
     }
     return $data;
 }
Пример #3
0
 public function treemenu()
 {
     TreeWidget::ajax();
 }
Пример #4
0
    ?>
cell_content_full<?php 
}
?>
">
				<?php 
if (Funcs::$uri[1] != 'work' && Funcs::$uri[1] != '') {
    ?>
                	<?php 
    echo MenuWidget::run();
    ?>
                <?php 
} else {
    ?>
					<?php 
    echo TreeWidget::run();
    ?>
				<?php 
}
?>
				{content}
			</div>
		</div>
	</section>
	<section class="popup popup_section-settings jsSectionSettingsPopup">
		<ul>
			<li class="popup_section-settings_option" onclick="document.location.href='/<?php 
echo Funcs::$cdir;
?>
/work/showedit/?id='+$(this).parent().parent().attr('ids')">Редактировать</li>
			<li class="popup_section-settings_option" onclick="clearCache($(this).parent().parent().attr('ids'))">Сбросить кэш</li>