Protected method to create the common items of the navbar in every page type.
437937
protected function create_navbar() {
        global $PAGE, $CFG;

        $PAGE->navbar->add(format_string($this->title), $CFG->wwwroot . '/mod/wiki/view.php?pageid=' . $this->page->id);
    }
738548
function () {
                var items = this.items;
                var itemsLength = items.length;
                var pageSize = this.pageSize;
                if (pageSize <= 0) {
                    pageSize = -1;
                }
                var pages = [], pageLength = 0;
                var pageIndex = 0;
                var nbElementsInPage = 0;
                var firstElement = -1;
                for (var i = 0; i < itemsLength; i++) {
                    var elt = items[i];
                    if (elt.filteredIn) {
                        if (nbElementsInPage === 0) {
                            firstElement = i;
                        }
                        nbElementsInPage++;
                        elt.pageIndex = pageIndex;
                        if (nbElementsInPage == pageSize) {
                            pages[pageLength++] = {
                                pageIndex : pageIndex,
                                pageNumber : pageIndex + 1,
                                firstItemIndex : firstElement,
                                lastItemIndex : i,
                                firstItemNumber : pageIndex * pageSize + 1,
                                lastItemNumber : (pageIndex + 1) * pageSize
                            };
                            pageIndex++;
                            nbElementsInPage = 0;
                        }
                    } else {
                        elt.pageIndex = -1;
                    }
                }
                this._currentState.pageSize = pageSize;
                this.pageMode = (pageSize > 0);
                this.filteredInCount = pageIndex * pageSize + nbElementsInPage; // true even when pageMode == false (as
                // pageIndex == 0)
                if (nbElementsInPage > 0) {
                    pages[pageLength++] = {
                        pageIndex : pageIndex,
                        pageNumber : pageIndex + 1,
                        firstItemIndex : firstElement,
                        lastItemIndex : itemsLength - 1,
                        firstItemNumber : pageIndex * pageSize + 1,
                        lastItemNumber : this.filteredInCount
                    };
                }
                if (pageLength === 0) {
                    // there always must be at least one page
                    pages = this.EMPTY_PAGES;
                }
                this.pages = pages;
            }
1137160
function () {
        var self = this, items = self.items();

        if (!self.settings.formItemDefaults) {
          self.settings.formItemDefaults = {
            layout: 'flex',
            autoResize: "overflow",
            defaults: { flex: 1 }
          };
        }

        // Wrap any labeled items in FormItems
        items.each(function (ctrl) {
          var formItem, label = ctrl.settings.label;

          if (label) {
            formItem = new FormItem(Tools.extend({
              items: {
                type: 'label',
                id: ctrl._id + '-l',
                text: label,
                flex: 0,
                forId: ctrl._id,
                disabled: ctrl.disabled()
              }
            }, self.settings.formItemDefaults));

            formItem.type = 'formitem';
            ctrl.aria('labelledby', ctrl._id + '-l');

            if (typeof ctrl.settings.flex == "undefined") {
              ctrl.settings.flex = 1;
            }

            self.replace(ctrl, formItem);
            formItem.add(ctrl);
          }
        });
      }
1320682
private function createSinglePage()
    {
        if (isset($this->config['single_pages'])) {
            $themes = $this->config['single_pages'];
            foreach ($themes as $key => $v) {
                $theme_page = $this->source_dir.DIRECTORY_SEPARATOR . $v;
                if ( file_exists($theme_page) ) {
                    $file_path = $this->public_dir . DIRECTORY_SEPARATOR . $key . '/index.html';
                    $html = $this->renderArticle($theme_page, true);
                    $this->fileSys->create($file_path, $html);
                }
            }
        }
    }
564597
public function createItem()
    {
        if(!\tao_helpers_Request::isAjax()){
            throw new common_exception_BadRequest('wrong request mode');
        }
        $clazz = new \core_kernel_classes_Resource($this->getRequestParameter('id'));
        if ($clazz->isClass()) {
            $clazz = new \core_kernel_classes_Class($clazz);
        } else {
            foreach ($clazz->getTypes() as $type) {
                // determine class from selected instance
                $clazz = $type;
                break;
            }
        }
        $service = \taoItems_models_classes_ItemsService::singleton();

        $label = $service->createUniqueLabel($clazz);
        $item = $service->createInstance($clazz, $label);

        if(!is_null($item)){
            $service->setItemModel($item, new \core_kernel_classes_Resource(ItemModel::MODEL_URI));
            $this->getEventManager()->trigger(new ItemCreatedEvent($item->getUri()));
            $response = array(
                'label'	=> $item->getLabel(),
                'uri' 	=> $item->getUri()
            );
        } else {
            $response = false;
        }
        $this->returnJson($response);
    }
