当前位置: 首页>>代码示例>>PHP>>正文


PHP Application::setTitle方法代码示例

本文整理汇总了PHP中Application::setTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::setTitle方法的具体用法?PHP Application::setTitle怎么用?PHP Application::setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Application的用法示例。


在下文中一共展示了Application::setTitle方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: newApplication

 /**
  * Helper function to create a new application with a new keypair.
  * @param type $title
  * @return \IdnoPlugins\OAuth2\Application
  */
 public static function newApplication($title)
 {
     $app = new Application();
     $app->setTitle($title);
     $app->generateKeypair();
     return $app;
 }
开发者ID:kylewm,项目名称:KnownOAuth2,代码行数:12,代码来源:Application.php

示例2: permissions

 /**
  * The method which displays the permissions so they could be setup. This 
  * method is called by the application and it performs recursive calls to 
  * the drawPermissions() method.
  * 
  * @param $params array Passes the role_id through an array.
  * @return String
  */
 public function permissions($params)
 {
     if ($_POST["is_sent"] == "yes") {
         //Save the permission values
         $this->permissions = Model::load(".permissions");
         $permissions = $_POST;
         array_pop($permissions);
         foreach ($permissions as $permission => $value) {
             $this->permissions->delete("role_id = '{$params[0]}' AND permission = '{$permission}'");
             $this->permissions->setData(array("role_id" => $params[0], "permission" => $permission, "value" => $value[0], "module" => $value[1]));
             $this->permissions->save();
         }
         //Generate a new side menu for this role
         $menu = $this->generateMenus($params[0]);
         $flatened = $this->flatenMenu($menu);
         $sideMenu = Controller::load(array("system", "side_menu", "generate", serialize($menu)));
         file_put_contents("app/cache/menus/side_menu_{$params[0]}.html", $sideMenu->content);
         file_put_contents("app/cache/menus/menu_{$params[0]}.object", serialize($flatened));
         User::log("Set permissions");
         //, $permissions);
     }
     $path = $params;
     array_shift($path);
     $accum = Application::$prefix . "/system/roles/permissions/{$params[0]}";
     $menu = "<a href='{$accum}'>Permissions</a>";
     foreach ($path as $section) {
         $accum .= "/{$section}";
         $menu .= " > <a href='{$accum}'>" . ucfirst($section) . "</a>";
     }
     $path = implode("/", $path);
     $ret .= "<form class='fapi-form' method='post'>" . $menu . "<br/><hr/>" . $this->drawPermissions($this->getPermissionList("app/modules/{$path}", "app/modules"), $params[0]) . "<input type='hidden' name='is_sent' value='yes'/>" . $this->save . "</div></form>";
     Application::setTitle("Role Permissions");
     return $ret;
 }
开发者ID:9naQuame,项目名称:wyf,代码行数:42,代码来源:SystemRolesController.php

示例3: permissions

 /**
  * The method which displays the permissions so they could be setup. This 
  * method is called by the application and it performs recursive calls to 
  * the drawPermissions() method.
  * 
  * @param $params Passes the role_id through an array.
  * @return String
  */
 public function permissions($params)
 {
     if ($_POST["is_sent"] == "yes") {
         self::insertIntoRoleValidity($params);
         //Save the permission values
         $this->permissions = Model::load("system.permissions");
         $permissions = $_POST;
         array_pop($permissions);
         foreach ($permissions as $permission => $value) {
             $this->permissions->delete(array("filter" => "role_id = ? AND permission = ?", "bind" => array($params[0], $permission)));
             $this->permissions->setData(array("role_id" => $params[0], "permission" => $permission, "value" => $value[0], "module" => $value[1]));
             $this->permissions->save();
         }
     }
     $path = $params;
     array_shift($path);
     $accum = "/auth/roles/permissions/{$params[0]}";
     $menu = "<a href='{$accum}'>Permissions</a>";
     foreach ($path as $section) {
         $accum .= "/{$section}";
         $menu .= " > <a href='{$accum}'>" . ucfirst($section) . "</a>";
     }
     $path = implode("/", $path);
     $ret .= "<form class='fapi-form' method='post'>" . $menu . "<br/><hr/>" . $this->drawPermissions($this->getPermissionList("app/modules/{$path}", "app/modules"), $params[0]) . "<input type='hidden' name='is_sent' value='yes'/>" . $this->save . "</div></form>";
     Application::setTitle("Role Permissions");
     return $ret;
 }
