Cosmetic improvements to page editor; added demo mode checks in Admin:LangManager
authorDan
Mon, 04 Feb 2008 05:19:20 -0500
changeset 399 a3a9e463c62f
parent 398 7aa9370830f8
child 400 7eef739a5b81
Cosmetic improvements to page editor; added demo mode checks in Admin:LangManager
includes/clientside/static/editor.js
language/english/admin.json
plugins/admin/LangManager.php
--- a/includes/clientside/static/editor.js	Sat Feb 02 23:14:32 2008 -0500
+++ b/includes/clientside/static/editor.js	Mon Feb 04 05:19:20 2008 -0500
@@ -110,6 +110,8 @@
   //
   
   var heading = document.createElement('h3');
+  heading.style.cssFloat = 'left';
+  heading.style.styleFloat = 'left';
   heading.appendChild(document.createTextNode($lang.get('editor_msg_editor_heading')));
   
   // Plaintext/wikitext toggler
@@ -120,6 +122,9 @@
   {
     var toggler = document.createElement('p');
     toggler.style.marginLeft = '0';
+    toggler.style.cssFloat = 'right';
+    toggler.style.styleFloat = 'right';
+    toggler.style.paddingTop = '4pt';
     
     var span_wiki = document.createElement('span');
     var span_mce  = document.createElement('span');
@@ -162,6 +167,7 @@
   // Form (to allow submits from MCE to trigger a real save)
   var form = document.createElement('form');
   form.action = 'javascript:void(0);';
+  form.style.clear = 'both';
   form.onsubmit = function()
   {
     ajaxEditorSave();
@@ -174,10 +180,12 @@
   preview_anchor.id = 'ajax_preview';
   var preview_container = document.createElement('div');
   preview_container.id = 'enano_editor_preview';
+  preview_container.style.clear = 'both';
   
   // Textarea containing the content
   var ta_wrapper = document.createElement('div');
   ta_wrapper.style.margin = '10px 0';
+  ta_wrapper.style.clear = 'both';
   var textarea = document.createElement('textarea');
   textarea.value = content;
   textarea._edTimestamp = timestamp;
--- a/language/english/admin.json	Sat Feb 02 23:14:32 2008 -0500
+++ b/language/english/admin.json	Mon Feb 04 05:19:20 2008 -0500
@@ -453,6 +453,7 @@
       col_lang_name: 'Language name (native)',
       col_lang_name_eng: 'Language name (English)',
       btn_install_language: 'Install',
+      err_lang_install_demo: 'Modifying, installing, and uninstalling languages is disabled in the demo for security reasons.',
       msg_lang_install_success: 'The language pack %lang_name% has been installed.',
       
       // Editor portal
--- a/plugins/admin/LangManager.php	Sat Feb 02 23:14:32 2008 -0500
+++ b/plugins/admin/LangManager.php	Mon Feb 04 05:19:20 2008 -0500
@@ -56,6 +56,13 @@
     switch ( $action )
     {
       case 'install_language':
+        
+        if ( defined('ENANO_DEMO_MODE') )
+        {
+          echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
+          break;
+        }
+        
         $lang_list = list_available_languages();
         // Verify that we have this language's metadata
         if ( isset($lang_list[@$parms['iso639']]) )
@@ -87,6 +94,13 @@
         }
         break;
       case 'modify_language':
+        
+        if ( defined('ENANO_DEMO_MODE') )
+        {
+          echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
+          break;
+        }
+        
         $lang_id =& $parms['lang_id'];
         if ( !is_int($lang_id) )
         {
@@ -246,7 +260,7 @@
         
         $lang_id =& $parms['lang_id'];
         
-        if ( isset($parms['save']) )
+        if ( isset($parms['save']) && !defined('ENANO_DEMO_MODE') )
         {
           // Grab a Language object
           if ( $lang->lang_id == $lang_id )
@@ -286,6 +300,11 @@
           
           echo '<div class="info-box">' . $lang->get('acplm_msg_string_save_success') . '</div>';
         }
+        else if ( isset($parms['save']) && defined('ENANO_DEMO_MODE') )
+        {
+          echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
+          break;
+        }
         
         acp_start_form();
         
@@ -363,6 +382,12 @@
         if ( !isset($parms['iso639']) || !is_int(@$parms['lang_id']) )
           break;
         
+        if ( defined('ENANO_DEMO_MODE') )
+        {
+          echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
+          break;
+        }
+        
         $lang_code =& $parms['iso639'];
         $lang_id =& $parms['lang_id'];
         
@@ -442,6 +467,12 @@
         if ( !is_int(@$parms['lang_id']) )
           break;
         
+        if ( defined('ENANO_DEMO_MODE') )
+        {
+          echo '<div class="error-box">' . $lang->get('acplm_err_lang_install_demo') . '</div>';
+          break;
+        }
+        
         $lang_id =& $parms['lang_id'];
         
         if ( isset($parms['confirm']) )