function SetupBreadcrumb()
 {
     global $ReportBreadcrumb;
     $ReportBreadcrumb = new crBreadcrumb();
     $url = substr(ewr_CurrentUrl(), strrpos(ewr_CurrentUrl(), "/") + 1);
     $url = preg_replace('/\\?cmd=reset(all){0,1}$/i', '', $url);
     // Remove cmd=reset / cmd=resetall
     $ReportBreadcrumb->Add("crosstab", $this->TableVar, $url, "", $this->TableVar, TRUE);
 }
Exemple #2
0
 function Render($ret = FALSE)
 {
     if (function_exists("Menu_Rendering") && $this->IsRoot) {
         Menu_Rendering($this);
     }
     if (!$this->RenderMenu()) {
         return;
     }
     if (!$this->IsMobile) {
         if ($this->IsRoot) {
             $str = "<ul";
             if ($this->Id != "") {
                 if (is_numeric($this->Id)) {
                     $str .= " id=\"menu_" . $this->Id . "\"";
                 } else {
                     $str .= " id=\"" . $this->Id . "\"";
                 }
             }
             $str .= " class=\"" . $this->MenuClassName . "\">\n";
         } else {
             $str = "<ul class=\"" . $this->SubMenuClassName . "\" role=\"menu\">\n";
         }
     } else {
         $str = "";
     }
     $gcnt = 0;
     // Group count
     $gtitle = FALSE;
     // Last item is group title
     $i = 0;
     // Menu item count
     $cururl = substr(ewr_CurrentUrl(), strrpos(ewr_CurrentUrl(), "/") + 1);
     foreach ($this->ItemData as $item) {
         if ($this->RenderItem($item)) {
             $i++;
             if (!$this->IsMobile && $gtitle && ($gcnt >= 1 || $this->IsRoot)) {
                 // Add divider for previous group
                 $str .= "<li class=\"" . $this->MenuDividerClassName . "\"></li>\n";
             }
             if ($item->GroupTitle && (!$this->IsRoot || !$this->MenuRootGroupTitleAsSubMenu)) {
                 // Group title
                 $gtitle = TRUE;
                 $gcnt += 1;
                 if (strval($item->Text) != "") {
                     if ($this->IsMobile) {
                         $str .= "<li data-role=\"list-divider\">" . $item->Text . "</li>\n";
                     } else {
                         $str .= "<li class=\"dropdown-header\">" . $item->Text . "</li>\n";
                     }
                 }
                 if (!is_null($item->SubMenu)) {
                     foreach ($item->SubMenu->ItemData as $subitem) {
                         $liclass = !is_null($subitem->SubMenu) && $this->RenderSubMenu($subitem) ? $this->SubMenuItemClassName : "";
                         $aclass = "";
                         if (!$subitem->IsCustomUrl && ewr_CurrentPage() == ewr_GetPageName($subitem->Url) || $subitem->IsCustomUrl && $cururl == $subitem->Url) {
                             ewr_AppendClass($liclass, $this->MenuActiveItemClassName);
                             $subitem->Url = "javascript:void(0);";
                         }
                         if ($this->RenderItem($subitem)) {
                             if ($this->IsMobile && $item->GroupTitle) {
                                 ewr_AppendClass($aclass, "ewIndent");
                             }
                             $str .= $subitem->Render($aclass, $liclass, $this->IsMobile) . "\n";
                             // Create <LI>
                         }
                     }
                 }
             } else {
                 $gtitle = FALSE;
                 $liclass = !is_null($item->SubMenu) && $this->RenderSubMenu($item) ? $this->IsRoot ? $this->MenuItemClassName : $this->SubMenuItemClassName : "";
                 $aclass = "";
                 if (!$item->IsCustomUrl && ewr_CurrentPage() == ewr_GetPageName($item->Url) || $item->IsCustomUrl && $cururl == $item->Url) {
                     if ($this->IsRoot) {
                         ewr_AppendClass($liclass, $this->MenuActiveItemClassName);
                     } else {
                         ewr_AppendClass($liclass, $this->SubMenuActiveItemClassName);
                     }
                     $item->Url = "javascript:void(0);";
                 }
                 $str .= $item->Render($aclass, $liclass, $this->IsMobile) . "\n";
                 // Create <LI>
             }
         }
     }
     if ($this->IsMobile) {
         $str = "<ul data-role=\"listview\" data-filter=\"true\">" . $str . "</ul>\n";
     } elseif ($this->IsRoot) {
         $str .= "</ul>\n";
         if (EWR_MENUBAR_BRAND != "") {
             $brandhref = EWR_MENUBAR_BRAND_HYPERLINK == "" ? "#" : EWR_MENUBAR_BRAND_HYPERLINK;
             $str = "<a class=\"navbar-brand hidden-xs\" href=\"" . ewr_HtmlEncode($brandhref) . "\">" . EWR_MENUBAR_BRAND . "</a>" . $str;
         }
         // Add right menu
         if ($this->ShowRightMenu) {
             $str .= "<ul class=\"nav navbar-nav navbar-right\"></ul>";
         }
         if ($this->MenuBarClassName != "") {
             $str = "<div class=\"" . $this->MenuBarClassName . "\">" . $str . "</div>";
         }
     } else {
         $str .= "</ul>\n";
     }
     if ($ret) {
         // Return as string
         return $str;
     }
     echo $str;
     // Output
 }