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


PHP menu::render方法代码示例

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


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

示例1: getUserProgress

 static function getUserProgress($id = 0, $complete = 0)
 {
     $data = R::duplicate($_SESSION['user']);
     $out = "<div class='col-sm-12'>\r\n            <div class=\"list-group\"><ul style='padding-left:0;'>";
     $out .= "<li class=\"list-group-item active\">";
     if ($id == 0 && $complete == 0) {
         $out .= "<h4 class=\"list-group-item-heading \"><a role='button' href='?ctrl=cabinet&action=GetCabinet' class='btn btn-info back_button'><span class=\"glyphicon glyphicon-arrow-left\" aria-hidden=\"true\"></span></a>В кабинет </h4>";
     }
     if ($complete == 1) {
         $out .= "<h4 class=\"list-group-item-heading \"><a role='button' href='?ctrl=cabinet&action=GetCabinet' class='btn btn-info back_button'><span class=\"glyphicon glyphicon-arrow-left\" aria-hidden=\"true\"></span></a>В кабинет</h4>";
     }
     if ($id != 0) {
         $out .= "<h4 class=\"list-group-item-heading \"><a role='button' href='?ctrl=cabinet&action=GetUserInformation' class='btn btn-info back_button'><span class=\"glyphicon glyphicon-arrow-left\" aria-hidden=\"true\"></span></a>Вернуться к списку</h4>";
     }
     //?ctrl=cabinet&action=GetUserInformation
     $out .= '</li></ul></div>';
     if ($id == 0) {
         $preWisdom = $data->ownInformation_userList;
         $arrayId = array();
         foreach ($preWisdom as $value) {
             if ($complete == 0) {
                 if (is_null($value->status) && is_null($value->education_id) && is_null($value->lesson_id)) {
                     $arrayId[] = $value->information_id;
                 }
             } else {
                 if (!is_null($value->status) && is_null($value->education_id) && is_null($value->lesson_id)) {
                     $arrayId[] = $value->information_id;
                 }
             }
         }
         $wisdom = R::loadAll('information', $arrayId);
     } else {
         // проверяем записан ли пользователь на данный УМ
         $userInfo = $data->ownInformation_userList;
         foreach ($userInfo as $value) {
             if ($value->information_id == $id) {
                 $wisdom = R::findAll('information', 'where id = ?', [$id]);
             }
         }
     }
     $typeMenu = '6';
     $typeMenu1 = '';
     if ($complete == 0) {
         if ($id === 0) {
             switch ($_SESSION['user']->status) {
                 case "student":
                     $typeMenu = 3;
                     $typeMenu1 = '';
                     break;
                 case "teacher":
                     $typeMenu = 7;
                     $typeMenu1 = 8;
                     break;
                 case "moderator":
                     $typeMenu = 4;
                     //                        $typeMenu1=8;
                     break;
                 case "admin":
                     $typeMenu = 9;
                     $typeMenu1 = 8;
                     break;
             }
         }
     }
     $bigMenu = new menu("SELECT menu_item.*\r\n        FROM  `menu` ,  `menu_item`\r\n        WHERE menu_item.menu_id = ?\r\n       AND menu.menu_id = menu_item.menu_id", [$typeMenu]);
     $bigMenu->ul_tpl = "<ul class=\"nav nav-tabs nav-justified menu_heavy\">";
     if (!empty($wisdom)) {
         foreach ($wisdom as $item) {
             $typeData = wisdom::getType($item);
             if ($typeData[3]->id == 6 && $id != 0) {
                 header('Location:?ctrl=wisdom&action=GetWisdomById&id=' . $id);
             }
             if ($id != 0) {
                 $itemClone = '';
                 if ($typeData[3]->id != 1) {
                     $itemClone = $item;
                 }
                 $modul = self::getInfoEducation($item, $itemClone);
             }
             if ($_SESSION['user']->status !== 'author') {
                 $autor = wisdom::getAuthorName($item->id);
                 $author = "<br><a  href='?ctrl=cabinet&action=UserInfo&id=" . $autor['id'] . "'>" . $autor['login'] . "</a> |\r\n                    <a  href='?ctrl=cabinet&action=UserInfo&id=" . $autor['id'] . "'> " . $autor['surname'] . " " . $autor['name'] . " " . $autor['andername'] . " </a> ";
             }
             $short_description = !empty($item->shortdescription) ? $item->shortdescription : 'Краткое описание отсутствует';
             $out .= "<li class=\"list-group-item\">\r\n                <ol class=\"breadcrumb\">\r\n                    <li><a href=\"?ctrl=wisdom&action=WisdomType&type=" . $typeData[3]->id . "&page=1\" > " . $typeData[3]->name . "</a></li>\r\n                    <li><a href=\"?ctrl=wisdom&action=WisdomType&type=" . $typeData[3]->id . "&subtype=" . $typeData[2]->id . "&page=1\" > " . $typeData[2]->name . "</a></li>\r\n                    <li><a href=\"?ctrl=wisdom&action=WisdomType&type=" . $typeData[3]->id . "&subtype=" . $typeData[2]->id . "&category=" . $typeData[1]->id . "&page=1\" > " . $typeData[1]->name . "</a></li>\r\n                    <li><a href=\"?ctrl=wisdom&action=WisdomType&type=" . $typeData[3]->id . "&subtype=" . $typeData[2]->id . "&category=" . $typeData[1]->id . "&subcategory=" . $typeData[0]->id . "&page=1\" > " . $typeData[0]->name . "</a></li>\r\n\r\n                </ol>\r\n            <h4 class=\"list-group-item-heading\"><a href='?ctrl=wisdom&action=GetWisdomById&id=" . $item->id . "'>" . $item->name . "</a></h4><h5>" . $author . "</h5>\r\n    <p class=\"list-group-item-text\">" . $short_description . "</p>" . $modul;
             if ($id === 0) {
                 $bigMenu->li_tpl = "<li  class=\"dropdown primary\"  role=\"presentation\"><a data-toggle=\"tooltip\" href='%s" . $item->id . "'>%s %s</a>%s</li>";
                 $out .= $bigMenu->render();
             }
             if ($_SESSION['user']->status !== 'student' && !empty($_SESSION['user']->status) && $id != 0) {
                 $out .= "<a role='button' href='?ctrl=teacher&action=AddModul&id=" . $id . "' class='btn btn-info btn-block'>Добавить модуль</a>";
             }
             $out .= "</li>";
             $out .= "</ul></div></div></div>";
         }
     }
     if (empty($wisdom)) {
         $out .= "Вы не подписанны на данный учебный материал";
     }
     return $out;
//.........这里部分代码省略.........
开发者ID:Jluct,项目名称:obuceisea,代码行数:101,代码来源:cabinet.php

示例2: menu

require_once __DIR__ . '/authorization.php';
?>
            </div>
        </div>
        <div class="row menu_heavy">
            <div class="col-sm-2">
                <img class="logo_img" src="images/logo.jpg">
<!--                Обучайся!-->
            </div>
            <div class="col-sm-9 actual_menu">

                <?php 
$bigMenu = new menu("SELECT menu_item.*\r\n        FROM  `menu` ,  `menu_item`\r\n        WHERE menu_item.menu_id = ?\r\n       AND menu.menu_id = menu_item.menu_id", [2]);
$bigMenu->ul_tpl = "<ul class=\"nav nav-tabs nav-justified menu_heavy\">";
$bigMenu->li_tpl = "<li  class=\"dropdown\"  role=\"presentation\"><a data-toggle=\"tooltip\" href='%s'>%s %s</a>%s</li>";
echo $bigMenu->render();
?>
            </div>
            <div class="col-sm-1">
                <button class="btn btn-block btn_search">Поиск</button>
            </div>
        </div>

        <?php 
// print_r($messageData);
?>

        <?php 
if (!empty($message)) {
    $mes = new messager($message[0]);
    $mes->setMessageControl(true)->setHeader($message[1])->setTplClassVariable($message[2]);
开发者ID:Jluct,项目名称:obuceisea,代码行数:31,代码来源:header.php


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