本文整理汇总了PHP中Environment::get_running_module_name方法的典型用法代码示例。如果您正苦于以下问题:PHP Environment::get_running_module_name方法的具体用法?PHP Environment::get_running_module_name怎么用?PHP Environment::get_running_module_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Environment
的用法示例。
在下文中一共展示了Environment::get_running_module_name方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_image
public function get_image()
{
if (!$this->image instanceof Url) {
return new Url('/' . Environment::get_running_module_name() . '/' . Environment::get_running_module_name() . '.png');
}
return $this->image;
}
示例2: get_right_controller_regarding_authorizations
public final function get_right_controller_regarding_authorizations()
{
if (ModulesManager::is_module_installed(Environment::get_running_module_name())) {
$module = ModulesManager::get_module(Environment::get_running_module_name());
if (!$module->is_activated()) {
return PHPBoostErrors::module_not_activated();
}
} else {
return PHPBoostErrors::module_not_installed();
}
return $this;
}
示例3: get_right_controller_regarding_authorizations
public final function get_right_controller_regarding_authorizations()
{
if (!AppContext::get_current_user()->is_admin()) {
return new UserLoginController(UserLoginController::ADMIN_LOGIN, substr(REWRITED_SCRIPT, strlen(GeneralConfig::load()->get_site_path())));
} else {
if (ModulesManager::is_module_installed(Environment::get_running_module_name())) {
$module = ModulesManager::get_module(Environment::get_running_module_name());
if (!$module->is_activated()) {
return PHPBoostErrors::module_not_activated();
}
} else {
return PHPBoostErrors::module_not_installed();
}
}
return $this;
}
示例4: display_actions_menu
public static function display_actions_menu()
{
$module_name = Environment::get_running_module_name();
$tree_links = self::get_tree_links($module_name);
if ($tree_links !== null) {
$actions_tree_links = $tree_links->get_actions_tree_links();
$module = ModulesManager::get_module($module_name);
$tpl = new FileTemplate('framework/module/module_actions_links_menu.tpl');
$tpl->put_all(array('C_DISPLAY' => $actions_tree_links->has_visible_links(), 'ID' => $module_name, 'MODULE_NAME' => $module->get_configuration()->get_name()));
$home_page = $module->get_configuration()->get_home_page();
if (!empty($home_page)) {
$module_home = new ModuleLink(LangLoader::get_message('home', 'main'), new Url('/' . $module->get_id() . '/' . $home_page));
$tpl->assign_block_vars('element', array(), array('ELEMENT' => $module_home->export()));
}
return self::display($actions_tree_links, $tpl);
}
}
示例5: get_css_files_running_module_displayed
public static function get_css_files_running_module_displayed()
{
$module_id = Environment::get_running_module_name();
if (array_key_exists($module_id, self::$modules_css_files)) {
$module_css_files = self::$modules_css_files[$module_id];
$module_css_files_running_module_displayed = $module_css_files->get_css_files_running_module_displayed();
if (!empty($module_css_files_running_module_displayed)) {
$theme_id = AppContext::get_current_user()->get_theme();
$css_files = array();
foreach ($module_css_files_running_module_displayed as $css_file) {
$css_files[] = self::get_real_path_css_file($theme_id, $module_id, $css_file);
}
return $css_files;
}
return array();
}
return array();
}
示例6: __construct
/**
* @desc Builds a Contribution object.
*/
public function __construct()
{
parent::__construct();
$this->module_id = Environment::get_running_module_name();
}
示例7: AdminDisplayGraphicalEnvironment
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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 General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
###################################################*/
if (defined('PHPBOOST') !== true) {
exit;
}
$env = new AdminDisplayGraphicalEnvironment();
Environment::set_graphical_environment($env);
if (!defined('TITLE')) {
define('TITLE', $LANG['unknown']);
}
$module_id = Environment::get_running_module_name();
$section = '';
if (!Environment::home_page_running() && ModulesManager::is_module_installed($module_id)) {
$section = ModulesManager::get_module($module_id)->get_configuration()->get_name();
}
$env->set_page_title(TITLE, $section);
ob_start();
示例8: __construct
/**
* @desc Builds a Contribution object.
*/
public function __construct()
{
parent::__construct();
$this->current_status = Event::EVENT_STATUS_UNREAD;
$this->creation_date = new Date();
$this->fixing_date = new Date();
$this->module = Environment::get_running_module_name();
}