コード例 #1
0
 /**
  * 取得实例
  * 
  * @access public
  * @return mixed
  */
 public static function getInstance()
 {
     if (!self::$obj instanceof self) {
         self::$obj = new self();
     }
     return self::$obj;
 }
コード例 #2
0
 public function __construct()
 {
     parent::__construct();
     $this->forgetBeforeFilter('maintenance');
     $this->theme = \Theme::type('admincp')->current(\ThemeManager::getActive('admincp'))->reBoot()->layout('layouts.default');
     $this->activePage('dashboard');
 }
コード例 #3
0
ファイル: helpers.php プロジェクト: monkblog/theme-manager
 /**
  * @param null    $basePath
  * @param array   $requiredFields
  * @param bool $exceptionOnInvalid
  *
  * @return \ThemeManager\ThemeManager
  */
 function theme_manager($basePath = null, array $requiredFields = [], $exceptionOnInvalid = false)
 {
     if (function_exists('app') && class_exists('Illuminate\\Container\\Container') && Config::get('app.aliases.ThemeManager') == 'ThemeManager\\Facade\\ThemeManager') {
         return \ThemeManager::returnThis();
     }
     return new ThemeManager(theme_manager_starter()->start($basePath, $requiredFields, $exceptionOnInvalid));
 }
コード例 #4
0
ファイル: ThemeHandler.php プロジェクト: rverbrugge/dif
 /**
  * Constructor
  *
  * Reads project's and default .ini file, sets project handler's 
  * and initializes paths.
  * @param location config file
  */
 public function __construct()
 {
     parent::__construct();
     $this->template = array();
     $this->templateFile = "themes.tpl";
     $this->basePath = realpath(dirname(__FILE__) . "/../") . "/";
     //add new view types
     $view = ViewManager::getInstance();
     $view->insert(self::VIEW_CONFIG, 'Configure');
     $view->insert(self::VIEW_EXPORT, 'Export');
 }
