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


PHP Settings::set_all_languages_online方法代码示例

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


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

示例1: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     // Check the database settings
     if ($this->test_database_config() === FALSE) {
         redirect(base_url() . 'install/');
         die;
     }
     $this->load->database();
     if (!$this->db->db_select()) {
         $error =& load_class('Exceptions', 'core');
         echo $error->show_error('Database Error', 'Unable to connect to the specified database : ' . $this->db->database, 'error_db');
         exit;
     }
     // Models
     $this->load->model(array('base_model', 'settings_model'), '', TRUE);
     // Helpers
     $this->load->helper('file');
     $this->load->helper('trace');
     // Get all the website languages from DB and store them into config file "languages" key
     $languages = $this->settings_model->get_languages();
     Settings::set_languages($languages);
     // 	Settings : google analytics string, filemanager, etc.
     //	Each setting is accessible through Settings::get('setting_name');
     Settings::set_settings_from_list($this->settings_model->get_settings(), 'name', 'content');
     Settings::set_settings_from_list($this->settings_model->get_lang_settings(config_item('detected_lang_code')), 'name', 'content');
     if (Authority::can('access', 'admin') && Settings::get('display_front_offline_content') == 1) {
         Settings::set_all_languages_online();
     }
     // Try to find the installer class : No access if install folder is already there
     $installer = glob(BASEPATH . '../*/class/installer' . EXT);
     // If installer class is already here, avoid site access
     if (!empty($installer)) {
         // Get languages codes from available languages folder/translation file
         $languages = $this->settings_model->get_admin_langs();
         if (!in_array(config_item('detected_lang_code'), $languages)) {
             $this->config->set_item('detected_lang_code', config_item('default_admin_lang'));
         }
         $this->lang->load('admin', config_item('detected_lang_code'));
         Theme::set_theme('admin');
         // Set the view to output
         $this->output('system/delete_installer');
         // Display the view directly
         $this->output->_display();
         // Don't do anything more
         die;
     }
 }
开发者ID:rockylo,项目名称:ionize,代码行数:52,代码来源:MY_Controller.php

示例2: get_home_url

 /**
  * Returns the Home URL
  *
  * @return string
  *
  */
 public static function get_home_url()
 {
     // Set all languages online if connected as editor or more
     if (Authority::can('access', 'admin') && Settings::get('display_front_offline_content') == 1) {
         Settings::set_all_languages_online();
     }
     if (count(Settings::get_online_languages()) > 1) {
         // if the current lang is the default one : don't return the lang code
         if (Settings::get_lang() != Settings::get_lang('default')) {
             return base_url() . Settings::get_lang() . '/';
         }
     }
     return base_url();
 }
开发者ID:pompalini,项目名称:emngo,代码行数:20,代码来源:url_model.php

示例3: tag_base_url

 /**
  * Returns the base URL of the website, with or without lang code in the URL
  *
  */
 public static function tag_base_url($tag)
 {
     // don't display the lang URL (by default)
     $lang_url = false;
     // The lang code in the URL is forced by the tag
     $force_lang = isset($tag->attr['force_lang']) ? true : false;
     // Set all languages online if connected as editor or more
     if (Connect()->is('editors', true)) {
         Settings::set_all_languages_online();
     }
     if (isset($tag->attr['lang']) && strtolower($tag->attr['lang']) == 'true' or $force_lang === true) {
         if (count(Settings::get_online_languages()) > 1) {
             // forces the lang code to be in the URL, for each language
             //				if ($force_lang === true)
             //				{
             return base_url() . Settings::get_lang() . '/';
             //				}
             // More intelligent : Detects if the current lang is the default one and don't return the lang code
             /*
             				else
             				{
             					if (Settings::get_lang() != Settings::get_lang('default'))
             					{
             						return base_url() . Settings::get_lang() .'/';
             					}
             				}
             */
         }
     }
     return base_url();
 }
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:35,代码来源:Tagmanager.php

