当前位置: 首页>>代码示例>>PHP>>正文


PHP Menu::getAll方法代码示例

本文整理汇总了PHP中Menu::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::getAll方法的具体用法?PHP Menu::getAll怎么用?PHP Menu::getAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Menu的用法示例。


在下文中一共展示了Menu::getAll方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 public function indexAction()
 {
     $orden = (string) $this->_request->getParam('orden', 0);
     $asc = (bool) $this->_request->getParam('asc', 0);
     if (empty($orden)) {
         $orden = "id";
     }
     if ($asc) {
         $orden .= " ASC";
     } else {
         $orden .= " DESC";
     }
     $this->view->orden_asc = $asc;
     $this->view->subtitle = $this->info->sitio->menu->index->titulo;
     $this->view->menu = Menu::getAll($this->session->sitio->id, null, $orden);
 }
开发者ID:anavarretev,项目名称:surforce-cms,代码行数:16,代码来源:MenuController.php

示例2: addMenu

 public function addMenu()
 {
     $results = Menu::getAll();
     $dyn_table = "<table border='1' id='patient_listing'  cellpadding='5' class='dataTables'>";
     $dyn_table .= "<thead><tr><th>Menu Name</th><th>Menu URL</th><th>Menu Description</th><th> Options</th></tr></thead><tbody>";
     if ($results) {
         foreach ($results as $result) {
             if ($result['active'] == "1") {
                 $option = "<a href='#edit_menu' data-toggle='modal' role='button' class='edit' table='menu' menu_name='" . $result['Menu_Text'] . "' menu_url='" . $result['Menu_Url'] . "' menu_desc='" . $result['Description'] . "' menu_id='" . $result['id'] . "'>Edit</a> | <a href='" . base_url() . "admin_management/disable/menu/" . $result['id'] . "' class='red'>Disable</a>";
             } else {
                 $option = "<a href='#edit_menu' data-toggle='modal' role='button' class='edit' table='menu' menu_name='" . $result['Menu_Text'] . "' menu_url='" . $result['Menu_Url'] . "' menu_desc='" . $result['Description'] . "' menu_id='" . $result['id'] . "'>Edit</a> | <a href='" . base_url() . "admin_management/enable/menu/" . $result['id'] . "' class='green'>Enable</a>";
             }
             $dyn_table .= "<tr><td>" . $result['Menu_Text'] . "</td><td>" . $result['Menu_Url'] . "</td><td>" . $result['Description'] . "</td><td>" . $option . "</td></tr>";
         }
     }
     $dyn_table .= "</tbody></table>";
     $data['label'] = 'Menu';
     $data['table'] = 'menu';
     $data['column'] = 'active';
     $data['actual_page'] = 'View Menus';
     $data['dyn_table'] = $dyn_table;
     $this->base_params($data);
 }
开发者ID:OmondiKevin,项目名称:ADT_MTRH,代码行数:23,代码来源:admin_management.php

示例3: getAll

 /**
  * Возвращает все меню
  * @return Menu
  */
 public function getAll()
 {
     return Menu::getAll();
 }
开发者ID:kot-ezhva,项目名称:ygin,代码行数:8,代码来源:DaMenu.php

示例4: actionAjaxLink

 public function actionAjaxLink()
 {
     /*global $locale;
       $locale->init();
       if ($locale->getDataLocale() != DA_LOCALE_MAIN) {
         UrlPage::setGlobalUrlPrefix($locale->getCode());
       }*/
     // Создаём и наполняем объект по работе с меню.
     $menu = Menu::getAll();
     list($array, $arrayLinks) = $this->getMenu($menu);
     $result = array('arr' => $array, 'links' => $arrayLinks);
     echo CJSON::encode($result);
 }
开发者ID:Cranky4,项目名称:npfs,代码行数:13,代码来源:EngineController.php

示例5:

include_once 'class/payment_menu.class.php';
$device_id = (int) $_GET['id'];
$start = 0;
$stop = 0;
// Get device by id for get cost only
$device = Device::getById($device_id);
// Get payment of device
$payment = Payment::getByDevice($device_id);
if ($payment) {
    if ($payment->get_start()) {
        $start = 1;
    }
    if ($payment->get_stop()) {
        $stop = 1;
    }
    // Assign list menu in payment
    $smarty->assign('list_payment_menu', Payment_Menu::getByPayment($payment->get_id()));
    // Assign payment
    $smarty->assign('payment', $payment);
}
// List menu
$list_menu = Menu::getAll();
// List device for switch device
$list_device = Device::getAll();
$smarty->assign('start', $start);
$smarty->assign('stop', $stop);
$smarty->assign('device', $device);
$smarty->assign('list_device', $list_device);
$smarty->assign('list_menu', $list_menu);
$smarty->assign('menu', 1);
$smarty->display('detail.tpl');
开发者ID:nguyentien,项目名称:ps3,代码行数:31,代码来源:detail.php

示例6: strtoupper

<header>
	<div id="logo">
		<h1>Bodybuilding <span class='logo_span'>SRB</span></h1>
	</div>
	<nav id="main_nav">
		<ul>
			<?php 
