本文整理汇总了PHP中Settings::get_lang方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::get_lang方法的具体用法?PHP Settings::get_lang怎么用?PHP Settings::get_lang使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings::get_lang方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Index
*
* @access public
* @return parsed view
*/
function index($lang = FALSE)
{
if ($lang == FALSE) {
$lang = Settings::get_lang('default');
}
return $this->feed($lang);
}
示例2: tag_form
/**
* Displays the form
* Inherits from TagManager_Form the form displaying methods
* so the view can be slightly the same than the one used for one classical form
*
* @param FTL_Binding $tag
*
* @return string
*/
public static function tag_form(FTL_Binding $tag)
{
$ajax = $tag->getAttribute('ajax');
// Ajax form
if ($ajax == TRUE) {
// Get form string
$str = parent::tag_form($tag);
// No JS The user will add the JS part in his own JS script
$nojs = $tag->getAttribute('nojs');
$form_name = $tag->getAttribute('name');
$form_submit_id = $tag->getAttribute('submit');
// $error_tag = $tag->getAttribute('error_tag');
// $error_tag_class = $tag->getAttribute('error_tag_class');
// Module settings
self::$config = Modules()->get_module_config('Ajaxform');
if (!$nojs) {
// Add the JS part of the module
if ($form_name && $form_submit_id) {
$data = array('form_name' => $form_name, 'form_submit_id' => $form_submit_id, 'url' => base_url() . Settings::get_lang() . '/' . self::$config['uri'] . '/post');
$str .= self::$ci->load->view('ajaxform_js', $data, TRUE);
} else {
log_message('error', 'Ajaxform ERROR : Set the name & submit attributes of the <ion:form name="formName" submit="submitButtonID"> tag');
}
}
return $str;
} else {
return parent::tag_form($tag);
}
}
示例3: get_articles
/**
* Get all the article_lang data + the page URL of the current language (page_url in the output array)
*
* @param string String to search
* @return array Array of articles
*
*/
function get_articles($realm)
{
$realm = '\'%' . $realm . '%\'';
$this->set_table('article');
$this->set_lang_table('article_lang');
$this->set_pk_name('id_article');
$lang = Settings::get_lang();
// Page_Article table
$this->{$this->db_group}->select($this->parent_table . '.*', FALSE);
$this->{$this->db_group}->join($this->parent_table, $this->parent_table . '.id_article = ' . $this->table . '.id_article', 'left');
// Page table
$this->{$this->db_group}->select('page.online');
$this->{$this->db_group}->join($this->page_table, $this->page_table . '.id_page = ' . $this->parent_table . '.id_page', 'left');
// Page lang table
$this->{$this->db_group}->select('page_lang.lang');
$this->{$this->db_group}->join($this->page_lang_table, $this->page_lang_table . '.id_page = ' . $this->page_table . '.id_page', 'left');
// Menu table
$this->{$this->db_group}->select('menu.id_menu, menu.name as menu_name');
$this->{$this->db_group}->join($this->menu_table, $this->menu_table . '.id_menu = ' . $this->page_table . '.id_menu', 'left');
// URL table : For Article's URL building
$this->{$this->db_group}->select('url.path');
$this->{$this->db_group}->join($this->url_table, $this->url_table . '.id_entity = ' . $this->table . '.id_article' . ' AND ' . $this->url_table . '.active=1 ' . ' AND ' . $this->url_table . '.lang = \'' . $lang . '\'', 'left');
// Published filter
$this->filter_on_published(self::$publish_filter, $lang);
// Add the 'date' field to the query
$this->{$this->db_group}->select('IF(article.logical_date !=0, article.logical_date, IF(article.publish_on !=0, article.publish_on, article.created )) AS date');
// Search where
$this->{$this->db_group}->where('(' . ' article_lang.title LIKE ' . $realm . ' OR article_lang.subtitle LIKE ' . $realm . ' OR article_lang.content LIKE ' . $realm . ')');
$where = array("page.online" => 1, "article.indexed" => 1, "page_article.online" => 1, "page_article.main_parent" => 1, "article_lang.online" => 1, "article_lang.lang" => $lang, "page_lang.lang" => $lang);
// Base_model->get_lang_list()
$articles = parent::get_lang_list($where, $lang);
return $articles;
}
示例4: save
/**
* Saves a new language
*
*/
function save()
{
if ($this->input->post('lang_new') != "" && $this->input->post('name_new') != "") {
// Basic lang data
$data = array('lang' => $this->input->post('lang_new'), 'name' => $this->input->post('name_new'), 'online' => $this->input->post('online_new'));
// Ordering : New lang at last position
$this->db->select_max('ordering', 'ordering');
$query = $this->db->get('lang');
if ($query->num_rows() > 0) {
$row = $query->row();
$data['ordering'] = $row->ordering + 1;
}
// Save to DB
if ($this->lang_model->exists(array('lang' => $this->input->post('lang_new')))) {
$this->lang_model->update($this->input->post('lang_new'), $data);
} else {
$this->lang_model->insert($data);
/* Insert in lang tables (page_lang, article_lang) the basic lang data for this new created lang
* see lang_model->insert_lang_data() for more info.
*/
$this->lang_model->insert_lang_data(array('page', 'article'), $fields = array('url'), $from = Settings::get_lang('default'), $to = $this->input->post('lang_new'));
}
// Update the language config file
if (false == $this->_update_config_file()) {
$this->error(lang('ionize_message_lang_file_not_saved'));
}
// UI panel to update after saving
$this->update[] = array('element' => 'mainPanel', 'url' => admin_url() . 'lang');
// Answer send
$this->success(lang('ionize_message_lang_saved'));
} else {
$this->error(lang('ionize_message_lang_not_saved'));
}
}
示例5: get_definitions_from_parent
/**
* Returns the array of all definitions which have element defined for the given parent
*
* @param $parent
* @param bool $id_parent
*
* @return array
*/
function get_definitions_from_parent($parent, $id_parent = FALSE)
{
// Loads the element model if it isn't loaded
if (!isset(self::$ci->element_model)) {
self::$ci->load->model('element_model');
}
// Get definitions
$definitions = $this->get_lang_list(array('order_by' => 'ordering ASC'), Settings::get_lang('default'));
// Get Elements
$where = array('parent' => $parent, 'order_by' => 'element.ordering ASC');
if ($id_parent !== FALSE) {
$where['id_parent'] = $id_parent;
}
$elements = self::$ci->element_model->get_elements($where);
// Add elements to definition
foreach ($definitions as $key => $definition) {
$found = FALSE;
foreach ($elements as $element) {
// The element match a definition
if ($element['id_element_definition'] == $definition['id_element_definition']) {
$found = TRUE;
}
}
if ($found == FALSE) {
unset($definitions[$key]);
}
}
return $definitions;
}
示例6: _remap
/**
* Loads a module controller
* Receives the module name and proccess the URI
*
*
*
*/
function _remap($module_name)
{
// Delete the segments before the module name
$mod_uri = array_slice($this->uri->segments, 3);
// Get the controller, the called func name and the args
$module_controller = $mod_uri[0];
$module_func = 'index';
if (isset($mod_uri[1])) {
$module_func = $mod_uri[1];
}
$module_args = array_slice($mod_uri, 2);
// Module path
$module_path = MODPATH . ucfirst($module_name) . '/';
// Add the module path to the finder
array_unshift(Finder::$paths, $module_path);
// Includes the module Class file
if (!class_exists($module_controller) && file_exists($module_path . 'controllers/admin/' . $module_controller . EXT)) {
include $module_path . 'controllers/admin/' . $module_controller . EXT;
} else {
echo 'Class <b>' . ucfirst($module_controller) . '</b> not found in :<br/><b>' . $module_path . 'controllers/admin/</b>';
die;
}
// Create an instance of the module controller
$obj = new $module_controller($this);
// Loads module language file, if exists
// if (is_file($module_path.'language/'.$this->config->item('default_lang_code').'/'.$module_name.'_lang.php'))
// {
$this->lang->load($module_name, Settings::get_lang('current'));
// }
// else
// {
// trace('warning: no language file for this module in : '. $module_path.'language/'.$this->config->item('default_lang_code').'/');
// }
call_user_func_array(array($obj, $module_func), $module_args);
}
示例7: get_list
/**
* Returns enhanced media list
*
* @param null $where
* @param array $filters
* @param bool $addon_data
*
* @return array
*/
public function get_list($where = NULL, $filters = array(), $addon_data = TRUE)
{
// Pages
$this->{$this->db_group}->select("group_concat(url.path separator ';') as page_paths");
$this->{$this->db_group}->join('page_media', 'page_media.id_media = ' . $this->table . '.id_media', 'left');
$this->{$this->db_group}->join('url', "url.id_entity = page_media.id_page AND url.type='page' and url.active=1 and url.lang='" . Settings::get_lang('default') . "'", 'left');
// Articles
$this->{$this->db_group}->select("group_concat(url2.path separator ';') as article_paths");
$this->{$this->db_group}->join('article_media', 'article_media.id_media = ' . $this->table . '.id_media', 'left');
$this->{$this->db_group}->join('url as url2', "url2.id_entity = article_media.id_article AND url2.type='article' and url2.active=1 and url2.lang='" . Settings::get_lang('default') . "'", 'left');
// Filters
if (in_array('alt_missing', $filters)) {
$this->{$this->db_group}->join('media_lang', 'media_lang.id_media = ' . $this->table . '.id_media', 'left');
$this->{$this->db_group}->where("(media_lang.alt is null or media_lang.alt='')");
}
if (in_array('used', $filters)) {
$this->{$this->db_group}->where('(url.path is not null or url2.path is not null)');
}
if (in_array('not_used', $filters)) {
$this->{$this->db_group}->where('(url.path is null and url2.path is null)');
}
$this->{$this->db_group}->group_by($this->table . '.id_media');
$this->{$this->db_group}->order_by($this->table . '.id_media', 'DESC');
$result = parent::get_list($where, $this->table);
if ($addon_data) {
$result = $this->_add_lang_data_to_media_list($result);
}
return $result;
}
示例8: run
/**
* Run one widget
*
* @param string Widget name
*
* @return mixed Call of the widget "run" method
*
*/
function run($name)
{
$ci =& get_instance();
// Get widget args
$args = func_get_args();
// Depending on call (direct or from FTL), define args
if (isset($args[1])) {
if (is_array($args[1])) {
$args = $args[1];
} else {
array_shift($args);
}
}
// Get the widget class
require_once APPPATH . '../themes/' . Settings::get('theme') . '/widgets/' . $name . '/' . $name . EXT;
// Create a new instance of the widget class
$class_name = ucfirst($name);
$widget = new $class_name();
// Loads the widget Languages translation files
$lang_files = glob(Theme::get_theme_path() . 'widgets/' . $name . '/language/' . Settings::get_lang() . '/*');
if (!empty($lang_files)) {
foreach ($lang_files as $lang_file) {
// Widget language file is optional, so only include if it exists
if (is_file($lang_file)) {
// Include widget language file
include $lang_file;
// Merge to the Lang array
$ci->lang->language = array_merge($ci->lang->language, $lang);
unset($lang);
}
}
}
// Call the widget "run" method
return call_user_func_array(array(&$widget, 'run'), $args);
}
示例9: admin_url
function admin_url($lang_segment = FALSE)
{
$CI =& get_instance();
if ($lang_segment == TRUE) {
return base_url() . Settings::get_lang('current') . '/' . $CI->config->slash_item('admin_url');
}
return base_url() . $CI->config->slash_item('admin_url');
}
示例10: get_articles
/**
* Get all the article_lang data + the page URL of the current language (page_url in the output array)
*
* @param string String to search
* @return array Array of articles
*
*/
function get_articles($realm)
{
$realm = '%' . $realm . '%';
$sql = "\tSELECT \tarticle_lang.title, article_lang.content, article_lang.url,\r\n\t\t\t\t\t\t\tIF(article.logical_date !=0, article.logical_date, IF(article.publish_on !=0, article.publish_on, article.created )) AS date,\r\n\t\t\t\t\t\t\tpage_lang.url as page_url, \r\n\t\t\t\t\t\t\tpage_lang.title as page_title \r\n\t\t\t\t\tFROM (article)\r\n\t\t\t\t\t\tJOIN article_lang ON article.id_article = article_lang.id_article\r\n\t\t\t\t\t\tJOIN page_article ON article.id_article = page_article.id_article\r\n\t\t\t\t\t\tJOIN page ON page.id_page = page_article.id_page\r\n\t\t\t\t\t\tJOIN page_lang ON page_lang.id_page = page.id_page\r\n\t\t\t\t\tWHERE \r\n\t\t\t\t\t\tpage.online = 1\r\n\t\t\t\t\t\tAND article.indexed = 1\r\n\t\t\t\t\t\tAND page_article.online = 1\r\n\t\t\t\t\t\tAND page_article.main_parent = 1\r\n\t\t\t\t\t\tAND article_lang.online = 1\r\n\t\t\t\t\t\tAND article_lang.lang = ?\r\n\t\t\t\t\t\tAND page_lang.lang = ?\r\n\t\t\t\t\t\tAND (\r\n\t\t\t\t\t\t\tarticle_lang.title LIKE ?\r\n\t\t\t\t\t\t\tOR article_lang.subtitle LIKE ?\r\n\t\t\t\t\t\t\tOR article_lang.summary LIKE ?\r\n\t\t\t\t\t\t\tOR article_lang.content LIKE ?\r\n\t\t\t\t\t\t)\r\n\t\t";
// Current language
$lang = Settings::get_lang();
$query = $this->db->query($sql, array($lang, $lang, $realm, $realm, $realm, $realm));
return $query->result_array();
}
示例11: create
function create()
{
$id_element_definition = $this->input->post('id_element_definition');
$this->extend_field_model->feed_blank_template($this->template);
$this->extend_field_model->feed_blank_lang_template($this->template, Settings::get_lang('default'));
// Get the parent element
$element = $this->element_definition_model->get(array('id_element_definition' => $id_element_definition));
$this->template['element'] = $element;
$this->template['id_parent'] = $id_element_definition;
$this->output('element/field');
}
示例12: get_element_fields
public function get_element_fields($id_ui_element)
{
$extends = array();
self::$ci->load->model('extend_field_model');
$sql = "\r\n\t\t\tselect\r\n\t\t\t\tuie.*,\r\n\t\t\t\tef.*,\r\n\t\t\t\tefl.label,\r\n\t\t\t\teft.*\r\n\t\t\tfrom " . self::$_TBL_LK_EXTEND . " uie\r\n\t\t\tinner join extend_field ef on ef.id_extend_field = uie.id_extend\r\n\t\t\tinner join extend_field_lang efl on efl.id_extend_field = ef.id_extend_field and efl.lang='" . Settings::get_lang('default') . "'\r\n\t\t\tinner join extend_field_type eft on eft.id_extend_field_type = ef.type\r\n\t\t\twhere uie.id_ui_element = " . $id_ui_element . "\r\n\t\t\torder by uie.ordering ASC\r\n\t\t";
$query = $this->{$this->db_group}->query($sql);
if ($query->num_rows() > 0) {
$extends = $query->result_array();
}
return $extends;
}
示例13: get_linked_author
public function get_linked_author($parent, $id_parent)
{
// Returned data
$data = array();
// Conditions
$where = array('parent' => $parent, 'id_parent' => $id_parent, $this->_author_lang_table . '.lang' => Settings::get_lang('default'));
$query = $this->{$this->db_group}->where($where)->order_by('ordering ASC')->join($this->_author_table, $this->_author_table . '.id_author = ' . $this->_link_table . '.id_author', 'left')->join($this->_author_lang_table, $this->_author_lang_table . '.id_author = ' . $this->_author_table . '.id_author', 'left')->get($this->_link_table);
if ($query->num_rows() > 0) {
$data = $query->result_array();
}
return $data;
}
示例14: get_element_fields
/**
* Get Extend Fields linked to one UI Element (one tab for example)
*
* @param $id_ui_element
*
* @return array
*/
public function get_element_fields($id_ui_element)
{
$extends = array();
self::$ci->load->model('extend_field_model');
$sql = "\r\n\t\t\tSELECT\r\n\t\t\t\tuie.*,\r\n\t\t\t\tef.*,\r\n\t\t\t\tefl.label,\r\n\t\t\t\teft.*\r\n\t\t\tFROM " . self::$_TBL_LK_EXTEND . " uie\r\n\t\t\tINNER JOIN extend_field ef ON ef.id_extend_field = uie.id_extend\r\n\t\t\tINNER JOIN extend_field_lang efl ON efl.id_extend_field = ef.id_extend_field AND efl.lang='" . Settings::get_lang('default') . "'\r\n\t\t\tINNER JOIN extend_field_type eft ON eft.id_extend_field_type = ef.type\r\n\t\t\tWHERE uie.id_ui_element = " . $id_ui_element . '
ORDER BY uie.ordering ASC
';
$query = $this->{$this->db_group}->query($sql);
if ($query->num_rows() > 0) {
$extends = $query->result_array();
}
return $extends;
}
示例15: edit
/**
* Edit one item field
*
*/
function edit()
{
$id_item_definition = $this->input->post('id_item_definition');
$id_extend_field = $this->input->post('id_extend_field');
$this->extend_field_model->feed_template($id_extend_field, $this->template);
$this->extend_field_model->feed_lang_template($id_extend_field, $this->template);
// Get the parent element
$item = $this->item_definition_model->get(array('id_item_definition' => $this->template['id_parent']), Settings::get_lang('default'));
// Pass the parent informations to the template
$this->template['item'] = $item;
$this->template['id_item_definition'] = $id_item_definition;
$this->output('item/definition/field');
}