示例4: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     // $this->output->enable_profiler(true);
     // Unlock filtering if admin or editor users is logged in
     //		$this->load->library('connect');
     $this->connect = Connect::get_instance();
     // Libraries
     $this->load->library('structure');
     $this->load->library('widget');
     // FTL parser
     //		require_once APPPATH.'libraries/ftl/parser.php';
     // Models
     //		$this->load->model('structure_model', '', true);
     $this->load->model('menu_model', '', true);
     // Modules config
     $this->get_modules_config();
     /*
      * Installed modules
      *
      */
     require APPPATH . 'config/modules.php';
     $installed_modules = $modules;
     foreach ($installed_modules as $module) {
         // Path to Module
         Finder::add_path(MODPATH . $module . '/');
     }
     /*
      * Theme
      *
      */
     // Set the current theme
     Theme::set_theme(Settings::get('theme'));
     // Theme config file
     // Overwrite Ionize standard config.
     if (is_file($file = Theme::get_theme_path() . 'config/config.php')) {
         include $file;
         if (!empty($config)) {
             foreach ($config as $k => $v) {
                 $this->config->set_item($k, $v);
             }
             unset($config);
         }
     }
     /*
      * Menus
      *
      */
     Settings::set('menus', $this->menu_model->get_list());
     /*
      * Language
      *
      */
     // Get all the website languages from DB and store them into config file "languages" key
     $languages = $this->settings_model->get_languages();
     // Put all DB languages array to Settings
     Settings::set_languages($languages);
     // Set all languages online if conected as editor or more
     if (Connect()->is('editors', true)) {
         Settings::set_all_languages_online();
     }
     // Simple languages code array, used to detect if Routers found language is in DB languages
     $online_lang_codes = array();
     foreach (Settings::get_online_languages() as $language) {
         $online_lang_codes[] = $language['lang'];
     }
     // If Router detected that the lang code is not in DB languages, set it to the DB default one
     if (!in_array(config_item('language_abbr'), $online_lang_codes)) {
         // Settings::get_lang('default') returns the DB default lang code
         Settings::set('current_lang', Settings::get_lang('default'));
         $this->config->set_item('language_abbr', Settings::get_lang('default'));
     } else {
         // Store the current lang code (found by Router) to Settings
         Settings::set('current_lang', config_item('language_abbr'));
     }
     // Lang dependant settings for the current language : Meta, etc.
     Settings::set_settings_from_list($this->settings_model->get_lang_settings(config_item('language_abbr')), 'name', 'content');
     /*
      * Static language
      *
      */
     $lang_folder = Theme::get_theme_path() . 'language/' . Settings::get_lang() . '/';
     $lang_files = array();
     // Core languages files : Including except "admin_lang.php"
     if (is_dir(APPPATH . 'language/' . Settings::get_lang())) {
         $lang_files = glob(APPPATH . 'language/' . Settings::get_lang() . '/*_lang.php', GLOB_BRACE);
         foreach ($lang_files as $key => $lang_file) {
             if ($lang_file == APPPATH . 'language/' . Settings::get_lang() . '/admin_lang.php') {
                 unset($lang_files[$key]);
             }
         }
     }
     // Theme languages files : Including. Can be empty
     $lf = glob(FCPATH . Theme::get_theme_path() . 'language/' . Settings::get_lang() . '/*_lang.php');
     if (!empty($lf)) {
         $lang_files = array_merge($lf, (array) $lang_files);
//.........这里部分代码省略.........
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:101,代码来源:MY_Controller.php

示例5: get_base_url

 public static function get_base_url()
 {
     if (Authority::can('access', 'admin') && Settings::get('display_front_offline_content') == 1) {
         Settings::set_all_languages_online();
     }
     if (count(Settings::get_online_languages()) > 1) {
         return base_url() . Settings::get_lang() . '/';
     }
     return base_url();
 }
开发者ID:pompalini,项目名称:emngo,代码行数:10,代码来源:Tagmanager.php

示例6: tag_base_url

 /**
  * Returns the base URL of the website, with or without lang code in the URL
  *
  */
 public static function tag_base_url($tag)
 {
     // don't display the lang URL (by default)
     $lang_url = false;
     // Set all languages online if connected as editor or more
     if (Connect()->is('editors', true)) {
         Settings::set_all_languages_online();
     }
     if (isset($tag->attr['lang']) && strtolower($tag->attr['lang']) == 'true') {
         if (count(Settings::get_online_languages()) > 1) {
             // if the current lang is the default one : don't return the lang code
             if (Settings::get_lang() != Settings::get_lang('default')) {
                 return base_url() . Settings::get_lang() . '/';
             }
         }
     }
     return base_url();
 }
开发者ID:nbourguig,项目名称:ionize,代码行数:22,代码来源:Tagmanager.php


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