public function menu() { require_once "view/view.php"; $vetor = array("cadastro", "login", "listar"); $view = new View(); $view->menu($vetor); }
/** * Initialization hook * * @return true on success */ function init($cfg) { //! if user is not logged in or does not have the necessary //! priviledge then do not register this service if (!Core::$user->has("siteadm|webadm")) { return false; } //! load configuration into properties if (!empty($cfg['expert'])) { $this->expert = true; } if (!empty($cfg['pagehistory'])) { $this->revert = true; } if (isset($cfg['purge'])) { $this->purge = intval($cfg['purge']); } if ($this->purge < 3) { $this->purge = 8; } if ($this->purge > 999) { $this->purge = 999; } if (!empty($cfg['metas'])) { $this->metas = str_getcsv($cfg['metas'], ','); } else { $this->metas = ["description", "keywords"]; } //! add menu if (Core::$user->has("siteadm")) { //! two level menu for site adminsitrators View::menu(L("Contents") . "@siteadm|webadm", [L("Pages") . "@siteadm|webadm" => "cms/pages", L("Layouts") . "@siteadm" => "cms/layouts"]); } else { //! simple link for web administrators View::menu(L("Contents") . "@webadm", "cms/pages"); } //! disable caching for all cms related applications //! also load the stylesheet for them if (Core::$core->app == "cms") { Core::$core->nocache = true; View::css("cms.css"); } }
* This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * <http://www.gnu.org/licenses/> * * @file vendor/phppe/Developer/init.php * @author bzt * @date 1 Jan 2016 * @brief Initialize Developer extension */ /*!SKIPAUTOLOAD!*/ namespace PHPPE; //! register menu View::menu(L("Developer"), [L("Tests") => "tests", L("Benchmarks") => "benchmark"]); //! this is needed for test cases Http::route("tests/httptest", "Developer", "action_httpget", "get"); Http::route("tests/httptest", "Developer", "action_httppost", "post"); //! register url routes. Http::route("tests", "Developer"); Http::route("benchmark", "BenchmarkController"); //! these are CLI only Http::route("mkrepo", "MkRepoController"); Http::route("minify", "MinifyController"); Http::route("create", "CreateController"); Http::route("lang", "LangController"); Http::route("pretty", "PrettyController"); //for event testing return new Testing();
/** * PHP Portal Engine v3.0.0 * https://github.com/bztsrc/phppe3/ * * Copyright LGPL 2016 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * <http://www.gnu.org/licenses/> * * @file vendor/phppe/DBA/init.php * @author bzt * @date 29 Sep 2016 * @brief */ namespace PHPPE; //! add your routes here //Http::route("dba", "\\PHPPE\\Ctrl\\DBA", "action"); View::menu(L("Database") . "@siteadm", "dba"); //! return your service class here return new DBA();
public function view($filename = null) { $view = new View($filename); $view->query =& $this->query; $view->lifetime =& $this->session->lifetime; $view->controller = ROUTE_CONTROLLER; if (empty($filename)) { return $view; } if (isset($this->add_menu)) { foreach ($this->add_menu as $name => $menus) { $view->menu($name)->add($menus); } } if (isset($this->add_json)) { $this->val['add_json'] = json_encode($this->add_json); } else { $this->val['add_json'] = json_encode(array()); } return $view; }
/** * PHP Portal Engine v3.0.0 * https://github.com/bztsrc/phppe3/ * * Copyright LGPL 2016 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * <http://www.gnu.org/licenses/> * * @file vendor/phppe/Extensions/init.php * @author bzt * @date 23 May 2016 * @brief */ namespace PHPPE; View::menu(L("Extensions") . "@install", "extensions"); return new Extensions(); /* make lang utility happy L("Also installs") L("Failed dependency") L("Proprietary") L("Framework") L("Connections") L("Themes") L("Content") L("Security") L("Business") L("Sales") L("Office") L("Games") L("Banners") L("Hardware") L("User Input") */