plugins/admin/LangManager.php
changeset 399 a3a9e463c62f
parent 387 92664d2efab8
child 400 7eef739a5b81
equal deleted inserted replaced
398:7aa9370830f8 399:a3a9e463c62f
    54       }
    54       }
    55     }
    55     }
    56     switch ( $action )
    56     switch ( $action )
    57     {
    57     {
    58       case 'install_language':
    58       case 'install_language':
       
    59         
       
    60         if ( defined('ENANO_DEMO_MODE') )
       
    61         {
       
    62           echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
       
    63           break;
       
    64         }
       
    65         
    59         $lang_list = list_available_languages();
    66         $lang_list = list_available_languages();
    60         // Verify that we have this language's metadata
    67         // Verify that we have this language's metadata
    61         if ( isset($lang_list[@$parms['iso639']]) )
    68         if ( isset($lang_list[@$parms['iso639']]) )
    62         {
    69         {
    63           // From here it's all downhill :-)
    70           // From here it's all downhill :-)
    85             echo '<div class="info-box">' . $lang->get('acplm_msg_lang_install_success', array('lang_name' => htmlspecialchars($lang_data['name_eng']))) . '</div>';
    92             echo '<div class="info-box">' . $lang->get('acplm_msg_lang_install_success', array('lang_name' => htmlspecialchars($lang_data['name_eng']))) . '</div>';
    86           }
    93           }
    87         }
    94         }
    88         break;
    95         break;
    89       case 'modify_language':
    96       case 'modify_language':
       
    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         
    90         $lang_id =& $parms['lang_id'];
   104         $lang_id =& $parms['lang_id'];
    91         if ( !is_int($lang_id) )
   105         if ( !is_int($lang_id) )
    92         {
   106         {
    93           echo 'Hacking attempt';
   107           echo 'Hacking attempt';
    94           break;
   108           break;
   244         if ( !preg_match('/^[a-z0-9]+$/', $cat_id) || !is_int(@$parms['lang_id']) )
   258         if ( !preg_match('/^[a-z0-9]+$/', $cat_id) || !is_int(@$parms['lang_id']) )
   245           break;
   259           break;
   246         
   260         
   247         $lang_id =& $parms['lang_id'];
   261         $lang_id =& $parms['lang_id'];
   248         
   262         
   249         if ( isset($parms['save']) )
   263         if ( isset($parms['save']) && !defined('ENANO_DEMO_MODE') )
   250         {
   264         {
   251           // Grab a Language object
   265           // Grab a Language object
   252           if ( $lang->lang_id == $lang_id )
   266           if ( $lang->lang_id == $lang_id )
   253           {
   267           {
   254             $lang_local =& $lang;
   268             $lang_local =& $lang;
   283             if ( !$q )
   297             if ( !$q )
   284               $db->_die();
   298               $db->_die();
   285           }
   299           }
   286           
   300           
   287           echo '<div class="info-box">' . $lang->get('acplm_msg_string_save_success') . '</div>';
   301           echo '<div class="info-box">' . $lang->get('acplm_msg_string_save_success') . '</div>';
       
   302         }
       
   303         else if ( isset($parms['save']) && defined('ENANO_DEMO_MODE') )
       
   304         {
       
   305           echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
       
   306           break;
   288         }
   307         }
   289         
   308         
   290         acp_start_form();
   309         acp_start_form();
   291         
   310         
   292         $cat_name = $lang->get("meta_$cat_id");
   311         $cat_name = $lang->get("meta_$cat_id");
   361         return true;
   380         return true;
   362       case 'reimport':
   381       case 'reimport':
   363         if ( !isset($parms['iso639']) || !is_int(@$parms['lang_id']) )
   382         if ( !isset($parms['iso639']) || !is_int(@$parms['lang_id']) )
   364           break;
   383           break;
   365         
   384         
       
   385         if ( defined('ENANO_DEMO_MODE') )
       
   386         {
       
   387           echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
       
   388           break;
       
   389         }
       
   390         
   366         $lang_code =& $parms['iso639'];
   391         $lang_code =& $parms['iso639'];
   367         $lang_id =& $parms['lang_id'];
   392         $lang_id =& $parms['lang_id'];
   368         
   393         
   369         $lang_list = list_available_languages();
   394         $lang_list = list_available_languages();
   370         
   395         
   439         exit;
   464         exit;
   440         
   465         
   441       case 'uninstall_language':
   466       case 'uninstall_language':
   442         if ( !is_int(@$parms['lang_id']) )
   467         if ( !is_int(@$parms['lang_id']) )
   443           break;
   468           break;
       
   469         
       
   470         if ( defined('ENANO_DEMO_MODE') )
       
   471         {
       
   472           echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
       
   473           break;
       
   474         }
   444         
   475         
   445         $lang_id =& $parms['lang_id'];
   476         $lang_id =& $parms['lang_id'];
   446         
   477         
   447         if ( isset($parms['confirm']) )
   478         if ( isset($parms['confirm']) )
   448         {
   479         {