240444
public void setHasFacingPages() {
        if(this.mode == MODE_SINGLE) {
            this.mode = MODE_MULTIPLE;
            this.headerLeft = new RtfHeaderFooter(this.document, this.headerAll, RtfHeaderFooter.DISPLAY_LEFT_PAGES);
            this.headerLeft.setType(this.type);
            this.headerRight = new RtfHeaderFooter(this.document, this.headerAll, RtfHeaderFooter.DISPLAY_RIGHT_PAGES);
            this.headerRight.setType(this.type);
            this.headerAll = null;
        } else if(this.mode == MODE_MULTIPLE) {
            if(this.headerLeft == null && this.headerAll != null) {
                this.headerLeft = new RtfHeaderFooter(this.document, this.headerAll, RtfHeaderFooter.DISPLAY_LEFT_PAGES);
                this.headerLeft.setType(this.type);
            }
            if(this.headerRight == null && this.headerAll != null) {
                this.headerRight = new RtfHeaderFooter(this.document, this.headerAll, RtfHeaderFooter.DISPLAY_RIGHT_PAGES);
                this.headerRight.setType(this.type);
            }
            this.headerAll = null;
        }
    }
828720
function ConfigureWebPageElements(n) {
        RED.nodes.createNode(this, n);

        this.usecount = 0;

        this.name = n.name;
        this.expression = n.expression;
        this.selector = n.selector;
        this.page = n.page;
        this.markers = n.markers;
        this.framePath = n.framePath;

        let node = this;
        // node.log(n);
        this.register = function() {
            node.usecount += 1;
        };

        this.deregister = function() {
            node.usecount -= 1;
            if (node.usecount == 0) {
            }
        };
    }
1245919
def map_navigation(self):
        
        #All articles should have titles
        title_id = 'titlepage-{0}'.format(self.article_doi)
        title_label = self.article.publisher.nav_title()
        title_source = 'main.{0}.xhtml#title'.format(self.article_doi)
        title_navpoint = navpoint(title_id, title_label, self.play_order,
                                  title_source, [])
        self.nav.append(title_navpoint)
        #When processing a collection of articles, we will want all subsequent
        #navpoints for this article to be located under the title
        if self.collection:
            nav_insertion = title_navpoint.children
        else:
            nav_insertion = self.nav

        #If the article has a body, we'll need to parse it for navigation
        if self.article.body is not None:
            #Here is where we invoke the recursive parsing!
            for nav_pt in self.recursive_article_navmap(self.article.body):
                nav_insertion.append(nav_pt)

        #Add a navpoint to the references if appropriate
        if self.article.root.xpath('./back/ref'):
            ref_id = 'references-{0}'.format(self.article_doi)
            ref_label = 'References'
            ref_source = 'biblio.{0}.xhtml#references'.format(self.article_doi)
            ref_navpoint = navpoint(ref_id, ref_label, self.play_order,
                                    ref_source, [])
            nav_insertion.append(ref_navpoint)
1236468
public List<CmsJspNavElement> getItems() {

        if (m_items == null) {
            switch (m_type) {
                // calculate the results based on the given parameters
                case forFolder:
                    if (m_startLevel == Integer.MIN_VALUE) {
                        // no start level set
                        if (m_resource == null) {
                            m_items = m_builder.getNavigationForFolder();
                        } else {
                            m_items = m_builder.getNavigationForFolder(m_resource);
                        }
                    } else {
                        // start level is set
                        if (m_resource == null) {
                            m_items = m_builder.getNavigationForFolder(m_startLevel);
                        } else {
                            m_items = m_builder.getNavigationForFolder(m_resource, m_startLevel);
                        }
                    }
                    break;
                case forSite:
                    if (m_resource == null) {
                        m_items = m_builder.getSiteNavigation();
                    } else {
                        m_items = m_builder.getSiteNavigation(m_resource, m_endLevel);
                    }
                    break;
                case breadCrumb:
                    if (m_resource != null) {
                        // resource is set
                        m_items = m_builder.getNavigationBreadCrumb(
                            m_resource,
                            m_startLevel,
                            m_endLevel,
                            Boolean.valueOf(m_param).booleanValue());
                    } else {
                        if (m_startLevel == Integer.MIN_VALUE) {
                            // default start level is zero
                            m_items = m_builder.getNavigationBreadCrumb(0, Boolean.valueOf(m_param).booleanValue());
                        } else {
                            if (m_endLevel != Integer.MIN_VALUE) {
                                m_items = m_builder.getNavigationBreadCrumb(m_startLevel, m_endLevel);
                            } else {
                                m_items = m_builder.getNavigationBreadCrumb(
                                    m_startLevel,
                                    Boolean.valueOf(m_param).booleanValue());
                            }
                        }
                    }
                    break;
                case treeForFolder:
                    if (m_resource == null) {
                        m_items = m_builder.getNavigationTreeForFolder(m_startLevel, m_endLevel);
                    } else {
                        m_items = m_builder.getNavigationTreeForFolder(m_resource, m_startLevel, m_endLevel);
                    }
                    break;
                case forResource:
                default:
                    List<CmsJspNavElement> items = new ArrayList<CmsJspNavElement>(1);
                    if (m_resource == null) {
                        items.add(m_builder.getNavigationForResource());
                    } else {
                        items.add(m_builder.getNavigationForResource(m_resource));
                    }
                    m_items = items;
                    break;
            }
        }
        return m_items;
    }