开发者ID:ekowabaka,项目名称:cfx,代码行数:35,代码来源:CfxAuthRolesController.php

示例4: getContents

 /**
  * The default page which shows the login form.
  * @see lib/controllers/Controller#getContents()
  */
 public function getContents()
 {
     Application::addStylesheet("css/login.css");
     Application::$template = "login.tpl";
     Application::setTitle("Login");
     if ($_SESSION["logged_in"]) {
         Application::redirect(Application::getLink("/"));
     }
     $form = new Form();
     $form->setRenderer("default");
     $username = new TextField("Username", "username");
     $form->add($username);
     $password = new PasswordField("Password", "password");
     $form->add($password);
     $form->setSubmitValue("Login");
     $form->setCallback("{$this->getClassName()}::callback", $this);
     return $form->render();
 }
开发者ID:ekowabaka,项目名称:wyf,代码行数:22,代码来源:SystemLoginController.php

示例5: __construct

 /**
  * Loads an XML file and set's up the class to generate reports based on
  * the description of the class.
  * @param string $report A path to the xml file which contains the
  *                       description of this report
  */
 public function __construct($report, $redirected = false)
 {
     parent::__construct();
     $this->xml = simplexml_load_file(($redirected ? "" : "app/modules") . $report);
     $path = $this->xml["name"] . "/generate/pdf";
     $this->name = (string) $this->xml["name"];
     $this->label = $this->xml["label"];
     Application::setTitle($this->label);
     $baseModel = $this->xml["baseModel"];
     $this->basePackage = isset($this->xml["basePackage"]) ? (string) $this->xml["basePackage"] : reset(explode(".", (string) $this->xml["baseModel"]));
     try {
         $baseModel = Model::load((string) $baseModel);
     } catch (Exception $e) {
         throw new Exception("Base model (" . (string) $baseModel . ") could not be loaded ({$e->getMessage()})");
     }
     $this->referencedFields = array();
     foreach ($baseModel->referencedFields as $field) {
         $this->referencedFields[] = $field["referencing_field"];
     }
 }
开发者ID:ekowabaka,项目名称:cfx,代码行数:26,代码来源:XmlDefinedReportController.php

示例6: getContents

 public function getContents()
 {
     //          if(Configuration::get('attempt_counter') == null || Configuration::get('attempt_counter') === '0')
     //        {
     //            Configuration::set('attempt_counter',0);
     //        }
     Application::addStylesheet("css/login.css");
     Application::$template = "login.tpl";
     Application::setTitle("Login");
     if ($_SESSION["logged_in"]) {
         Application::redirect("/");
     }
     $form = new Form();
     $form->setRenderer("default");
     $username = new TextField("Username", "username");
     $form->add($username);
     $password = new PasswordField("Password", "password");
     $password->setEncrypted(false);
     $form->add($password);
     $form->setSubmitValue("Login");
     $form->setValidatorCallback("{$this->getClassName()}::callback");
     $form->setShowClear(false);
     return $form->render();
 }
开发者ID:ekowabaka,项目名称:cfx,代码行数:24,代码来源:CfxAuthLoginController.php

