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


PHP bootstrap::list_divider方法代码示例

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


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

示例1: signed_in

 public static function signed_in($user, $loginfailures, $mnet, $real, $role_switch, $logout)
 {
     $links[] = bootstrap::li_icon_link($user['link'], 'user', 'Profile');
     if ($mnet !== null) {
         $links[] = bootstrap::li_icon_link($mnet['link'], 'globe', $mnet['name']);
     }
     if (isset($loginfailures)) {
         $links[] = bootstrap::li_icon_link($loginfailures['link'], 'warning-sign', $loginfailures['name']);
         $user['name'] .= ' ' . bootstrap::icon('warning-sign');
     }
     if ($role_switch !== null) {
         $links[] = bootstrap::li_icon_link($role_switch['link'], 'repeat', $role_switch['name']);
     }
     if ($real !== null) {
         $links[] = bootstrap::li_icon_link($real['link'], 'user', $real['name']);
     }
     $links[] = bootstrap::list_divider();
     $links[] = bootstrap::li_icon_link($logout['link'], 'off', $logout['name']);
     return html::ul('nav pull-right', bootstrap::dropdown_menu($user['name'], $links));
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:20,代码来源:bootsnipp.php

示例2: render_custom_menu_item

 protected function render_custom_menu_item(custom_menu_item $menunode, $submenu = null)
 {
     if ('list_divider' === $menunode->get_text()) {
         return bootstrap::list_divider();
     }
     if (!$menunode->has_children()) {
         return $this->render_custom_menu_leaf($menunode);
     }
     foreach ($menunode->get_children() as $child) {
         $items[] = $this->render_custom_menu_item($child, true);
     }
     if ($submenu === true) {
         return html::li(bootstrap::dropdown_submenu($menunode->get_text(), $items));
     } else {
         return html::li(bootstrap::dropdown_menu($menunode->get_text(), $items));
     }
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:17,代码来源:core_renderer.php

示例3: navigation_node

 protected function navigation_node(navigation_node $node, $attrs = array('class' => 'nav nav-list'))
 {
     $items = $node->children;
     // exit if empty, we don't want an empty ul element
     if ($items->count() == 0) {
         return '';
     }
     // array of nested li elements
     $lis = array();
     foreach ($items as $item) {
         if (!$item->display) {
             continue;
         }
         $isbranch = $item->children->count() > 0 || $item->nodetype == navigation_node::NODETYPE_BRANCH;
         $hasicon = !$isbranch && $item->icon instanceof renderable;
         if ($isbranch) {
             $item->hideicon = true;
         }
         $content = $this->output->render($item);
         // this applies to the li item which contains all child lists too
         $liclasses = array($item->get_css_type());
         $liexpandable = array();
         if (!$item->forceopen || !$item->forceopen && $item->collapse || $item->children->count() == 0 && $item->nodetype == navigation_node::NODETYPE_BRANCH) {
             $liclasses[] = 'collapsed';
         }
         if ($isbranch) {
             $liclasses[] = 'contains_branch';
             $liexpandable = array('aria-expanded' => in_array('collapsed', $liclasses) ? "false" : "true");
         } else {
             if ($hasicon) {
                 $liclasses[] = 'item_with_icon';
             }
         }
         if ($item->isactive === true) {
             $liclasses[] = 'current_branch';
             $liclasses[] = 'active';
         }
         $liattr = array('class' => join(' ', $liclasses)) + $liexpandable;
         // class attribute on the div item which only contains the item content
         $divclasses = array('tree_item');
         if ($isbranch) {
             $divclasses[] = 'branch';
         } else {
             $divclasses[] = 'leaf';
         }
         if (!empty($item->classes) && count($item->classes) > 0) {
             $divclasses[] = join(' ', $item->classes);
         }
         $divattr = array('class' => join(' ', $divclasses));
         if (!empty($item->id)) {
             $divattr['id'] = $item->id;
         }
         $content = $this->rewrite_tree_node($content, $divclasses);
         $content .= $this->navigation_node($item);
         $content = html_writer::tag('li', $content, $liattr);
         if (!empty($item->preceedwithhr) && $item->preceedwithhr === true) {
             $content = bootstrap::list_divider() . $content;
         }
         $lis[] = $content;
     }
     if (count($lis)) {
         return html_writer::tag('ul', implode("\n", $lis), $attrs);
     } else {
         return '';
     }
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:66,代码来源:block_settings_renderer.php

示例4: navigation_node


//.........这里部分代码省略.........
         }
         $content = $item->get_content();
         $title = $item->get_title();
         $isexpandable = empty($expansionlimit) || ($item->type > navigation_node::TYPE_ACTIVITY || $item->type < $expansionlimit) || $item->contains_active_node() && $item->children->count() > 0;
         $isbranch = $isexpandable && ($item->children->count() > 0 || $item->has_children() && (isloggedin() || $item->type <= navigation_node::TYPE_CATEGORY));
         // Skip elements which have no content and no action - no point in showing them
         if (!$isexpandable && empty($item->action)) {
             continue;
         }
         $hasicon = (!$isbranch || $item->type == navigation_node::TYPE_ACTIVITY || $item->type == navigation_node::TYPE_RESOURCE) && $item->icon instanceof renderable;
         if ($hasicon) {
             $icon = $this->output->render($item->icon);
         } else {
             $icon = '';
         }
         $content = $icon . $content;
         // use CSS for spacing of icons
         if ($item->helpbutton !== null) {
             $content = trim($item->helpbutton) . html_writer::tag('span', $content, array('class' => 'clearhelpbutton'));
         }
         if ($content === '') {
             continue;
         }
         $attributes = array();
         if ($title !== '') {
             $attributes['title'] = $title;
         }
         if ($item->hidden) {
             $attributes['class'] = 'dimmed_text';
         }
         if (is_string($item->action) || empty($item->action) || $item->type === navigation_node::TYPE_CATEGORY && empty($options['linkcategories'])) {
             $attributes['tabindex'] = '0';
             //add tab support to span but still maintain character stream sequence.
             $content = html_writer::tag('span', $content, $attributes);
         } else {
             if ($item->action instanceof action_link) {
                 //TODO: to be replaced with something else
                 $link = $item->action;
                 $link->text = $icon . $link->text;
                 $link->attributes = array_merge($link->attributes, $attributes);
                 $content = $this->output->render($link);
                 $linkrendered = true;
             } else {
                 if ($item->action instanceof moodle_url) {
                     $content = html_writer::link($item->action, $content, $attributes);
                 }
             }
         }
         // this applies to the li item which contains all child lists too
         $liclasses = array($item->get_css_type(), 'depth_' . $depth);
         $liexpandable = array();
         if ($item->has_children() && (!$item->forceopen || $item->collapse)) {
             $liclasses[] = 'collapsed';
         }
         if ($isbranch) {
             $liclasses[] = 'contains_branch';
             $liexpandable = array('aria-expanded' => in_array('collapsed', $liclasses) ? "false" : "true");
         } else {
             if ($hasicon) {
                 $liclasses[] = 'item_with_icon';
             }
         }
         if ($item->isactive === true) {
             $liclasses[] = 'current_branch';
             $liclasses[] = 'active';
         }
         $liattr = array('class' => join(' ', $liclasses)) + $liexpandable;
         // class attribute on the div item which only contains the item content
         $divclasses = array('tree_item');
         if ($isbranch) {
             $divclasses[] = 'branch';
         } else {
             $divclasses[] = 'leaf';
         }
         if ($hasicon) {
             $divclasses[] = 'hasicon';
         }
         if (!empty($item->classes) && count($item->classes) > 0) {
             $divclasses[] = join(' ', $item->classes);
         }
         $divattr = array('class' => join(' ', $divclasses));
         if (!empty($item->id)) {
             $divattr['id'] = $item->id;
         }
         $content = $this->rewrite_tree_node($content, $divclasses);
         if ($isexpandable) {
             $content .= $this->navigation_node($item->children, array('class' => 'nav nav-list'), $expansionlimit, $options, $depth + 1);
         }
         if (!empty($item->preceedwithhr) && $item->preceedwithhr === true) {
             $content = bootstrap::list_divider() . $content;
         }
         $content = html_writer::tag('li', $content, $liattr);
         $lis[] = $content;
     }
     if (count($lis)) {
         return html_writer::tag('ul', implode("\n", $lis), $attrs);
     } else {
         return '';
     }
 }
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:101,代码来源:block_navigation_renderer.php


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