415844
private void createNavigationInternal(StringBuffer buffer, List<CmsJspNavElement> navElements) {

        // take the element to render.
        CmsJspNavElement element = navElements.remove(0);
        int elementLevel = element.getNavTreeLevel();
        String spacing = getSpaces(elementLevel * 2);
        // render element:
        buffer.append(spacing).append("<li>\n");
        buffer.append(spacing).append("  <a href=\"");
        buffer.append(m_jsp.link(element.getResourceName()));
        buffer.append("\" title=\"");
        buffer.append(element.getNavText());
        buffer.append("\"");
        if (elementLevel == 1) {
            buffer.append(" class=\"bold\"");
        }
        buffer.append(">");
        buffer.append(element.getNavText());
        buffer.append("</a>\n");

        // peek at the next (list is depth - first by contract)
        if (!navElements.isEmpty()) {
            CmsJspNavElement child = navElements.get(0);
            int childLevel = child.getNavTreeLevel();
            if (elementLevel < childLevel) {
                // next one goes down a level: it is a child by tree means
                buffer.append(spacing).append("  <ul>\n");
            } else if (elementLevel == childLevel) {
                // it is a sibling: close our list item, no recursion
                buffer.append(spacing).append("</li>\n");
            } else {
                // next element gets up one layer
                // this has to happen because of the depth-first contract!
                buffer.append(spacing).append("  </li>\n").append(spacing).append("</ul>\n");
            }
            createNavigationInternal(buffer, navElements);
        } else {
            // no more next elements: get back and close all lists (by using the recursion we are in)
            buffer.append(spacing).append("  </li>\n").append(spacing).append("</ul>\n");
        }

    }
1289871
public function generateItems()
    {
        // Iterator for pagination pages.
        $j = 1;

        foreach ($this->getLinks() as $index => $link) {
            // Create new pagination item
            $item = new PaginationItem($link);

            // If we on first link and currently active page is not first,
            // we know that this link is for previous pagination item.
            if ($index === 0 && $this->currentPage != 1) {
                $this->markAsPrevious($item);

                continue;
            }

            // If we on last link and currently active page is not last,
            // we know that this link is for next pagination item.
            if (
                $index === $this->getLinksCount(true)
                && $this->currentPage != $this->getLinksCount(true)
            ) {
                $this->markAsNext($item);

                break;
            }

            // We can't use loop index, because sometimes first and
            // last link are for the next and previous item, so use
            // external iterator to index pages of pagination.
            $item->number = $j++;

            // Push pagination pages to items collection.
            $this->items[] = $item;
        }
    }
1312709
function Navbar(_ref) {
  var className = _ref.className,
      children = _ref.children,
      style = _ref.style,
      navColor = _ref.navColor;


  var mergedStyle = Object.assign({}, _navbar2.default.nav, style);
  window.navColor = navColor;

  return _react2.default.createElement(
    'div',
    { className: className, style: mergedStyle, id: 'navbarFadeIn' },
    children
  );
}
1136376
protected function cacheLinkTypeItems()
    {
        $links = [];
        foreach ($this->items as $item) {
            if ($item->getFormat() == LinkType::FORMAT) {
                $links[] = $item;
            }
        }
        $this->links = new ItemList($links);
    }
783972
public function All() {
      // Setup head.
      $this->Menu->HighlightRoute('/discussions');
      if (!$this->Title()) {
         $Title = C('Garden.HomepageTitle');
         if ($Title)
            $this->Title($Title, '');
         else
            $this->Title(T('All Categories'));
      }
      Gdn_Theme::Section('CategoryList');
            
      $this->Description(C('Garden.Description', NULL));
      
      $this->SetData('Breadcrumbs', CategoryModel::GetAncestors(GetValue('CategoryID', $this->Data('Category'))));
     
      // Set the category follow toggle before we load category data so that it affects the category query appropriately.
      $CategoryFollowToggleModule = new CategoryFollowToggleModule($this);
      $CategoryFollowToggleModule->SetToggle();
      
      // Get category data
      $this->CategoryModel->Watching = !Gdn::Session()->GetPreference('ShowAllCategories');
      
      $Categories = $this->CategoryModel->GetFull()->ResultArray();
      $this->SetData('Categories', $Categories);
      
      // Add modules
      $this->AddModule('NewDiscussionModule');
      $this->AddModule('DiscussionFilterModule');
      $this->AddModule('BookmarkedModule');
      $this->AddModule($CategoryFollowToggleModule);

      $this->CanonicalUrl(Url('/categories', TRUE));
      
      $Location = $this->FetchViewLocation('helper_functions', 'categories', FALSE, FALSE);
      if ($Location)
         include_once $Location;
      $this->Render();
   }
148835
function (commonModulesToLoad) {
            this._rootModule.loadModules(null, {
                page : [],
                common : commonModulesToLoad
            }, {
                fn : this._onSiteReady,
                scope : this
            });
        }
1051133
function () {
        var self = this;

        self.items().each(function (ctrl) {
          ctrl.classes.add('toolbar-item');
        });

        return self._super();
      }
1145424
def create_route(self, item, routes):
        """"""
        for route in routes:
            self._routes.setdefault(route, set()).add(item)
        return item