示例7: render

 /**
  * Outputs the application. This calls all the template files and outputs the
  * final application in HTML.
  */
 public static function render()
 {
     $t = Application::$templateEngine;
     if ($_GET["q"] == "") {
         $_GET["q"] = "dashboard";
     }
     $path = explode("/", $_GET["q"]);
     Application::$template = "main.tpl";
     require SOFTWARE_HOME . "app/bootstrap.php";
     $t->assign('prefix', Application::$prefix);
     Application::setTitle();
     $module = Controller::load($path);
     if (Application::$cli) {
         ob_start();
     }
     if (Application::$template == "") {
         print $module->content;
     } else {
         $t->assign('content', $module->content);
         $t->assign('module_name', $module->label);
         $t->assign('module_description', $module->description);
         foreach (array_keys(Application::$menus) as $key) {
             $t->assign($key, Menu::getContents($key));
         }
         $t->assign('stylesheets', Application::$stylesheets);
         $t->assign('styles', $t->fetch('stylesheets.tpl'));
         $t->assign('javascripts', Application::$javascripts);
         $t->assign('scripts', $t->fetch('javascripts.tpl'));
         $t->assign('title', Application::$title);
         $t->display(Application::$template);
     }
     if (Application::$cli) {
         if (Application::$cliOutput == "") {
             print ob_get_clean();
         } else {
             file_put_contents(Application::$cliOutput, ob_get_clean());
         }
     }
 }
开发者ID:rocksyne,项目名称:wyf,代码行数:43,代码来源:Application.php

示例8: render

 /**
  * Outputs the application. This method is the final stage in the application
  * lifecyle which calls all the template files and outputs the
  * final application in HTML. 
  */
 public static function render()
 {
     $t = Application::$templateEngine;
     if ($_GET["q"] == "") {
         $_GET["q"] = Application::$defaultRoute;
     }
     $path = explode("/", $_GET["q"]);
     Application::$template = "main.tpl";
     $t->assign('prefix', Application::$prefix);
     Application::setTitle();
     $module = Controller::load($path);
     if (Application::$cli) {
         ob_start();
     }
     if (Application::$template == "") {
         print $module->content;
     } else {
         $t->assign('content', $module->content);
         $t->assign('module_name', $module->label);
         $t->assign('module_description', $module->description);
         $t->assign('side_menu_hidden', self::$sideMenuHidden);
         foreach (array_keys(Application::$menus) as $key) {
             $t->assign($key, Menu::getContents($key));
         }
         $t->assign('stylesheets', Application::$stylesheets);
         $t->assign('styles', $t->fetch('stylesheets.tpl'));
         $t->assign('javascripts', Application::$javascripts);
         $t->assign('scripts', $t->fetch('javascripts.tpl'));
         $t->assign('title', Application::$title);
         $t->assign('session', $_SESSION);
         $t->assign('info', array_merge(is_array($_SESSION['notes']) ? $_SESSION['notes'] : array(), self::$notes));
         $t->display(Application::$template);
     }
     if (Application::$cli) {
         if (Application::$cliOutput == "") {
             print ob_get_clean();
         } else {
             file_put_contents(Application::$cliOutput, ob_get_clean());
         }
     }
 }
开发者ID:9naQuame,项目名称:wyf,代码行数:46,代码来源:Application.php

示例9: __construct

 /**
  * Constructor for the ModelController.
  * @param $model An instance of the Model class which represents the model
  *               to be used.
  */
 public function __construct($model = "")
 {
     $this->modelName = $this->modelName == "" ? $model : $this->modelName;
     $this->model = Model::load($this->modelName);
     $this->name = $this->model->name;
     $this->urlPath = Application::$prefix . "/" . str_replace(".", "/", $this->modelName);
     $this->permissionPrefix = $this->permissionPrefix == '' ? str_replace(".", "_", $this->modelName) : $this->permissionPrefix;
     $this->label = $this->model->label;
     $this->description = $this->model->description;
     Application::setTitle($this->label);
     $this->_showInMenu = $this->model->showInMenu === "false" ? false : true;
     $this->wyfWrapper = new WyfWrapper();
 }
开发者ID:ekowabaka,项目名称:cfx,代码行数:18,代码来源:ModelController.php

