Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }
 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;
 }
 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);
     }
 }
 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();
 }
Exemplo n.º 6
0
 /**
  * @desc Builds a Contribution object.
  */
 public function __construct()
 {
     parent::__construct();
     $this->module_id = Environment::get_running_module_name();
 }
Exemplo n.º 7
0
 *
 * 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();
Exemplo n.º 8
0
 /**
  * @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();
 }