plugins/admin/LangManager.php
changeset 400 7eef739a5b81
parent 399 a3a9e463c62f
child 411 d1a95497b68f
equal deleted inserted replaced
399:a3a9e463c62f 400:7eef739a5b81
    93           }
    93           }
    94         }
    94         }
    95         break;
    95         break;
    96       case 'modify_language':
    96       case 'modify_language':
    97         
    97         
    98         if ( defined('ENANO_DEMO_MODE') )
       
    99         {
       
   100           echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
       
   101           break;
       
   102         }
       
   103         
       
   104         $lang_id =& $parms['lang_id'];
    98         $lang_id =& $parms['lang_id'];
   105         if ( !is_int($lang_id) )
    99         if ( !is_int($lang_id) )
   106         {
   100         {
   107           echo 'Hacking attempt';
   101           echo 'Hacking attempt';
   108           break;
   102           break;
   109         }
   103         }
   110         
   104         
   111         if ( isset($parms['finish']) && !empty($_POST['lang_name_native']) && !empty($_POST['lang_name_english']) )
   105         if ( isset($parms['finish']) && !empty($_POST['lang_name_native']) && !empty($_POST['lang_name_english']) && !defined('ENANO_DEMO_MODE') )
   112         {
   106         {
   113           // We just did validation above, it's safe to save.
   107           // We just did validation above, it's safe to save.
   114           $name_native = $db->escape($_POST['lang_name_native']);
   108           $name_native = $db->escape($_POST['lang_name_native']);
   115           $name_english = $db->escape($_POST['lang_name_english']);
   109           $name_english = $db->escape($_POST['lang_name_english']);
   116           
   110           
   117           $q = $db->sql_query('UPDATE ' . table_prefix . "language SET lang_name_native = '$name_native', lang_name_default = '$name_english' WHERE lang_id = $lang_id;");
   111           $q = $db->sql_query('UPDATE ' . table_prefix . "language SET lang_name_native = '$name_native', lang_name_default = '$name_english' WHERE lang_id = $lang_id;");
   118           if ( !$q )
   112           if ( !$q )
   119             $db->_die();
   113             $db->_die();
   120           
   114           
   121           echo '<div class="info-box">' . $lang->get('acplm_msg_basic_save_success') . '</div>';
   115           echo '<div class="info-box">' . $lang->get('acplm_msg_basic_save_success') . '</div>';
       
   116         }
       
   117         else if ( isset($parms['finish']) && defined('ENANO_DEMO_MODE') )
       
   118         {
       
   119           echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
   122         }
   120         }
   123         
   121         
   124         // Select language data
   122         // Select language data
   125         $q = $db->sql_query('SELECT lang_name_native, lang_name_default, lang_code FROM ' . table_prefix . "language WHERE lang_id = $lang_id;");
   123         $q = $db->sql_query('SELECT lang_name_native, lang_name_default, lang_code FROM ' . table_prefix . "language WHERE lang_id = $lang_id;");
   126         if ( !$q )
   124         if ( !$q )
   301           echo '<div class="info-box">' . $lang->get('acplm_msg_string_save_success') . '</div>';
   299           echo '<div class="info-box">' . $lang->get('acplm_msg_string_save_success') . '</div>';
   302         }
   300         }
   303         else if ( isset($parms['save']) && defined('ENANO_DEMO_MODE') )
   301         else if ( isset($parms['save']) && defined('ENANO_DEMO_MODE') )
   304         {
   302         {
   305           echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
   303           echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
   306           break;
       
   307         }
   304         }
   308         
   305         
   309         acp_start_form();
   306         acp_start_form();
   310         
   307         
   311         $cat_name = $lang->get("meta_$cat_id");
   308         $cat_name = $lang->get("meta_$cat_id");