$activePage = $_SERVER['REQUEST_URI'];
$menu = Menu::getAll();
foreach ($menu as $value) {
    $url = "/bodybuilding/" . $value->file;
    ?>
			 	<li <?php 
    if ($url === $activePage) {
        ?>
class="active"<?php 
    }
    ?>
>
	 		 		<a href="<?php 
    echo $url;
    ?>
"><?php 
    echo strtoupper($value->title);
    ?>
</br>
	 		 			<span class='nav_span'><?php 
    echo ucfirst($value->eng);
    ?>
</span>
	 		 		</a>
开发者ID:este93,项目名称:bodybuilding,代码行数:31,代码来源:header.php

示例7: Menu

                                <th>Id</th>
                                <th>Image</th>
                                <th>Name</th>
                                <th>Category</th>
                                <th>Parent</th>
                                <th>Url</th>                               
                                <th>Access Type</th>
                                <th>Order</th>
                                 <th>Status</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                             <?php 
$menuObj = new Menu();
$rows = $menuObj->getAll();
foreach ($rows as $row) {
    ?>
                            <tr>
                                <td class="center"><?php 
    echo $row['id'];
    ?>
</td>
                                <td><?php 
    if ($row['image'] == '') {
    } else {
        ?>
                                    <img src="<?php 
        echo MENU_IMG_URL . "/" . $row['image'];
        ?>
" name="" rel="" width="80px"height="75px"/>
开发者ID:sonaljain888,项目名称:project-legal-lawyer-,代码行数:31,代码来源:menu.php

示例8: AdminPage

<?php

require_once "config.php";
$page = new AdminPage();
$menu = new Menu();
$page->title = "Menu List";
$menulist = $menu->getAll();
$page->smarty->assign('menulist', $menulist);
$page->content = $page->smarty->fetch('menu-list.tpl');
$page->render();
开发者ID:RickDB,项目名称:newznab-tmux,代码行数:10,代码来源:menu-list.php

示例9: encHTML

    function MenuSetting()
    {
        ?>
<style type="text/css">
button{
  background: #fff;
  border: solid 1px #000;
  color: #000;
}

.tree_hover{
  background: #fdd;
}

.tree_item{
  padding: 2px;
  list-style: none;
}

.tree_item span:hover{
  background: #ddd;
  cursor: pointer;
}

.tree_item span{
  border-bottom: solid 1px #aaa;
}
</style>

<div id="printOut" style="display:none;"></div>
<div class="col-md-8">
    <div style="padding: 10px; padding-bottom: 20px; padding-left: 0px;">
<button id="save" class="btn btn-default"><?php 
        echo Lang::t('Save Menu Structure');
        ?>
</button> 
    </div>
<ul id="tag_tree">
    <?php 
        $menu = new Menu();
        $arr = $menu->getAll();
        // pr($arr);
        foreach ($arr as $n => $obj) {
            $anak2[$obj->menu_parent_id][] = $obj;
        }
        //pr($anak2);
        ?>
 
    
<li id="active-menu" class="tree_item"><span>Active Menu</span>
<?php 
        $this->printTreeRecursive(0, $anak2);
        ?>
</li>
<li id="non-active-menu" class="tree_item"><span>Non-Active Menu</span>
<?php 
        $this->printTreeRecursive(-1, $anak2);
        ?>
</li>
    

</ul>
</div>
<div class="col-md-4">
    <h3>Add and Edit Menu</h3>
    <small>To create a new menu, just fill in the needed data, to edit a menu just double click on the menu name</small>
    <form class="form-horizontal" onsubmit="return false;">
     <input type="hidden" id="menu_id">
  <div class="form-group">
    <label for="menu_name" class="col-sm-2 control-label"><?php 
        echo Lang::t('Menu Name');
        ?>
</label>
    <div class="col-sm-10">
      <input id="menu_name" type="text" class="form-control" placeholder="<?php 
        echo Lang::t('Menu Name');
        ?>
">
    </div>
  </div>
  <div class="form-group">
    <label for="menu_url" class="col-sm-2 control-label"><?php 
        echo Lang::t('Menu URL');
        ?>
</label>
    <div class="col-sm-10">
      <input id="menu_url" type="text" class="form-control" placeholder="<?php 
        echo Lang::t('Menu URL');
        ?>
">
    </div>
  </div>
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
        <button onclick="editMenu();" class="btn btn-default"><?php 
        echo Lang::t('Edit');
        ?>
</button>
       <button onclick="saveMenu();" class="btn btn-default"><?php 
//.........这里部分代码省略.........
开发者ID:CapsuleCorpIndonesia,项目名称:biji_katak,代码行数:101,代码来源:MenuAdminWebAuto.php

示例10: Menu

<?php

include_once 'class/menu.class.php';
// Insert
if (isset($_POST['insert'])) {
    $menu = new Menu();
    $menu->set_name((string) $_POST['name']);
    $menu->set_unit((string) $_POST['unit']);
    $menu->set_cost((double) $_POST['cost']);
    Menu::save($menu);
    die('1');
}
// Update
if (isset($_POST['update'])) {
    $menu = new Menu();
    $menu->set_id((int) $_POST['id']);
    $menu->set_name((string) $_POST['name']);
    $menu->set_unit((string) $_POST['unit']);
    $menu->set_cost((double) $_POST['cost']);
    Menu::save($menu);
    die('1');
}
// Delete
if (isset($_POST['delete'])) {
    Menu::delete((int) $_POST['id']);
    die('1');
}
$menus = Menu::getAll();
$smarty->assign('menus', $menus);
$smarty->display('menu.tpl');
开发者ID:nguyentien,项目名称:ps3,代码行数:30,代码来源:menu.php

示例11: menu

    function menu()
    {
        $menu = new Menu();
        $arr = $menu->getAll();
        // pr($arr);
        $anak2 = array();
        foreach ($arr as $n => $obj) {
            $anak2[$obj->menu_parent_id][] = $obj;
        }
        ?>

        <?php 
        $this->printTreeRecursive(0, $anak2);
        ?>


        <div class="clearfix"></div>
    <?php 
    }
开发者ID:CapsuleCorpIndonesia,项目名称:biji_katak,代码行数:19,代码来源:WebAppsMain.php

示例12: actionIndex

 public function actionIndex()
 {
     // объекты, по которым идет поиск
     // SELECT DISTINCT a.id_object, a.name FROM `da_object` a JOIN da_object_parameters b ON a.id_object = b.id_object WHERE b.search =1
     $query = HU::get('query');
     $error = null;
     $searchResult = array();
     $total = 0;
     try {
         $search = new SearchComponent();
         $search->logQuery = true;
         $search->criteria = $this->criteria;
         $paginator = new CPagination();
         $paginator->setPageSize($this->module->pageSize);
         $paginator->validateCurrentPage = false;
         $search->paginator = $paginator;
         $searchMode = SearchComponent::SEARCH_MODE_SOFT;
         if ($this->module->searchModeEnable) {
             $searchMode = HU::get('search_mode', SearchComponent::SEARCH_MODE_SOFT);
         }
         $search->setSearchMode($searchMode);
         $search->setMinQuery($this->module->queryMin);
         $search->setMaxQuery($this->module->queryMax);
         $search->setLenPreviewText($this->module->lengthPreview);
         $search->setHighlightTemplate($this->module->highlight);
         // TODO доработать поиск. Чтоб учитывалось отключение и подключение плагинов
         /*if (!Yii::app()->hasModule('news')) {
             $notSearch[] =
           }*/
         $search->setObjectNotSearchList($this->module->objectNotSearch);
         // объекты, по которым пока не поддерживается работа
         $search->setObjectSearchList($this->module->objectSearchList);
         $searchResult = $search->startSearch($query);
         $total = $search->getTotalResult();
     } catch (ErrorException $e) {
         $error = $e->getMessage();
     }
     $results = array();
     foreach ($searchResult as $cur) {
         $results[$cur->id_object][$cur->id_instance] = $cur->id_instance;
     }
     $menu = Menu::getAll();
     foreach (array_keys($results) as $idObject) {
         $data = array();
         $model = null;
         switch ($idObject) {
             case Menu::ID_OBJECT:
                 foreach ($results[$idObject] as $id) {
                     $item = $menu->getById($id);
                     if ($item != null) {
                         $data[] = $item;
                     }
                 }
                 break;
                 /*        case News::ID_OBJECT:
                           $model = News::model();
                           break;
                         case Product::ID_OBJECT:
                           $model = Product::model();
                           break;
                         case ProductCategory::ID_OBJECT:
                           $model = ProductCategory::model();
                           break;*/
             /*        case News::ID_OBJECT:
                       $model = News::model();
                       break;
                     case Product::ID_OBJECT:
                       $model = Product::model();
                       break;
                     case ProductCategory::ID_OBJECT:
                       $model = ProductCategory::model();
                       break;*/
             default:
                 $object = DaObject::getById($idObject, false);
                 $model = $object->getModel();
                 if (!$model instanceof ISearchable) {
                     throw new Exception("Ошибка поиска данных по объекту " . $idObject . ", обратитесь к разработчикам.");
                 }
         }
         if ($model != null) {
             $cr = new CDbCriteria();
             $cr->addInCondition($model->getPKName(), $results[$idObject]);
             $data = $model->findAll($cr);
         }
         $results[$idObject] = array();
         foreach ($data as $r) {
             $results[$idObject][$r->getPrimaryKey()] = $r;
         }
     }
     foreach ($searchResult as $cur) {
         if (isset($results[$cur->id_object][$cur->id_instance])) {
             $model = $results[$cur->id_object][$cur->id_instance];
             $cur->model = $model;
             $cur->link = $model->getSearchUrl();
             $cur->title = $model->getSearchTitle();
             /*        switch ($cur->id_object) {
                       case Menu::ID_OBJECT:
                         $cur->link = $model->getUrl();
                         $cur->title = $model->name;
                         break;
//.........这里部分代码省略.........
开发者ID:kot-ezhva,项目名称:ygin,代码行数:101,代码来源:SearchController.php


注:本文中的Menu::getAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。