當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Toolbar::add方法代碼示例

本文整理匯總了PHP中Toolbar::add方法的典型用法代碼示例。如果您正苦於以下問題:PHP Toolbar::add方法的具體用法?PHP Toolbar::add怎麽用?PHP Toolbar::add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Toolbar的用法示例。


在下文中一共展示了Toolbar::add方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setupImportExportOperations

 private function setupImportExportOperations()
 {
     if (User::getPermission($this->permissionPrefix . "_can_export")) {
         $exportButton = new MenuButton("Export");
         $exportButton->addMenuItem("PDF", "#", "wyf.openWindow('" . $this->urlPath . "/export/pdf')");
         $exportButton->addMenuItem("CSV Data", "#", "wyf.openWindow('" . $this->urlPath . "/export/csv')");
         $exportButton->addMenuItem("HTML", "#", "wyf.openWindow('" . $this->urlPath . "/export/html')");
         $exportButton->addMenuItem("Excel", "#", "wyf.openWindow('" . $this->urlPath . "/export/xls')");
         $this->toolbar->add($exportButton);
     }
     if ($this->hasAddOperation && User::getPermission($this->permissionPrefix . "_can_import")) {
         $this->toolbar->addLinkButton("Import", $this->urlPath . "/import");
     }
 }
開發者ID:ekowabaka,項目名稱:cfx,代碼行數:14,代碼來源:MCListView.php

示例2: setupList

 /**
  * Sets up the list that is shown by default when the Model controller is
  * used. This list normall has the toolbar on top and the table below.
  * This method performs checks to ensure that the user has permissions
  * to access a particular operation before it renders the operation.
  */
 protected function setupList()
 {
     if ($this->hasAddOperation) {
         if (User::getPermission($this->permissionPrefix . "_can_add") || $this->forceAddOperation) {
             $this->toolbar->addLinkButton("New", $this->name . "/add");
         }
     }
     if (User::getPermission($this->permissionPrefix . "_can_export")) {
         $exportButton = new MenuButton("Export");
         $exportButton->addMenuItem("PDF", "#", "wyf.openWindow('" . $this->urlPath . "/export/pdf')");
         $exportButton->addMenuItem("Data", "#", "wyf.openWindow('" . $this->urlPath . "/export/csv')");
         $exportButton->addMenuItem("Template", "#", "wyf.openWindow('" . $this->urlPath . "/export/csv/template')");
         $exportButton->addMenuItem("HTML", "#", "wyf.openWindow('" . $this->urlPath . "/export/html')");
         $exportButton->addMenuItem("Excel", "#", "wyf.openWindow('" . $this->urlPath . "/export/xls')");
         $this->toolbar->add($exportButton);
         //addLinkButton("Export",$this->urlPath."/export");
     }
     if (User::getPermission($this->permissionPrefix . "_can_import")) {
         $this->toolbar->addLinkButton("Import", $this->urlPath . "/import");
     }
     $this->toolbar->addLinkButton("Search", "#")->linkAttributes = "onclick=\"ntentan.tapi.showSearchArea('{$this->table->name}')\"";
     if ($this->hasEditOperation) {
         if (User::getPermission($this->permissionPrefix . "_can_edit") || $this->forceEditOperation) {
             $this->table->addOperation("edit", "Edit");
         }
     }
     if ($this->hasDeleteOperation) {
         if (User::getPermission($this->permissionPrefix . "_can_delete") || $this->forceDeleteOperation) {
             $this->table->addOperation("delete", "Delete", "javascript:ntentan.confirmRedirect('Are you sure you want to delete','{$this->urlPath}/%path%/%key%')");
         }
     }
     if (User::getPermission($this->permissionPrefix . "_can_view")) {
         $this->table->addOperation("view", "View");
     }
     if (User::getPermission($this->permissionPrefix . "_can_audit")) {
         $this->table->addOperation("audit", "History");
     }
 }
開發者ID:rocksyne,項目名稱:wyf,代碼行數:44,代碼來源:ModelController.php


注:本文中的Toolbar::add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。