コード例 #1
0
ファイル: inv500ctb.php プロジェクト: nirantarnoy/st2
 function SetupExportOptions()
 {
     global $ReportLanguage;
     $exportid = session_id();
     // Printer friendly
     $item =& $this->ExportOptions->Add("print");
     $item->Body = "<a title=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("PrinterFriendly", TRUE)) . "\" data-caption=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("PrinterFriendly", TRUE)) . "\" href=\"" . $this->ExportPrintUrl . "\">" . $ReportLanguage->Phrase("PrinterFriendly") . "</a>";
     $item->Visible = FALSE;
     // Export to Excel
     $item =& $this->ExportOptions->Add("excel");
     $item->Body = "<a title=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("ExportToExcel", TRUE)) . "\" data-caption=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("ExportToExcel", TRUE)) . "\" href=\"" . $this->ExportExcelUrl . "\">" . $ReportLanguage->Phrase("ExportToExcel") . "</a>";
     $item->Visible = FALSE;
     // Export to Word
     $item =& $this->ExportOptions->Add("word");
     $item->Body = "<a title=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("ExportToWord", TRUE)) . "\" data-caption=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("ExportToWord", TRUE)) . "\" href=\"" . $this->ExportWordUrl . "\">" . $ReportLanguage->Phrase("ExportToWord") . "</a>";
     //$item->Visible = FALSE;
     $item->Visible = FALSE;
     // Export to Pdf
     $item =& $this->ExportOptions->Add("pdf");
     $item->Body = "<a title=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("ExportToPDF", TRUE)) . "\" data-caption=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("ExportToPDF", TRUE)) . "\" href=\"" . $this->ExportPdfUrl . "\">" . $ReportLanguage->Phrase("ExportToPDF") . "</a>";
     $item->Visible = FALSE;
     // Uncomment codes below to show export to Pdf link
     //		$item->Visible = FALSE;
     // Export to Email
     $item =& $this->ExportOptions->Add("email");
     $url = $this->PageUrl() . "export=email";
     $item->Body = "<a title=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("ExportToEmail", TRUE)) . "\" data-caption=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("ExportToEmail", TRUE)) . "\" id=\"emf_inv500\" href=\"javascript:void(0);\" onclick=\"ewr_EmailDialogShow({lnk:'emf_inv500',hdr:ewLanguage.Phrase('ExportToEmail'),url:'{$url}',exportid:'{$exportid}',el:this});\">" . $ReportLanguage->Phrase("ExportToEmail") . "</a>";
     $item->Visible = FALSE;
     // Drop down button for export
     $this->ExportOptions->UseDropDownButton = FALSE;
     $this->ExportOptions->UseButtonGroup = TRUE;
     $this->ExportOptions->UseImageAndText = $this->ExportOptions->UseDropDownButton;
     $this->ExportOptions->DropDownButtonPhrase = $ReportLanguage->Phrase("ButtonExport");
     // Add group option item
     $item =& $this->ExportOptions->Add($this->ExportOptions->GroupOptionName);
     $item->Body = "";
     $item->Visible = FALSE;
     // Filter panel button
     $item =& $this->SearchOptions->Add("searchtoggle");
     $SearchToggleClass = " active";
     $item->Body = "<button type=\"button\" class=\"btn btn-default ewSearchToggle" . $SearchToggleClass . "\" title=\"" . $ReportLanguage->Phrase("SearchBtn", TRUE) . "\" data-caption=\"" . $ReportLanguage->Phrase("SearchBtn", TRUE) . "\" data-toggle=\"button\" data-form=\"finv500crosstab\">" . $ReportLanguage->Phrase("SearchBtn") . "</button>";
     $item->Visible = FALSE;
     // Reset filter
     $item =& $this->SearchOptions->Add("resetfilter");
     $item->Body = "<button type=\"button\" class=\"btn btn-default\" title=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("ResetAllFilter", TRUE)) . "\" data-caption=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("ResetAllFilter", TRUE)) . "\" onclick=\"location='" . ewr_CurrentPage() . "?cmd=reset'\">" . $ReportLanguage->Phrase("ResetAllFilter") . "</button>";
     $item->Visible = TRUE;
     // Button group for reset filter
     $this->SearchOptions->UseButtonGroup = TRUE;
     // Add group option item
     $item =& $this->SearchOptions->Add($this->SearchOptions->GroupOptionName);
     $item->Body = "";
     $item->Visible = FALSE;
     // Filter button
     $item =& $this->FilterOptions->Add("savecurrentfilter");
     $item->Body = "<a class=\"ewSaveFilter\" data-form=\"finv500crosstab\" href=\"#\">" . $ReportLanguage->Phrase("SaveCurrentFilter") . "</a>";
     $item->Visible = TRUE;
     $item =& $this->FilterOptions->Add("deletefilter");
     $item->Body = "<a class=\"ewDeleteFilter\" data-form=\"finv500crosstab\" href=\"#\">" . $ReportLanguage->Phrase("DeleteFilter") . "</a>";
     $item->Visible = TRUE;
     $this->FilterOptions->UseDropDownButton = TRUE;
     $this->FilterOptions->UseButtonGroup = !$this->FilterOptions->UseDropDownButton;
     // v8
     $this->FilterOptions->DropDownButtonPhrase = $ReportLanguage->Phrase("Filters");
     // Add group option item
     $item =& $this->FilterOptions->Add($this->FilterOptions->GroupOptionName);
     $item->Body = "";
     $item->Visible = FALSE;
     // Set up options (extended)
     $this->SetupExportOptionsExt();
     // Hide options for export
     if ($this->Export != "") {
         $this->ExportOptions->HideAllOptions();
         $this->SearchOptions->HideAllOptions();
         $this->FilterOptions->HideAllOptions();
     }
     // Set up table class
     if ($this->Export == "word" || $this->Export == "excel" || $this->Export == "pdf") {
         $this->ReportTableClass = "ewTable";
     } else {
         $this->ReportTableClass = "table ewTable";
     }
 }
 function SetupExportOptionsExt()
 {
     global $ReportLanguage;
     $item =& $this->ExportOptions->GetItem("pdf");
     $item->Visible = TRUE;
     $exportid = session_id();
     $url = $this->ExportPdfUrl;
     $item->Body = "<a title=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("ExportToPDF", TRUE)) . "\" data-caption=\"" . ewr_HtmlEncode($ReportLanguage->Phrase("ExportToPDF", TRUE)) . "\" href=\"javascript:void(0);\" onclick=\"ewr_ExportCharts(this, '" . $url . "', '" . $exportid . "');\">" . $ReportLanguage->Phrase("ExportToPDF") . "</a>";
 }
コード例 #3
0
ファイル: ewrfn8.php プロジェクト: Ombogo/new_api_chat
 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
 }