function is_admin_area() {
$CI =& get_instance();
$fuel_path = $CI->config->item('fuel_path', 'fuel');
$fuel_path = substr($fuel_path , 0,-1);
if($CI->uri->segment(1) == $fuel_path) {
return TRUE;
} else {
return FALSE;
}
}
$this->lang->load('default', $this->multilang->get_current_langID);
$my_lang_options = $CI->config->item('languages');
$fields['lang_id'] = array('label' => 'Language', 'type' => 'select', 'options' => $my_lang_options);$save = array('page_id' => $id, 'name' => $key, 'value' => $value, 'type' => $val['type'], 'lang_id' => $CI->input->post('lang_id');$CI =& get_instance();
$language = $CI->config->item('language');
$this->db->where(array('lang_id' => $language));

class MY_Lang extends CI_Lang
{
var $languages = array(
'de' => array('name' => 'german', 'langCode' => 'de', 'id' => 0),
'en' => array('name' => 'english', 'langCode' => 'en', 'id' => 1)
);
var $current_lang_id = 0;
var $default_lang_id = 0;
var $current_segment = '';
var: $lang_id = 0;
function 1: set_language();
function 2: get_language();
$('#layout').change(function(e){
var path = jqx.config.fuelPath + '/pages/layout_fields/' + $('#layout').val() + '/' + $('#id').val() +'/' + $('#lang_id').val();
$('#layout_vars').load(path, {}, function(){
_this.initSpecialFields();
});
});
$('#lang_id').change(function(e){
$('#layout').trigger('change');
});
function layout_fields($layout, $id = NULL, $lang_id = NULL)
{
....
if (!empty($id)) {
$page_vars = $this->pagevariables_model->find_all_by_page_id($id,$lang_id);
$this->form_builder->set_field_values($page_vars);
}
....
}
function find_all_by_page_id($page_id,$lang_id=NULL) {
....
if(!empty($lang_id)){
$this->lang_id = $lang_id;
};
....
}
$this->db->where(array('lang_id' => $this->lang_id));

"fuel/navigation/lang_fields/2/0"
uri_segment(3) => navID
uri_segment(4) => langID
fuel/pages/edit/25/0
uri_segment(3) => pageID
uri_segment(4) => langID
During the create method, there is no language select. I will creates automatically the entry with the default language.
To the fuel_pages, i added a new field called "ref_name". It's necessary because of the page controllers.
Example: You have a page called "contact". For that page you need a special form, which you can add easily as an controller. just create a file named contact.php and put it into the controllers folder.
But what if your customer want to call the url "contact" in german "kontakt"? the connection to the controller will get lost. So i added the ref_name, which will setted with the creation of the page. afterwards, that entry will never get changed again.
$config['lang_uri_abbr'] = array("ja" => "japanese", "en" => "english");
// This is for FuelCMS admin menus
$config['languages'] = array(0 => 'english', 1 => 'japanese');
// This is for converting from string to numeric
$config['lang_to_id'] = array('english' => 0, 'japanese' => 1);
function _common_query()
{
$this->db->join($this->_tables['pages'], $this->_tables['pages'].'.id = '.$this->_tables['pagevars'].'.page_id', 'left');
$myuri_path = $_SERVER['REQUEST_URI'];
$myuri_path = strpos($myuri_path,'fuel/pages');
// Check to see if page loaded from admin or front end. The following is executed if loaded from the front end.
if(!$myuri_path){
$CI =& get_instance();
$language = $CI->config->item('language');
$lang_ids = $CI->config->item('lang_to_id');
$lang_id = $lang_ids[$language];
$this->db->where(array('lang_id' => $lang_id));
}
}
$save = array('page_id' => $id, 'name' => $key, 'value' => $value, 'type' => $val['type'], 'lang_id' => $CI->input->post('lang_id'); It looks like you're new here. If you want to get involved, click one of these buttons!