/** * * @param string $category * @return ActionList */ public static function get($category) { $res = new ActionList(); $res->setCategory($category); $res->loadActions(); return $res; }
public function display() { $rolelist = new Template(); $rolelist->load("role_list"); $actions = ActionList::get("rolelist"); if (isset($_POST['insert'])) { $role = new Role(); $role->name = $_POST['insert']; $role->insert(); } if (isset($_GET['delete'])) { $role = new Role(); $role->ID = $_GET['delete']; $role->delete(); } $table = new Table(); $id = new TableColumn("id", Language::DirectTranslate("ID")); $id->autoWidth = true; $name = new TableColumn("name", Language::DirectTranslate("NAME")); $table->columns->add($id); $table->columns->add($name); $table->name = "{'dbprefix'}roles"; $table->actions = "rolelist"; $table->orderBy = "name"; $table->cacheName = "rolelist"; $rolelist->assign_var("TABLE", $table->getCode()); $rolelist->output(); }
public function load() { $this->headline = $GLOBALS['language']->getString("FILES"); if (!isset($_GET['dir']) || substr($_GET['dir'], 0, 1) == '.') { $_GET['dir'] = ""; } $uploadpath = Settings::getInstance()->get("root") . "content/uploads/"; $this->template = new Template(); $this->template->load("plugin_filelistwidget_filelist"); $this->template->show_if("FILES_EXIST", false); $this->template->show_if("NOFILES", false); $this->template->assign_var("DIR", htmlentities($_GET['dir'])); $actions = ActionList::get("plugin_filelistwidget"); $dir = $_GET['dir']; if (file_exists($uploadpath . $dir)) { $this->delete($uploadpath); $this->rename($dir, $uploadpath); $verzeichnis = openDir($uploadpath . $dir); $pre = ""; $path = ""; foreach (explode("/", $dir) as $cDir) { $index = $this->template->add_loop_item("PATH"); $path .= "/" . $cDir; if ($path == "/") { $this->template->assign_loop_var("PATH", $index, "URL", "/admin/index.php?page=files"); $this->template->assign_loop_var("PATH", $index, "LABEL", "/"); $path = ""; } else { $this->template->assign_loop_var("PATH", $index, "URL", "/admin/index.php?page=files&dir=" . $path); $this->template->assign_loop_var("PATH", $index, "LABEL", $cDir); } } if (trim($_GET['dir']) != "" & trim($_GET['dir']) != "/") { $this->template->assign_var("DELETEFOLDERLINK", "<a href=\"/admin/index.php?page=files&rmdir=" . $_GET['dir'] . "\">Ordner löschen</a>"); } else { $this->template->assign_var("DELETEFOLDERLINK", ""); } $files = FileServer::getFiles($uploadpath . $dir); } if (isset($files) && sizeOf($files) > 0) { $this->template->show_if("FILES_EXIST", true); $this->template->show_if("NOFILES", false); foreach ($files as $file) { $index = $this->template->add_loop_item("FILES"); $this->template->assign_loop_var("FILES", $index, "IMAGE", $this->getImageCode($uploadpath, $dir, $file)); $this->template->assign_loop_var("FILES", $index, "FILELINK", "<a href=\"../content/uploads" . $dir . "/" . $file . "\">" . $file . "</a>"); $params = array(); $params['dir'] = $_GET['dir']; $params['file'] = $file; $this->template->assign_loop_var("FILES", $index, "ACTIONS", $actions->getCode($params)); } } else { $this->template->show_if("FILES_EXIST", false); $this->template->show_if("NOFILES", true); } $this->template->assign_var("MESSAGE", ""); $this->content = $this->template->getCode(); }
/** * * @param int $id * @return string */ public static function getEditableCode($id) { $res = ""; $entries = self::getEntries($id); if ($entries) { $actions = ActionList::get("menuedit"); foreach ($entries as $entry) { $res .= $entry->getEditableCode($actions); } } return $res; }
/** * * @param array $row * @return string */ public function getBodyCode($row) { $res = "<tr>"; $vars = get_object_vars($row); foreach ($this->columns as $column) { $res .= $column->getBodyCode($vars); } if (strlen($this->actions) > 0) { $actions = ActionList::get($this->actions); $res .= "<td>" . $actions->getCode($vars) . "</td>"; } $res .= "</tr>"; return $res; }
/** * @return boolean */ private function allowDisplayEditButtonOnViewForm() { return $this->actions->hasEditOperation() && $this->hasEditColumns() && $this->hasEditPermission(); }