コード例 #5
0
ファイル: BaseController.php プロジェクト: weddingjuma/world
 public function __construct()
 {
     $this->theme = Theme::type('frontend')->current(\ThemeManager::getActive('frontend'))->reBoot()->layout('layouts.default');
     $this->setTitle();
     $this->theme->share('loggedInUser', \Auth::user());
     $this->theme->share('languages', app('App\\Repositories\\LanguageRepository')->all());
     //attach before filter
     if (Config::get('maintenance-mode', 0)) {
         if (Auth::check() and Auth::user()->id == 1) {
             //don't enable it for maintain admin
         } else {
             $this->beforeFilter('maintenance');
         }
     }
     /**
      * Set global site variables
      */
     $updateSpeed = \Config::get('realtime-check-interval', 30000);
     $updateSpeed = !$updateSpeed ? 30000 : $updateSpeed;
     $this->theme->share('site_name', \Config::get('site_title'));
     $this->theme->share('site_description', \Config::get('site_description'));
     $this->theme->share('site_keywords', \Config::get('site_keywords'));
     $this->theme->share('ogType', 'website');
     $this->theme->share('ogSiteName', \Config::get('site_title'));
     $this->theme->share('ogUrl', \URL::to('/'));
     $this->theme->share('ogTitle', \Config::get('site_title'));
     $this->theme->share('ogImage', $this->theme->asset()->img('theme/images/logo.png'));
     $ajaxify = \Config::get('ajaxify_frontend') ? 'true' : 'false';
     $emoticons = \Theme::option()->get('emoticons');
     $emoticonLists = '';
     if ($emoticons) {
         foreach ($emoticons as $code => $details) {
             $emoticonLists .= "'<img width=\\'16\\' height=\\'16\\' src=\\'" . $details['image'] . "\\' title=\\'" . $details['title'] . "\\'/>',\n";
         }
     }
     $this->theme->asset()->beforeScriptContent("\n            var baseUrl = '" . \URL::to('/') . "/';\n            var siteName = '" . \Config::get('site_title') . "';\n            var doAjaxify = " . $ajaxify . ";\n            var maxPostImage = " . \Config::get('max-images-per-post', '') . ";\n            var updateSpeed = " . $updateSpeed . ";\n            var isLogin = '******'true' : 'false') . "';\n            var imgIndicator = '" . \Theme::asset()->img('theme/images/loading.gif') . "';\n\n            //time_ago translation\n            var trans_ago = '" . trans('global.ago') . "';\n            var trans_from_now = '" . trans('global.from-now') . "';\n            var trans_any_moment = '" . trans('global.any-moment') . "';\n            var trans_less_than_minute = '" . trans('global.less-than-minute') . "';\n            var trans_about_minute = '" . trans('global.about-minute') . "';\n            var trans_minutes = '" . trans('global.minutes') . "';\n            var trans_about_hour = '" . trans('global.about-hour') . "';\n            var trans_hours = '" . trans('global.hours') . "';\n            var trans_about = '" . trans('global.about') . "';\n            var trans_a_day = '" . trans('global.a-day') . "';\n            var trans_days = '" . trans('global.days') . "';\n            var trans_about_month = '" . trans('global.about-month') . "';\n            var trans_months = '" . trans('global.months') . "';\n            var trans_about_year = '" . trans('global.about-year') . "';\n            var trans_years = '" . trans('global.years') . "';\n            var emoticons = [" . $emoticonLists . "];\n        ");
     /**
      * Usefull repository in views
      */
     $this->theme->share('connectionRepository', app('App\\Repositories\\ConnectionRepository'));
     $this->theme->share('searchRepository', app('App\\Repositories\\SearchRepository'));
     $this->theme->share('notificationRepository', app('App\\Repositories\\NotificationRepository'));
     $this->theme->share('likeRepository', app('App\\Repositories\\LikeRepository'));
 }
コード例 #6
0
ファイル: index.php プロジェクト: evangelion62/Quiz
<?php

switch ($action) {
    case 'index':
        $themeManager = new ThemeManager($bdd);
        $themes = $themeManager->getList();
        $pageTitle = "page d'acceuil";
        ob_start();
        require_once 'view/home/index.php';
        $content = ob_get_contents();
        ob_end_clean();
        require_once 'view/layout/layout.php';
        break;
    default:
        break;
}
コード例 #7
0
ファイル: admin.php プロジェクト: qexyorg/webMCR-1
             $smtp_host = Filter::input('smtp_host');
             $smtp_port = Filter::input('smtp_port', 'post', 'int');
             $smtp_hello = Filter::input('smtp_hello');
             sqlConfigSet('smtp-user', $smtp_user);
             if ($smtp_pass != '**defined**') {
                 sqlConfigSet('smtp-pass', $smtp_pass);
             }
             sqlConfigSet('smtp-host', $smtp_host);
             sqlConfigSet('smtp-port', $smtp_port);
             sqlConfigSet('smtp-hello', $smtp_hello);
         }
         if ($email_test && !EMail::Send($email_test, 'Mail test', 'Content')) {
             $info .= '<br>' . lng('OPTIONS_MAIL_TEST_FAIL');
         }
     }
     $theme_manager = new ThemeManager(false, 'index.php?mode=control&');
     $theme_selector = $theme_manager->ShowThemeSelector();
     include View::Get('constants.html', $st_subdir);
     break;
 case 'profile':
     if (!$ban_user) {
         break;
     }
     tokenTool('set');
     $group_list = GroupManager::GetList($ban_user->group());
     include View::Get('profile_main.html', $st_subdir . 'profile/');
     $skin_def = $ban_user->defaultSkinTrigger();
     $cloak_exist = file_exists($ban_user->getCloakFName());
     $user_img_get = $ban_user->getSkinLink() . '&amp;refresh=' . rand(1000, 9999);
     if ($cloak_exist or !$skin_def) {
         include View::Get('profile_skin.html', $st_subdir . 'profile/');
コード例 #8
0
ファイル: NewsLetter.php プロジェクト: rverbrugge/dif
 /**
  * handle conf edit
  */
 private function handleConfEditGet($retrieveFields = true)
 {
     viewManager::getInstance()->setType(ViewManager::CONF_EDIT);
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $template->setVariable('pageTitle', $this->description);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $detail = $this->getDetail(array());
     $fields = array();
     if ($retrieveFields) {
         $fields = $this->exists(array()) ? $detail : $this->getFields(SqlParser::MOD_INSERT);
     } else {
         $fields = $this->getFields(SqlParser::MOD_UPDATE);
     }
     $this->setFields($fields);
     $template->setVariable($fields);
     $template->setVariable('id', $detail ? $detail['id'] : '');
     // get theme list
     $themeManager = new ThemeManager();
     $searchcriteria = array('active' => true);
     $themelist = $themeManager->getList($searchcriteria);
     $template->setVariable('cbo_theme', Utils::getHtmlCombo($themelist['data'], $fields['theme_id']));
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
コード例 #9
0
 /**
  * 取得主题管理类
  * 
  * @access public
  * @return mixed
  */
 public function getThemeManager()
 {
     return ThemeManager::getInstance();
 }
コード例 #10
0
ファイル: BlogInitializer.php プロジェクト: PhonemeCms/cms
 private function loadThemes()
 {
     $this->themeManager->setAllServiceProvidersFrom(__DIR__ . "/../Themes");
     $this->themeManager->registerServiceProviders();
     $this->themeManager->callBootMethodOfServiceProviders();
 }
コード例 #11
0
ファイル: functions.php プロジェクト: ycms/framework
<?php

namespace YC\Theme\Cutlass;

ThemeManager::register();
class ThemeManager
{
    public static function register()
    {
        foreach (glob(__DIR__ . '/Helpers/*.php') as $file) {
            if (preg_match("/^\\w+/", basename($file))) {
                require $file;
            }
        }
        //使WordPress支持post thumbnail
        if (function_exists('add_theme_support')) {
            add_theme_support('post-thumbnails');
        }
        // 支持自定义菜单
        if (function_exists('register_nav_menus')) {
            register_nav_menus(array('header-menu' => __('topnav')));
        }
        $sidebars = array('sidebar-profile', 'Post Sidebar', 'Page Sidebar');
        foreach ($sidebars as $name) {
            register_sidebar(array('name' => $name, 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
        }
        if (function_exists('add_image_size')) {
            add_image_size('60x60', 60, 60, true);
            // (cropped)
            add_image_size('245x163', 245, 163, true);
            // (cropped)
コード例 #12
0
ファイル: theme.php プロジェクト: evangelion62/Quiz
            $themeManager = new ThemeManager($bdd);
            $theme = $themeManager->get($_GET['id']);
            ob_start();
            require_once 'view/theme/updateTheme.php';
            $content = ob_get_contents();
            ob_end_clean();
            require_once 'view/layout/layout.php';
        } elseif (isset($_POST['theme'])) {
            $themeManager = new ThemeManager($bdd);
            $theme = new Theme($_POST);
            $themeManager->update($theme);
            header('Location: ?controler=theme&action=list');
        } else {
            header('Location: ?controler=theme&action=list');
        }
        break;
    case 'delete':
        $adminLvlThisControler = 4;
        require_once 'lib/checkRights.php';
        if (isset($_GET['id'])) {
            $themeManager = new ThemeManager($bdd);
            $themeManager->delete($_GET['id']);
            header('Location: ?controler=theme&action=list');
        } else {
            header('Location: ?controler=theme&action=list');
        }
        break;
    default:
        echo 'action non reconnue';
        break;
}
コード例 #13
0
ファイル: TemplateSupplier.php プロジェクト: Maxlander/shixi
 public static function getCurrentTheme($accessType = false)
 {
     $i18n = SJB_I18N::getInstance();
     $i18n->switchLang();
     $activeLanguagesData = $i18n->getActiveLanguagesData();
     $currentLanguage = $i18n->getCurrentLanguage();
     $currentLanguageData = null;
     foreach ($activeLanguagesData as $activeLanguageData) {
         if ($activeLanguageData['id'] == $currentLanguage) {
             $currentLanguageData = $activeLanguageData;
         }
     }
     SJB_System::setGlobalTemplateVariable('languages', $activeLanguagesData);
     SJB_System::setGlobalTemplateVariable('current_language', $currentLanguage);
     SJB_System::setGlobalTemplateVariable('current_language_data', $currentLanguageData);
     $arr = glob(SJB_BASE_DIR . 'system/ext/jquery/datepicker/i18n/jquery.ui.datepicker-*.js');
     if (is_array($arr) && !empty($arr)) {
         $available_datepicker_localizations = array();
         foreach ($arr as $item) {
             $matches = array();
             if (!preg_match('/datepicker-([a-zA-Z0-9-]+).js$/', $item, $matches)) {
                 continue;
             }
             $available_datepicker_localizations[$matches[1]] = $matches[1];
         }
         SJB_System::setGlobalTemplateVariable('available_datepicker_localizations', $available_datepicker_localizations);
     }
     $theme = null;
     if (SJB_System::getSystemSettings('SYSTEM_ACCESS_TYPE') == 'admin') {
         if ($accessType === false || $accessType === 'admin') {
             return SJB_System::getSystemSettings('SYSTEM_TEMPLATE_DIR') . '/admin';
         }
     } else {
         if (isset($_GET['theme'])) {
             $theme = $_GET['theme'];
             if (strtolower($theme) == 'mobile') {
                 $theme = 'mobile';
             }
             SJB_Session::setValue('theme', $theme);
         }
     }
     if (!ThemeManager::isThemeExists($theme, $accessType)) {
         $theme = SJB_Session::getValue('theme');
         if (empty($theme) || !ThemeManager::isThemeExists($theme, $accessType)) {
             $theme = SJB_Settings::getSettingByName('CURRENT_THEME');
             if (!ThemeManager::isThemeExists($theme, $accessType)) {
                 $theme = SJB_System::getSystemSettings('DEFAULT_THEME');
             }
         }
     }
     SJB_Event::dispatch('GetCurrentTheme', $theme, true);
     SJB_Session::setValue('CURRENT_THEME', $theme);
     return $theme;
 }
コード例 #14
0
ファイル: AssetPublisher.php プロジェクト: Houbsi/Core
 /**
  * Get the destination path
  * @return string
  */
 public function getDestinationPath()
 {
     return $this->repository->getAssetPath($this->theme->getLowerName());
 }
コード例 #15
0
ファイル: install.php プロジェクト: evangelion62/Quiz
<?php

switch ($action) {
    case 'index':
        /*création des tables*/
        $questionManager = new QuestionManager($bdd);
        $questionManager->createTable();
        $themeManager = new ThemeManager($bdd);
        $themeManager->createTable();
        $userManager = new UserManager($bdd);
        $userManager->createTable();
        $userRightsManager = new UserRightsManager($bdd);
        $userRightsManager->createTable();
        $tokenManager = new TokenManager($bdd);
        $tokenManager->createTable();
        /*redirection*/
        header('Location: ?controler=install&action=firstuser');
        break;
    case 'firstuser':
        $userManager = new UserManager($bdd);
        if ($userManager->count() > 0) {
            header('Location: ?controler=index');
        } else {
            if (isset($_POST['login']) && isset($_POST['pass'])) {
                $_POST['pass'] = sha1($_POST['pass']);
                $userManager = new UserManager($bdd);
                $user = new User($_POST);
                $userManager->add($user);
                $user = $userManager->get($_POST['login'], 'login');
                $userRights = new UserRights(array('userid' => $user->id(), 'adminlvl' => '4'));
                $userRightsManager = new UserRightsManager($bdd);
コード例 #16
0
ファイル: System.php プロジェクト: Maxlander/shixi
 public static function init()
 {
     SJB_DB::init(SJB_System::getSystemSettings('DBHOST'), SJB_System::getSystemSettings('DBUSER'), SJB_System::getSystemSettings('DBPASSWORD'), SJB_System::getSystemSettings('DBNAME'));
     ini_set('zlib.output_compression', SJB_System::getSettingByName('gzip_compression'));
     $GLOBALS['fatal_error_reserve_buffer'] = str_repeat('x', 1024 * 200);
     ob_start(array('SJB_Error', 'fatalErrorHandler'));
     SJB_Session::init(SJB_System::getSystemSettings('SITE_URL'));
     $sessionId = SJB_DB::queryValue("SELECT `session_id` FROM `user_session_data_storage` WHERE `session_id` = ?s", SJB_Session::getSessionId());
     // if not updated (row not exists) - insert that value
     if (empty($sessionId)) {
         SJB_DB::query("INSERT INTO `user_session_data_storage` SET `last_activity` = NOW(), `session_id` = ?s", SJB_Session::getSessionId());
     } else {
         SJB_DB::query("UPDATE `user_session_data_storage` SET `last_activity` = NOW() WHERE `session_id` = ?s", $sessionId);
     }
     //set timezone
     if (SJB_Settings::getSettingByName('timezone')) {
         ini_set('date.timezone', SJB_Settings::getSettingByName('timezone'));
     }
     // Set Error Handler and Shutdown function
     set_error_handler(array('SJB_Error', 'errorHandler'));
     register_shutdown_function(array('SJB_System', 'shutdownFunction'));
     SJB_System::prepareGlobalArrays();
     SJB_System::setGlobalTemplateVariable('is_ajax', SJB_Request::isAjax());
     SJB_System::setGlobalTemplateVariable('site_url', SJB_System::getSystemSettings('SITE_URL'));
     SJB_System::setGlobalTemplateVariable('user_site_url', SJB_System::getSystemSettings('USER_SITE_URL'));
     SJB_System::setGlobalTemplateVariable('admin_site_url', SJB_System::getSystemSettings('ADMIN_SITE_URL'));
     SJB_System::setGlobalTemplateVariable('radius_search_unit', SJB_System::getSettingByName('radius_search_unit'));
     SJB_System::setGlobalTemplateVariable('settings', SJB_Settings::getSettings());
     ThemeManager::getCurrentTheme();
     SJB_PluginManager::loadPlugins(SJB_System::getSystemSettings('PLUGINS_DIR'));
     SJB_System::setGlobalTemplateVariable('plugins', SJB_PluginManager::getAllPluginsList());
     $GLOBALS['System']['MODULE_MANAGER'] = new SJB_ModuleManager();
     SJB_Event::dispatch('moduleManagerCreated');
     $GLOBALS['System']['MODULE_MANAGER']->executeModulesStartupFunctions();
     // define if subadmin loged in and set subamdinmode for templates
     if (SJB_System::getSystemSettings('SYSTEM_ACCESS_TYPE') == SJB_System::getSystemSettings('ADMIN_ACCESS_TYPE') && SJB_SubAdmin::getSubAdminSID()) {
         SJB_System::setGlobalTemplateVariable('subAdminSID', SJB_SubAdmin::getSubAdminSID());
     }
     $GLOBALS['uri'] = SJB_Navigator::getURI();
 }
コード例 #17
0
ファイル: edit_templates.php プロジェクト: Maxlander/shixi
 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $template_editor = new SJB_TemplateEditor();
     $module_name = SJB_Request::getVar('module_name', '', 'GET');
     // if set simple_view - not shown navigation to user
     $simple_view = SJB_Request::getVar('simple_view', false);
     if (!$template_editor->doesModuleExists($module_name)) {
         $module_name = '';
     }
     $template_name = SJB_Request::getVar('template_name', '', 'GET');
     if (!$template_editor->doesModuleTemplateExists($module_name, $template_name)) {
         $template_name = '';
     }
     $modules = $template_editor->getModuleWithTemplatesList();
     global $error;
     $error = array();
     $result = '';
     $highlight_setting = SJB_Request::getVar('highlight_templates');
     if (!is_null($highlight_setting)) {
         if (SJB_System::getSystemSettings("isDemo")) {
             $error[] = 'NOT_ALLOWED_IN_DEMO';
         } else {
             SJB_Settings::updateSetting('highlight_templates', $highlight_setting);
         }
     }
     $tp->assign('highlight_templates', SJB_Settings::getSettingByName('highlight_templates'));
     $action = SJB_Request::getVar('action', '');
     $form_submitted = SJB_Request::getVar('submit');
     //Clear Smarty Cache
     $clear_smarty_cache = SJB_Request::getVar('clear_cache_submit');
     if ($clear_smarty_cache) {
         $compiled_templates_dir = SJB_System::getSystemSettings('COMPILED_TEMPLATES_DIR');
         $admin_theme = ThemeManager::getCurrentTheme();
         $themes_list['user'] = $template_editor->getThemeList();
         $themes_list['admin'][] = $admin_theme;
         foreach ($themes_list as $access_type => $themes) {
             foreach ($themes as $theme) {
                 $destination = $compiled_templates_dir . $access_type . "/" . $theme;
                 $result = $tp->deleteCacheBySpecifiedPath($destination);
                 if (is_array($result)) {
                     $error = $result;
                 }
             }
         }
     }
     // actions
     if (!empty($action)) {
         $theme = SJB_Settings::getValue('TEMPLATE_USER_THEME', 'default');
         // TODO: !!!!если редактируется с юзерской части , то проверить есть ли тэмплэйт в теме , если нет , брать с _system
         switch ($action) {
             case 'delete':
                 $template_editor->deleteTemplate($template_name, $module_name, $theme);
                 SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . '/edit-templates/?module_name=' . $module_name);
                 break;
             case 'edit':
             case 'add':
                 if (SJB_Request::getVar('templ_module') && SJB_Request::getVar('templ_name')) {
                     $newTemplName = trim(SJB_Request::getVar('templ_name'));
                     $newModuleName = SJB_Request::getVar('templ_module');
                     if (!$template_editor->isTemplateNameValid($newTemplName)) {
                         $error[] = 'NOT_VALID_FILENAME_FORMAT';
                     }
                     if (!$template_editor->doesModuleExists($newModuleName)) {
                         $error[] = 'MODULE_ERROR';
                     }
                     if (empty($error)) {
                         if ('edit' == $action) {
                             if ($template_editor->moveTemplate(SJB_Request::getVar('templ_name_or'), SJB_Request::getVar('templ_module_or'), $theme, $newModuleName, $newTemplName)) {
                                 if ($form_submitted == 'save_template') {
                                     SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . '/edit-templates/?module_name=' . $newModuleName);
                                 }
                                 SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . '/edit-templates/?module_name=' . $newModuleName . '&template_name=' . $newTemplName);
                                 exit;
                             } else {
                                 $error[] = 'CANT_MOVE_FILE';
                             }
                         } else {
                             if ($template_editor->createTemplate($theme, $newModuleName, $newTemplName, $error)) {
                                 SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . '/edit-templates/?module_name=' . $newModuleName . '&template_name=' . $newTemplName);
                             }
                             $error[] = 'CANT_CREATE_FILE';
                         }
                     }
                 }
                 break;
             default:
                 break;
         }
     }
     // не работало в юзерской
     if (empty($template_name)) {
         $template_name = SJB_Request::getVar('template_name', '');
     }
     if (empty($module_name)) {
         $module_name = SJB_Request::getVar('module_name', '');
     }
     // edittemplate
     if (!empty($template_name) && !empty($module_name)) {
         $menu_path = array(array('reference' => '?', 'name' => 'Edit Templates'), array('reference' => "?module_name={$module_name}", 'name' => $modules[$module_name]['display_name']), array('name' => $template_name, 'reference' => ''));
         $tp->assign('navigation', $menu_path);
         $tp->assign('errors', $error);
         $tp->assign('title', 'Edit Templates: ' . $modules[$module_name]['display_name'] . ' / Template: ' . $template_name);
         $tp->assign('show_clear_cache_setting', false);
         $tp->assign('show_highlight_setting', false);
         if (!$simple_view) {
             $tp->display('navigation_menu.tpl');
         }
         echo SJB_System::executeFunction('template_manager', 'edit_template');
     } else {
         if (!empty($module_name)) {
             $menu_path = array(array('reference' => '?', 'name' => 'Edit Templates'), array('reference' => '', 'name' => $modules[$module_name]['display_name']));
             $tp->assign('navigation', $menu_path);
             $tp->assign('title', 'Edit Templates');
             $tp->assign('errors', $error);
             $tp->assign('show_clear_cache_setting', false);
             $tp->assign('show_highlight_setting', false);
             if (!$simple_view) {
                 $tp->display('navigation_menu.tpl');
             }
             echo SJB_System::executeFunction('template_manager', 'template_list');
         } else {
             $menu_path = array(array('reference' => '', 'name' => 'Edit Templates'));
             $tp->assign('navigation', $menu_path);
             $tp->assign('title', 'Edit Templates');
             $tp->assign('show_clear_cache_setting', true);
             $tp->assign('show_highlight_setting', true);
             $tp->assign('result', $result);
             $tp->assign('errors', $error);
             if (!$simple_view) {
                 $tp->display('navigation_menu.tpl');
             }
             echo SJB_System::executeFunction('template_manager', 'add_template');
             echo SJB_System::executeFunction('template_manager', 'module_list');
         }
     }
 }
コード例 #18
0
ファイル: pre.php プロジェクト: rinodung/tuleap
	Timezone must come after logger to prevent messups
*/
if ($current_user->isLoggedIn()) {
    if (server_is_php_version_equal_or_greater_than_53() == true) {
        date_default_timezone_set($current_user->getTimezone());
    } else {
        putenv('TZ=' . $current_user->getTimezone());
    }
    if (!$cookie_manager->isCookie(CookieManager::USER_TOKEN)) {
        $user_manager->setUserTokenCookie($current_user);
    }
    if (!$cookie_manager->isCookie(CookieManager::USER_ID)) {
        $user_manager->setUserIdCookie($current_user);
    }
}
$theme_manager = new ThemeManager();
$HTML = $theme_manager->getTheme($current_user);
// If the Software license was declined by the site admin
// so stop all accesses to the site. Use exlicit path to avoid
// loading the license.php file in the register directory when
// invoking project/register.php
if (!IS_SCRIPT) {
    require_once dirname(__FILE__) . '/license.php';
    if (license_already_declined()) {
        exit_error($Language->getText('global', 'error'), $Language->getText('include_pre', 'site_admin_declines_license', $GLOBALS['sys_email_admin']));
    }
}
// Check if anonymous user is allowed to browse the site
// Bypass the test for:
// a) all scripts where you are not logged in by definition
// b) if it is a local access from localhost
コード例 #19
0
ファイル: NewsLetterOverview.php プロジェクト: rverbrugge/dif
 /**
  * handle tree edit
  */
 private function handleTreeEditGet($retrieveFields = true)
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(ViewManager::TREE_EDIT);
     if (!$request->exists('id')) {
         throw new Exception('Newsletter is missing.');
     }
     $id = intval($request->getValue('id'));
     $template->setVariable('id', $id, false);
     $key = array('id' => $id);
     if ($retrieveFields) {
         $fields = $this->getDetail($key);
         $fields['online'] = $fields['online'] ? strftime('%Y-%m-%d', $fields['online']) : '';
         $fields['offline'] = $fields['offline'] ? strftime('%Y-%m-%d', $fields['offline']) : '';
     } else {
         $fields = $this->getFields(SqlParser::MOD_UPDATE);
         $detail = $this->getDetail($key);
         $fields['image'] = $detail['image'];
     }
     $this->setFields($fields);
     if ($fields['image']) {
         $img = new Image($fields['image'], $this->plugin->getContentPath(true));
         $fields['image'] = array('src' => $this->plugin->getContentPath(false) . $img->getFileName(false), 'width' => $img->getWidth(), 'height' => $img->getHeight());
     }
     $template->setVariable($fields);
     // get theme list
     $themeManager = new ThemeManager();
     $searchcriteria = array('active' => true);
     $themelist = $themeManager->getList($searchcriteria);
     $template->setVariable('cbo_theme', Utils::getHtmlCombo($themelist['data'], $fields['theme_id']));
     $this->handleTreeSettings($template);
     $datefields = array();
     $datefields[] = array('dateField' => 'online', 'triggerElement' => 'online');
     $datefields[] = array('dateField' => 'offline', 'triggerElement' => 'offline');
     Utils::getDatePicker($this->director->theme, $datefields);
     // get crop settings
     $settings = $this->plugin->getSettings();
     //only crop if both width and height defaults are set
     if ($fields['image'] && $settings['image_width'] && $settings['image_height'] && ($fields['image']['width'] > $settings['image_width'] || $fields['image']['height'] > $settings['image_height'])) {
         $theme = $this->director->theme;
         $parseFile = new ParseFile();
         $parseFile->setVariable($fields);
         $parseFile->setVariable('imgTag', 'imgsrc');
         $parseFile->setVariable($settings);
         $parseFile->setSource($this->plugin->getHtdocsPath(true) . "js/cropinit.js.in");
         //$parseFile->setDestination($this->plugin->getCachePath(true)."cropinit_tpl_content.js");
         //$parseFile->save();
         $theme->addJavascript($parseFile->fetch());
         $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/prototype.js"></script>');
         $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/scriptaculous.js"></script>');
         $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/cropper.js"></script>');
         $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/mint.js"></script>');
     }
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }