Example #1
0
/**
 * do() or debug() :)
 *
 * P.S. do — reserved PHP's word.
 *
 * @param mixed $expession
 */
function d($expression)
{
    static $number = 0;
    // Firstly, assign variable.
    $GLOBALS['var' . $number] = $expression;
    dump_variable('var' . $number, $expression);
    $number++;
}
Example #2
0
 function _save_language_config_file($data)
 {
     // Default language
     $def_lang = '';
     // Available / Online languages array
     $available_languages = array();
     $online_languages = array();
     foreach ($data as $l) {
         // Set default lang code
         if ($l['def'] == '1') {
             $def_lang = $l['lang'];
         }
         $available_languages[$l['lang']] = $l['name'];
         if ($l['online'] == '1') {
             $online_languages[$l['lang']] = $l['name'];
         }
     }
     // Language file save
     $conf = "<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');\n\n";
     $conf .= '/*' . "\n";
     $conf .= '| -------------------------------------------------------------------' . "\n";
     $conf .= '| IONIZE LANGUAGES' . "\n";
     $conf .= '| -------------------------------------------------------------------' . "\n";
     $conf .= '| Contains the available languages definitions for the front-end.' . "\n";
     $conf .= '| Auto-generated by Ionizes Language administration.' . "\n";
     $conf .= '| Changes made in this file will be overwritten by languages save in Ionize.' . "\n";
     $conf .= '|' . "\n";
     $conf .= '|' . "\n";
     $conf .= '*/' . "\n\n";
     $conf .= "// Default admin language code\n";
     $conf .= "\$config['default_admin_lang'] = 'en';\n\n";
     $conf .= "// Default language code\n";
     $conf .= "// This code depends on the language defined through the Ionize admin panel\n";
     $conf .= "// and will never change during the request process \n";
     $conf .= "\$config['default_lang_code'] = '" . $def_lang . "';\n\n";
     $conf .= "// Used language code\n";
     $conf .= "// Dynamically changed by the Router depending on the browser, cookie or asked URL\n";
     $conf .= "// By default, Ionize set it to the default lang code.\n";
     $conf .= "\$config['detected_lang_code'] = '" . $def_lang . "';\n\n";
     $conf .= "// Available languages\n";
     $conf .= "// Languages set through Ionize. Includes offline languages\n";
     $conf .= "\$config['available_languages'] = " . dump_variable($available_languages) . "\n\n";
     $conf .= "// Online languages\n";
     $conf .= "// Languages set online through Ionize.\n";
     $conf .= "\$config['online_languages'] = " . dump_variable($online_languages) . "\n\n";
     $conf .= "// Default Translations Language Code\n";
     $conf .= "// Used as reference by the translation tool\n";
     $conf .= "\$config['default_translation_lang_code'] = '" . $def_lang . "';\n\n";
     // files end
     $conf .= "\n\n";
     $conf .= '/* End of file language.php */' . "\n";
     $conf .= '/* Auto generated by Ionize Installer on : ' . date('Y.m.d H:i:s') . ' */' . "\n";
     $conf .= '/* Location: ./application/config/language.php */' . "\n";
     return @file_put_contents(APPPATH . 'config/language' . EXT, $conf);
 }
Example #3
0
 function save_config($modules, $aliases, $disable_controller)
 {
     $str = "<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); \n\n";
     $str .= '$modules = ' . dump_variable($modules) . "\n\n";
     $str .= '$aliases = ' . dump_variable($aliases) . "\n\n";
     $str .= '$disable_controller = ' . dump_variable($disable_controller) . "\n\n";
     $str .= "\n\n";
     $str .= '/* Auto generated by Modules Administration on : ' . date('Y.m.d H:i:s') . ' */' . "\n";
     // write
     $ret = @file_put_contents(APPPATH . '/config/modules' . EXT, $str);
     // num bytes written > 0
     if ($ret) {
         return TRUE;
     }
     return FALSE;
 }
