private function setupImportExportOperations() { if (User::getPermission($this->permissionPrefix . "_can_export")) { $exportButton = new MenuButton("Export"); $exportButton->addMenuItem("Portable Document Format (PDF)", "#", "wyf.openWindow('" . $this->urlPath . "/export/pdf')"); $exportButton->addMenuItem("Raw Data (CSV)", "#", "wyf.openWindow('" . $this->urlPath . "/export/csv')"); $exportButton->addMenuItem("Hyper Text Markup Language (HTML)", "#", "wyf.openWindow('" . $this->urlPath . "/export/html')"); $exportButton->addMenuItem("Microsoft Excel (XLS)", "#", "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"); } }
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"); } }
/** * 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"); } }
/** * show-Methode fÃÂÃÂÃÂür TYPE = button * * @param $PIC gibt die Hintergrundgrafik der Buttons an */ function showWithButtons($PIC, $HOVER = "") { $tbl = new Table(array("")); $tbl->setWidth($this->getWidth() + 5); $tbl->setXPos($this->getXPos()); $tbl->setYPos($this->getYPos()); $tbl->setBorder($this->getBorder()); $tbl->setFonttypes(array($this->getFonttype())); $userStatus = $this->CONFIG->CURRENTUSER->STATUS; $menuresult = $this->MENUTABLE->getMenuByStatus($userStatus); $txt = array(); $r = array(); while ($row = mysql_fetch_array($menuresult)) { if ($row['id'] > 0) { $rcnt = count($txt); $txt[$rcnt] = new Text($row['text']); $txt[$rcnt]->setFonttype($this->getFonttype()); $ftx = $txt[$rcnt]->getFonttype(); if ($row['text'] == $_SESSION['MENU_PARENT'] || $row['text'] == $this->getLabelByRunlink($_SESSION['runLink'], $_SESSION['MENU_PARENT'])) { $ftx->setColor($_SESSION['config']->COLORS['hover']); $ftx->setBold(true); } else { $ftx->setBold(false); } $txt[$rcnt]->setFonttype($ftx); $btn = new MenuButton($row['link'], $txt[$rcnt], $PIC, $row['target'], $this->COLOR); $btn->setHoverPic($HOVER); $btn->setToolTip($row['tooltip']); $r[$rcnt] = $tbl->createRow(); $r[$rcnt]->setAttribute(0, $btn); $tbl->addRow($r[$rcnt]); } } $tbl->show(); }