示例10: __construct

 /**
  * Constructor for the ModelController.
  * @param $model An instance of the Model class which represents the model
  *               to be used.
  */
 public function __construct($model = "")
 {
     global $redirectedPackage;
     $this->modelName = $this->modelName == "" ? $model : $this->modelName;
     $this->model = Model::load($this->modelName);
     $this->name = $this->model->name;
     $this->t = $t;
     $this->path = $path;
     $this->urlBase = $this->urlBase == '' ? ($redirectedPackage != '' ? "{$redirectedPackage}" : '') . $this->modelName : $this->urlBase;
     $this->urlPath = Application::$prefix . "/" . str_replace(".", "/", $this->urlBase);
     $this->permissionPrefix = $redirectedPackage . str_replace(".", "_", $this->modelName);
     $this->localPath = "app/modules/" . str_replace(".", "/", $this->urlBase);
     if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || $_REQUEST["__api_mode"] == "yes") {
         Application::$template = "";
         $this->apiMode = true;
         unset($_REQUEST["__api_mode"]);
         unset($_REQUEST["q"]);
     } else {
         $this->label = $this->model->label;
         $this->description = $this->model->description;
         Application::setTitle($this->label);
         $this->toolbar = new Toolbar();
         $this->table = new MultiModelTable(Application::$prefix . "/" . str_replace(".", "/", $this->urlBase) . "/");
         $this->table->useAjax = true;
     }
     $this->_showInMenu = $this->model->showInMenu == "false" ? false : true;
     if (file_exists($this->localPath . "/app.xml")) {
         $this->app = simplexml_load_file($this->localPath . "/app.xml");
     }
 }
开发者ID:rocksyne,项目名称:wyf,代码行数:35,代码来源:ModelController.php

示例11: render

 /**
  * Outputs the application. This method is the final stage in the application
  * lifecyle which calls all the template files and outputs the
  * final application in HTML. 
  */
 public static function render()
 {
     $t = Application::$templateEngine;
     if ($_GET["q"] == "") {
         $_GET["q"] = Application::$defaultRoute;
     }
     $path = explode("/", $_GET["q"]);
     Application::$template = "main.tpl";
     $t->assign('prefix', Application::$prefix);
     Application::setTitle();
     $module = Controller::load($path);
     if (Application::$cli) {
         ob_start();
     }
     if (Application::$template == "" || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
         header("x-controller-label: {$module->label}");
         header("x-controller-description: {$module->description}");
         echo $module->content;
     } else {
         $t->assign('content', $module->content);
         $t->assign('module_name', $module->label);
         $t->assign('module_description', $module->description);
         $t->assign('side_menu_hidden', self::$sideMenuHidden);
         foreach (array_keys(Application::$menus) as $key) {
             $t->assign($key, Menu::getContents($key));
         }
         $t->assign('stylesheets', Application::$stylesheets);
         $t->assign('styles', $t->fetch('stylesheets.tpl'));
         $t->assign('javascripts', Application::$javascripts);
         $t->assign('scripts', $t->fetch('javascripts.tpl'));
         $t->assign('title', Application::$title);
         $t->assign('session', $_SESSION);
         $t->assign('info', array_merge(is_array($_SESSION['notes']) ? $_SESSION['notes'] : array(), self::$notes));
         $t->display(Application::$template);
     }
 }
开发者ID:ekowabaka,项目名称:wyf,代码行数:41,代码来源:Application.php

示例12: setLabel

 public function setLabel($label)
 {
     Application::setTitle($label);
     $this->label = $label;
 }
开发者ID:ekowabaka,项目名称:wyf,代码行数:5,代码来源:Controller.php

示例13: __construct

 public function __construct()
 {
     Application::setTitle("Access Restricted");
     $this->label = "Error";
     $this->description = "There was an error loading the content that you requested.";
 }
开发者ID:rocksyne,项目名称:wyf,代码行数:6,代码来源:ErrorController.php


注:本文中的Application::setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。