Example #4
0
File: lang.php Project: trk/ionize
 /**
  * Updates the language config file
  *
  */
 function _update_config_file()
 {
     $languages = $this->lang_model->get_list(array('order_by' => 'ordering ASC'));
     // Default language
     $def_lang = '';
     // Available / Online languages array
     $available_languages = array();
     $online_languages = array();
     foreach ($languages as $l) {
         // Set default lang code
         if ($l['def'] == '1') {
             $def_lang = $l['lang'];
         }
         $available_languages[$l['lang']] = $l['name'];
         if ($l['online'] == '1') {
             $online_languages[$l['lang']] = $l['name'];
         }
     }
     // Files begin
     $conf = "<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');\n\n";
     $conf .= '/*' . "\n";
     $conf .= '| -------------------------------------------------------------------' . "\n";
     $conf .= '| IONIZE LANGUAGES' . "\n";
     $conf .= '| -------------------------------------------------------------------' . "\n";
     $conf .= '| Contains the available languages definitions for the front-end.' . "\n";
     $conf .= '| Auto-generated by Ionizes Language administration.' . "\n";
     $conf .= '| Changes made in this file will be overwritten by languages save in Ionize.' . "\n";
     $conf .= '|' . "\n";
     $conf .= '|' . "\n";
     $conf .= '*/' . "\n\n";
     $conf .= "// Default admin language code\n";
     $conf .= "\$config['default_admin_lang'] = '" . config_item('default_admin_lang') . "';\n\n";
     $conf .= "// Default language code\n";
     $conf .= "// This code depends on the language defined through the Ionize admin panel\n";
     $conf .= "// and will never change during the request process \n";
     $conf .= "\$config['default_lang_code'] = '" . $def_lang . "';\n\n";
     $conf .= "// Default Translation Language Code\n";
     $conf .= "\$config['default_translation_lang_code'] = '" . config_item('default_translation_lang_code') . "';\n\n";
     $conf .= "// Used language code\n";
     $conf .= "// Dynamically changed by the Router depending on the browser, cookie or asked URL\n";
     $conf .= "// By default, Ionize set it to the default lang code.\n";
     $conf .= "\$config['detected_lang_code'] = '" . $def_lang . "';\n\n";
     $conf .= "// Available languages\n";
     $conf .= "// Languages set through Ionize. Includes offline languages\n";
     $conf .= "\$config['available_languages'] = " . dump_variable($available_languages) . "\n\n";
     $conf .= "// Online languages\n";
     $conf .= "// Languages set online through Ionize.\n";
     $conf .= "\$config['online_languages'] = " . dump_variable($online_languages) . "\n\n";
     // files end
     $conf .= "\n\n";
     $conf .= '/* Auto generated by Language Administration on : ' . date('Y.m.d H:i:s') . ' */' . "\n";
     $ret = @file_put_contents(APPPATH . 'config/language' . EXT, $conf);
     if ($ret) {
         return TRUE;
     } else {
         return FALSE;
     }
 }
 function save_config($modules, $aliases, $disable_controller, $moddata = NULL)
 {
     $str = "<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); \n\n";
     $str .= '$modules = ' . dump_variable($modules) . "\n\n";
     $str .= '$aliases = ' . dump_variable($aliases) . "\n\n";
     $str .= '$disable_controller = ' . dump_variable($disable_controller) . "\n\n";
     //		$str .= '$moddata = '.dump_variable($moddata)."\n\n";
     // add end
     $str .= "\n\n";
     $str .= '/* End of file modules.php */' . "\n";
     $str .= '/* Auto generated by Themes Administration on : ' . date('Y.m.d H:i:s') . ' */' . "\n";
     $str .= '/* Location: ' . APPPATH . '/config/modules.php */' . "\n";
     // write
     $ret = @file_put_contents(APPPATH . '/config/modules' . EXT, $str);
     // num bytes written > 0
     if ($ret) {
         return true;
     }
     return false;
 }
Example #6
0
 /**
  * Updates the language config file
  *
  */
 function _update_config_file()
 {
     $languages = $this->lang_model->get_list(array('order_by' => 'ordering ASC'));
     // Default language
     $def_lang = '';
     // Available languages array
     $lang_uri_abbr = array();
     foreach ($languages as $l) {
         // Set default lang code
         if ($l['def'] == '1') {
             $def_lang = $l['lang'];
         }
         $lang_uri_abbr[$l['lang']] = $l['name'];
     }
     // Files begin
     $conf = "<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');\n\n";
     $conf .= '/*' . "\n";
     $conf .= '| -------------------------------------------------------------------' . "\n";
     $conf .= '| IONIZE LANGUAGES' . "\n";
     $conf .= '| -------------------------------------------------------------------' . "\n";
     $conf .= '| Contains the available languages definitions for the front-end.' . "\n";
     $conf .= '| Auto-generated by Ionizes Language administration.' . "\n";
     $conf .= '|' . "\n";
     $conf .= '| IMPORTANT : ' . "\n";
     $conf .= '| This file has no impact on ionizes admin languages.' . "\n";
     $conf .= '| For Admin languages modification, see application/languages/  ' . "\n";
     $conf .= '|' . "\n";
     $conf .= '*/' . "\n\n";
     $conf .= "// default language abbreviation\n";
     $conf .= "\$config['language_abbr'] = '" . $def_lang . "';\n\n";
     $conf .= "// available languages\n";
     $conf .= "\$config['lang_uri_abbr'] = " . dump_variable($lang_uri_abbr) . "\n\n";
     $conf .= "// ignore these language abbreviation : not used for the moment \n";
     $conf .= "\$config['lang_ignore'] = array();\n";
     // files end
     $conf .= "\n\n";
     $conf .= '/* End of file language.php */' . "\n";
     $conf .= '/* Auto generated by Language Administration on : ' . date('Y.m.d H:i:s') . ' */' . "\n";
     $conf .= '/* Location: ./application/config/language.php */' . "\n";
     $ret = @file_put_contents(APPPATH . 'config/language' . EXT, $conf);
     if ($ret) {
         return true;
     } else {
         return false;
     }
 }
Example #7
0
function dp($data, $indent = 0)
{
    return dump_variable($data, $indent);
}