Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
authorDan
Fri, 16 May 2008 12:22:26 -0400
changeset 555 ac4c6a7f01d8
parent 554 e87390b1f9b0
child 556 63e131c38876
Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
ajax.php
images/icons/applets/userranks.png
includes/clientside/jsres.php
includes/clientside/static/acl.js
includes/clientside/static/ajax.js
includes/clientside/static/editor.js
includes/clientside/static/enano-lib-basic.js
includes/clientside/static/faders.js
includes/lang.php
includes/paths.php
includes/plugins.php
includes/sessions.php
includes/template.php
install/schemas/mysql_stage2.sql
install/schemas/postgresql_stage2.sql
install/schemas/upgrade/1.1.3-1.1.4-mysql.sql
install/schemas/upgrade/1.1.3-1.1.4-postgresql.sql
language/english/admin.json
language/english/user.json
plugins/SpecialAdmin.php
plugins/SpecialUserFuncs.php
plugins/SpecialUserPrefs.php
plugins/admin/PluginManager.php
plugins/admin/UserRanks.php
--- a/ajax.php	Mon May 12 00:59:46 2008 -0400
+++ b/ajax.php	Fri May 16 12:22:26 2008 -0400
@@ -335,7 +335,7 @@
         }
         
         // Verify captcha, if needed
-        if ( !$session->user_logged_in && getConfig('guest_edit_require_captcha') == '1' )
+        if ( false && !$session->user_logged_in && getConfig('guest_edit_require_captcha') == '1' )
         {
           if ( !isset($request['captcha_id']) || !isset($request['captcha_code']) )
           {
Binary file images/icons/applets/userranks.png has changed
--- a/includes/clientside/jsres.php	Mon May 12 00:59:46 2008 -0400
+++ b/includes/clientside/jsres.php	Fri May 16 12:22:26 2008 -0400
@@ -57,6 +57,7 @@
   'libbigint.js',
   'ajax.js',
   'editor.js',
+  'login.js',
   'acl.js',
   'misc.js',
   'comments.js',
@@ -66,6 +67,7 @@
   'paginate.js',
   'autocomplete.js',
   'md5.js',
+  'enano-lib-basic.js',
   'pwstrength.js',
   'sha256.js',
   'flyin.js',
@@ -132,16 +134,66 @@
 $before_includes = substr($file, 0, $pos_start_includes);
 $after_includes = substr($file, $pos_end_includes);
 
-$everything .= $before_includes;
-$everything .= $after_includes;
+// compress enano-lib-basic
+$libbasic = "$before_includes\n$after_includes";
+$libbasic = jsres_cache_check('enano-lib-basic.js', $libbasic);
+$everything .= $libbasic;
+
+// $everything .= $before_includes;
+// $everything .= $after_includes;
 
 foreach ( $file_list as $js_file )
 {
   $file_contents = file_get_contents("includes/clientside/static/$js_file");
-  $file_md5 = md5($file_contents);
   $time = filemtime("includes/clientside/static/$js_file");
   if ( $time > $apex )
     $apex = $time;
+  
+  $file_contents = jsres_cache_check($js_file, $file_contents);
+  
+  $everything .= "\n\n// $js_file\n";
+  $everything .= "\n" . $file_contents;
+}
+
+// generate ETag
+$etag = base64_encode(hexdecode(sha1($everything)));
+
+if ( isset($_SERVER['HTTP_IF_NONE_MATCH']) )
+{
+  if ( "\"$etag\"" == $_SERVER['HTTP_IF_NONE_MATCH'] )
+  {
+    header('HTTP/1.1 304 Not Modified');
+    exit();
+  }
+}
+
+$everything = str_replace('/* JavaScriptCompressor 0.8 [www.devpro.it], thanks to Dean Edwards for idea [dean.edwards.name] */' . "\r\n", '', $everything);
+
+$date = date('r', $apex);
+header("Date: $date");
+header("Last-Modified: $date");
+header("ETag: \"$etag\"");
+
+echo $everything;
+
+if ( $do_gzip )
+{
+  gzip_output();
+}
+
+/**
+ * Check the cache for the given JS file and return the best-compressed version.
+ * @param string Javascript file (acl.js)
+ * @param string Default/current contents
+ * @return string
+ */
+
+function jsres_cache_check($js_file, $file_contents)
+{
+  global $full_compress_safe, $compress_unsafe;
+  
+  $file_md5 = md5($file_contents);
+  
   // Is this file cached?
   $cache_path = ENANO_ROOT . "/cache/jsres_$js_file.json";
   $loaded_cache = false;
@@ -186,31 +238,6 @@
     }
   }
   
-  $everything .= "\n // $js_file\n";
-  $everything .= "\n" . $file_contents;
+  return $file_contents;
 }
 
-// generate ETag
-$etag = base64_encode(hexdecode(sha1($everything)));
-
-if ( isset($_SERVER['HTTP_IF_NONE_MATCH']) )
-{
-  if ( "\"$etag\"" == $_SERVER['HTTP_IF_NONE_MATCH'] )
-  {
-    header('HTTP/1.1 304 Not Modified');
-    exit();
-  }
-}
-
-$date = date('r', $apex);
-header("Date: $date");
-header("Last-Modified: $date");
-header("ETag: \"$etag\"");
-
-echo $everything;
-
-if ( $do_gzip )
-{
-  gzip_output();
-}
-
--- a/includes/clientside/static/acl.js	Mon May 12 00:59:46 2008 -0400
+++ b/includes/clientside/static/acl.js	Fri May 16 12:22:26 2008 -0400
@@ -5,7 +5,7 @@
 var aclDataCache = false;
 
 // Can be set to true by slow themes (St. Patty)
-var aclDisableTransitionFX = false;
+var aclDisableTransitionFX = ( is_firefox2 || pref_disable_js_fx ) ? true : false;
 
 function ajaxOpenACLManager(page_id, namespace)
 {
--- a/includes/clientside/static/ajax.js	Mon May 12 00:59:46 2008 -0400
+++ b/includes/clientside/static/ajax.js	Fri May 16 12:22:26 2008 -0400
@@ -463,7 +463,7 @@
           text: $lang.get('ajax_delvote_reset_btn_submit'),
           color: 'red',
           style: {
-            fontWeight: 'bold',
+            fontWeight: 'bold'
           },
           onclick: function(e)
           {
--- a/includes/clientside/static/editor.js	Mon May 12 00:59:46 2008 -0400
+++ b/includes/clientside/static/editor.js	Fri May 16 12:22:26 2008 -0400
@@ -650,6 +650,7 @@
     {
       if ( ajax.readyState == 4 && ajax.status == 200 )
       {
+        ajaxUnSetEditorLoading();
         var response = String(ajax.responseText + '');
         if ( response.substr(0, 1) != '{' )
         {
@@ -727,7 +728,6 @@
           else
           {
             // The save was successful; reset flags and make another request for the new page content
-            ajaxUnSetEditorLoading();
             setAjaxLoading();
             editor_open = false;
             enableUnload();
--- a/includes/clientside/static/enano-lib-basic.js	Mon May 12 00:59:46 2008 -0400
+++ b/includes/clientside/static/enano-lib-basic.js	Fri May 16 12:22:26 2008 -0400
@@ -17,7 +17,7 @@
 
 if(typeof title != 'string')
 {
-  alert('Uh-oh! The required dynamic (PHP-generated) Javascript variables don\'t seem to be available. Javascript is going to be seriously broken.');
+  alert('There was a problem loading the PHP-generated Javascript variables that control parameters for AJAX applets. Most on-page functionality will be very badly broken.\n\nTheme developers, ensure that you are using {JS_DYNAMIC_VARS} *before* you include jsres.php.');
 }
 
 // Run-time variables
@@ -38,6 +38,7 @@
 
 var is_Opera = ( checkIt('opera') ) ? true : false;
 var is_iPhone = ( checkIt('iphone') || checkIt('ipod') ) ? true : false;
+var is_firefox2 = ( checkIt('firefox/2.') ) ? true : false;
 
 var KILL_SWITCH = false;
 
--- a/includes/clientside/static/faders.js	Mon May 12 00:59:46 2008 -0400
+++ b/includes/clientside/static/faders.js	Fri May 16 12:22:26 2008 -0400
@@ -427,13 +427,20 @@
 {
   if ( document.getElementById('specialLayer_darkener') )
   {
-    var opac = parseFloat(document.getElementById('specialLayer_darkener'));
-    opac = opac * 100;
-    darken(false, opac);
+    if ( document.getElementById('specialLayer_darkener').style.display != 'none' )
+    {
+      var opac = parseFloat(document.getElementById('specialLayer_darkener').style.opacity);
+      opac = opac * 100;
+      darken(aclDisableTransitionFX, opac);
+    }
+    else
+    {
+      darken(aclDisableTransitionFX, 40);
+    }
   }
   else
   {
-    darken(false, 40);
+    darken(aclDisableTransitionFX, 40);
   }
   
   var wrapper = document.createElement('div');
@@ -459,12 +466,19 @@
   var realbody = document.getElementsByTagName('body')[0];
   realbody.appendChild(wrapper);
   
-  fly_in_top(wrapper, true, true);
-  
-  setTimeout(function()
-    {
-      domObjChangeOpac(100, wrapper);
-    }, 40);
+  if ( aclDisableTransitionFX )
+  {
+    domObjChangeOpac(100, wrapper);
+  }
+  else
+  {
+    fly_in_top(wrapper, true, true);
+    
+    setTimeout(function()
+      {
+        domObjChangeOpac(100, wrapper);
+      }, 40);
+  }
 }
 
 /**
@@ -506,12 +520,19 @@
   // found it
   var parent = obj.parentNode;
   if ( !nofade )
-    enlighten();
-  var timeout = fly_out_top(obj, true, true);
-  setTimeout(function()
-    {
-      parent.removeChild(obj);
-    }, timeout);
+    enlighten(aclDisableTransitionFX);
+  if ( aclDisableTransitionFX )
+  {
+    parent.removeChild(obj);
+  }
+  else
+  {
+    var timeout = fly_out_top(obj, true, true);
+    setTimeout(function()
+      {
+        parent.removeChild(obj);
+      }, timeout);
+  }
 }
 
 /**
--- a/includes/lang.php	Mon May 12 00:59:46 2008 -0400
+++ b/includes/lang.php	Fri May 16 12:22:26 2008 -0400
@@ -525,6 +525,8 @@
     if ( $debug )
       echo "  Regenerating cache file$br\n";
     $this->regen_caches();
+    
+    return true;
   }
   
   /**
--- a/includes/paths.php	Mon May 12 00:59:46 2008 -0400
+++ b/includes/paths.php	Fri May 16 12:22:26 2008 -0400
@@ -93,6 +93,7 @@
     $this->addAdminNode('adm_cat_users',      'adm_page_user_groups',    'GroupManager', scriptPath . '/images/icons/applets/groupmanager.png');
     $this->addAdminNode('adm_cat_users',      'adm_page_coppa',          'COPPA', scriptPath . '/images/icons/applets/coppa.png');
     $this->addAdminNode('adm_cat_users',      'adm_page_mass_email',     'MassEmail', scriptPath . '/images/icons/applets/massemail.png');
+    $this->addAdminNode('adm_cat_users',      'adm_page_user_ranks',     'UserRanks', scriptPath . '/images/icons/applets/userranks.png');
     $this->addAdminNode('adm_cat_security',   'adm_page_security_log',   'SecurityLog', scriptPath . '/images/icons/applets/securitylog.png');
     $this->addAdminNode('adm_cat_security',   'adm_page_ban_control',    'BanControl', scriptPath . '/images/icons/applets/bancontrol.png');
     
--- a/includes/plugins.php	Mon May 12 00:59:46 2008 -0400
+++ b/includes/plugins.php	Fri May 16 12:22:26 2008 -0400
@@ -811,6 +811,54 @@
     
     return $return;
   }
+  
+  /**
+   * Re-imports the language strings from a plugin.
+   * @param string File name
+   * @return array Enano JSON response protocol
+   */
+  
+  function reimport_plugin_strings($filename, $plugin_list = null)
+  {
+    global $db, $session, $paths, $template, $plugins; // Common objects
+    global $lang;
+    
+    if ( !$plugin_list )
+      $plugin_list = $this->get_plugin_list();
+    
+    switch ( true ): case true:
+    
+    // is the plugin in the directory and already installed?
+    if ( !isset($plugin_list[$filename]) || (
+        isset($plugin_list[$filename]) && !$plugin_list[$filename]['installed']
+      ))
+    {
+      $return = array(
+        'mode' => 'error',
+        'error' => 'Invalid plugin specified.',
+      );
+      break;
+    }
+    // get plugin data
+    $dataset =& $plugin_list[$filename];
+    
+    $result = $lang->import_plugin(ENANO_ROOT . '/plugins/' . $filename);
+    if ( $result )
+    {
+      return array(
+        'success' => true
+      );
+    }
+    else
+    {
+      return array(
+        'mode' => 'error',
+        'error' => 'Language API returned error'
+      );
+    }
+    
+    endswitch;
+  }
 }
 
 ?>
--- a/includes/sessions.php	Mon May 12 00:59:46 2008 -0400
+++ b/includes/sessions.php	Fri May 16 12:22:26 2008 -0400
@@ -1272,7 +1272,7 @@
                              . '    ON ( p.message_to=u.username AND p.message_read=0 )' . "\n"
                              . '  WHERE k.session_key=\''.$keyhash.'\'' . "\n"
                              . '    AND k.salt=\''.$salt.'\'' . "\n"
-                             . '  GROUP BY u.user_id,u.username,u.password,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,u.reg_time,u.account_active,u.activation_key,u.user_lang,u.user_timezone,k.source_ip,k.time,k.auth_level,x.user_id, x.user_aim, x.user_yahoo, x.user_msn, x.user_xmpp, x.user_homepage, x.user_location, x.user_job, x.user_hobbies, x.email_public;');
+                             . '  GROUP BY u.user_id,u.username,u.password,u.email,u.real_name,u.user_level,u.theme,u.style,u.signature,u.reg_time,u.account_active,u.activation_key,u.user_lang,u.user_timezone,k.source_ip,k.time,k.auth_level,x.user_id, x.user_aim, x.user_yahoo, x.user_msn, x.user_xmpp, x.user_homepage, x.user_location, x.user_job, x.user_hobbies, x.email_public, x.disable_js_fx;');
     
     if ( !$query )
     {
@@ -1343,7 +1343,7 @@
     }
     
     $user_extra = array();
-    foreach ( array('user_aim', 'user_yahoo', 'user_msn', 'user_xmpp', 'user_homepage', 'user_location', 'user_job', 'user_hobbies', 'email_public') as $column )
+    foreach ( array('user_aim', 'user_yahoo', 'user_msn', 'user_xmpp', 'user_homepage', 'user_location', 'user_job', 'user_hobbies', 'email_public', 'disable_js_fx') as $column )
     {
       if ( isset($row[$column]) )
         $user_extra[$column] = $row[$column];
--- a/includes/template.php	Mon May 12 00:59:46 2008 -0400
+++ b/includes/template.php	Fri May 16 12:22:26 2008 -0400
@@ -923,6 +923,7 @@
       var USER_LEVEL_CHPREF = ' . USER_LEVEL_CHPREF . ';
       var USER_LEVEL_MOD = ' . USER_LEVEL_MOD . ';
       var USER_LEVEL_ADMIN = ' . USER_LEVEL_ADMIN . ';
+      var pref_disable_js_fx = ' . ( @$session->user_extra['disable_js_fx'] == 1 ? '1' : '0' ) . ';
       var editNotice = \'' . ( (getConfig('wiki_edit_notice')=='1') ? str_replace("\n", "\\\n", RenderMan::render(getConfig('wiki_edit_notice_text'))) : '' ) . '\';
       var prot = ' . ( ($paths->page_protected && !$session->get_permissions('even_when_protected')) ? 'true' : 'false' ) .'; // No, hacking this var won\'t work, it\'s re-checked on the server
       var ENANO_SPECIAL_CREATEPAGE = \''. makeUrl($paths->nslist['Special'].'CreatePage') .'\';
--- a/install/schemas/mysql_stage2.sql	Mon May 12 00:59:46 2008 -0400
+++ b/install/schemas/mysql_stage2.sql	Fri May 16 12:22:26 2008 -0400
@@ -128,6 +128,7 @@
   user_job text,
   user_hobbies text,
   email_public tinyint(1) NOT NULL DEFAULT 0,
+  disable_js_fx tinyint(1) NOT NULL DEFAULT 0,
   PRIMARY KEY ( user_id ) 
 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
 
@@ -203,8 +204,9 @@
   group_id mediumint(5) UNSIGNED NOT NULL auto_increment,
   group_name varchar(64),
   group_type tinyint(1) NOT NULL DEFAULT 1,
-  PRIMARY KEY ( group_id ),
-  system_group tinyint(1) NOT NULL DEFAULT 0 
+  system_group tinyint(1) NOT NULL DEFAULT 0,
+  group_rank int(12) unsigned DEFAULT NULL,
+  PRIMARY KEY ( group_id )
 ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
 
 CREATE TABLE {{TABLE_PREFIX}}group_members(
--- a/install/schemas/postgresql_stage2.sql	Mon May 12 00:59:46 2008 -0400
+++ b/install/schemas/postgresql_stage2.sql	Fri May 16 12:22:26 2008 -0400
@@ -129,6 +129,7 @@
   user_job text,
   user_hobbies text,
   email_public smallint NOT NULL DEFAULT 0,
+  disable_js_fx smallint NOT NULL DEFAULT 0,
   PRIMARY KEY ( user_id ) 
 );
 
@@ -204,8 +205,9 @@
   group_id SERIAL,
   group_name varchar(64),
   group_type smallint NOT NULL DEFAULT 1,
-  PRIMARY KEY ( group_id ),
-  system_group smallint NOT NULL DEFAULT 0 
+  system_group smallint NOT NULL DEFAULT 0,
+  group_rank int DEFAULT NULL,
+  PRIMARY KEY ( group_id )
 );
 
 CREATE TABLE {{TABLE_PREFIX}}group_members(
--- a/install/schemas/upgrade/1.1.3-1.1.4-mysql.sql	Mon May 12 00:59:46 2008 -0400
+++ b/install/schemas/upgrade/1.1.3-1.1.4-mysql.sql	Fri May 16 12:22:26 2008 -0400
@@ -21,3 +21,9 @@
 DELETE FROM {{TABLE_PREFIX}}ranks WHERE rank_id = 4;
 INSERT INTO {{TABLE_PREFIX}}ranks(rank_id, rank_title, rank_style) VALUES
   (4, 'user_rank_guest', '');
+  
+-- Other rank-related columns
+ALTER TABLE {{TABLE_PREFIX}}groups ADD COLUMN group_rank int(12) unsigned DEFAULT NULL;
+
+-- Disable JS effects column
+ALTER TABLE {{TABLE_PREFIX}}users_extra ADD COLUMN disable_js_fx tinyint(1) NOT NULL DEFAULT 0;
--- a/install/schemas/upgrade/1.1.3-1.1.4-postgresql.sql	Mon May 12 00:59:46 2008 -0400
+++ b/install/schemas/upgrade/1.1.3-1.1.4-postgresql.sql	Fri May 16 12:22:26 2008 -0400
@@ -34,3 +34,9 @@
 INSERT INTO {{TABLE_PREFIX}}ranks(rank_id, rank_title, rank_style) VALUES
   (4, 'user_rank_guest', '');
 
+-- Other rank-related columns
+ALTER TABLE {{TABLE_PREFIX}}groups ADD COLUMN group_rank int DEFAULT NULL;
+
+-- Disable JS effects column
+ALTER TABLE {{TABLE_PREFIX}}users_extra ADD COLUMN disable_js_fx smallint NOT NULL DEFAULT 0;
+
--- a/language/english/admin.json	Mon May 12 00:59:46 2008 -0400
+++ b/language/english/admin.json	Fri May 16 12:22:26 2008 -0400
@@ -406,6 +406,7 @@
       btn_enable: 'Enable',
       btn_upgrade: 'Upgrade',
       btn_uninstall: 'Uninstall',
+      btn_reimport: 'Re-import strings',
       
       msg_confirm_uninstall: 'Uninstalling this plugin may cause the loss of data that was created with it. You should only uninstall a plugin if you are certain you\'ll have no further use for it; in fact, you don\'t even need to uninstall a plugin if you\'re deleting it from the filesystem.',
       msg_confirm_install: 'Plugins are not supported by the Enano project and could harm your site if malicious. You should only install plugins from sources that you trust.',
--- a/language/english/user.json	Mon May 12 00:59:46 2008 -0400
+++ b/language/english/user.json	Fri May 16 12:22:26 2008 -0400
@@ -308,6 +308,8 @@
       publicinfo_field_hobbies: 'Your hobbies:',
       publicinfo_field_email_public: 'E-mail address is public',
       publicinfo_field_email_public_hint: 'If this is checked, your e-mail address will be displayed on your user page. To protect your address from spambots, your e-mail address will be encrypted.',
+      publicinfo_field_jsfx: 'Disable animation effects on pages',
+      publicinfo_field_jsfx_hint: 'If you aren\'t big on eye candy, this can speed up applets like the ACL manager and confirmation dialogs.',
       publicinfo_btn_save: 'Save profile',
       
       // Avatar management
--- a/plugins/SpecialAdmin.php	Mon May 12 00:59:46 2008 -0400
+++ b/plugins/SpecialAdmin.php	Fri May 16 12:22:26 2008 -0400
@@ -48,6 +48,7 @@
 require(ENANO_ROOT . '/plugins/admin/GroupManager.php');
 require(ENANO_ROOT . '/plugins/admin/SecurityLog.php');
 require(ENANO_ROOT . '/plugins/admin/UserManager.php');
+require(ENANO_ROOT . '/plugins/admin/UserRanks.php');
 require(ENANO_ROOT . '/plugins/admin/LangManager.php');
 require(ENANO_ROOT . '/plugins/admin/ThemeManager.php');
 require(ENANO_ROOT . '/plugins/admin/PluginManager.php');
--- a/plugins/SpecialUserFuncs.php	Mon May 12 00:59:46 2008 -0400
+++ b/plugins/SpecialUserFuncs.php	Fri May 16 12:22:26 2008 -0400
@@ -2037,6 +2037,8 @@
   var enano_lang = new Object();
 
 enano_lang[{$lang->lang_id}] = " . $lang_strings . ";";
+
+  gzip_output();
   
   exit(0);
 }
--- a/plugins/SpecialUserPrefs.php	Mon May 12 00:59:46 2008 -0400
+++ b/plugins/SpecialUserPrefs.php	Fri May 16 12:22:26 2008 -0400
@@ -514,6 +514,7 @@
         $hobbies = $db->escape($hobbies);
         
         $email_public = ( isset($_POST['email_public']) ) ? '1' : '0';
+        $disable_js_fx = ( isset($_POST['disable_js_fx']) ) ? '1' : '0';
         
         $session->real_name = $real_name;
         
@@ -566,7 +567,7 @@
         
         $q = $db->sql_query('UPDATE '.table_prefix."users_extra SET user_aim='$imaddr_aim',user_yahoo='$imaddr_yahoo',user_msn='$imaddr_msn',
                                user_xmpp='$imaddr_xmpp',user_homepage='$homepage',user_location='$location',user_job='$occupation',
-                               user_hobbies='$hobbies',email_public=$email_public
+                               user_hobbies='$hobbies',email_public=$email_public,disable_js_fx=$disable_js_fx
                                WHERE user_id=$session->user_id;");
         
         if ( !$q )
@@ -725,6 +726,10 @@
             <td class="row1" style="width: 50%;"><input type="checkbox" id="chk_email_public" name="email_public" <?php if ($session->user_extra['email_public'] == 1) echo 'checked="checked"'; ?> size="30" /></td>
           </tr>
           <tr>
+            <td class="row2" style="width: 50%;"><label for="chk_jsfx"><?php echo $lang->get('usercp_publicinfo_field_jsfx'); ?></label><br /><small><?php echo $lang->get('usercp_publicinfo_field_jsfx_hint'); ?></small></td>
+            <td class="row1" style="width: 50%;"><input type="checkbox" id="chk_jsfx" name="disable_js_fx" <?php if ($session->user_extra['disable_js_fx'] == 1) echo 'checked="checked"'; ?> size="30" /></td>
+          </tr>
+          <tr>
             <th class="subhead" colspan="2">
               <input type="submit" name="submit" value="<?php echo $lang->get('usercp_publicinfo_btn_save'); ?>" />
             </th>
--- a/plugins/admin/PluginManager.php	Mon May 12 00:59:46 2008 -0400
+++ b/plugins/admin/PluginManager.php	Fri May 16 12:22:26 2008 -0400
@@ -167,6 +167,19 @@
               
               $return = $plugins->upgrade_plugin($request['plugin'], $plugin_list);
               break;
+            case 'reimport':
+              // did they specify a plugin to operate on?
+              if ( !isset($request['plugin']) )
+              {
+                $return = array(
+                  'mode' => 'error',
+                  'error' => 'No plugin specified.',
+                );
+                break;
+              }
+              
+              $return = $plugins->reimport_plugin_strings($request['plugin'], $plugin_list);
+              break;
             case 'uninstall':
               // did they specify a plugin to operate on?
               if ( !isset($request['plugin']) )
@@ -340,7 +353,7 @@
           // this plugin is all good
           $color = '_green';
           $status = $lang->get('acppl_lbl_status_installed');
-          $buttons = 'uninstall|disable';
+          $buttons = 'reimport|uninstall|disable';
         }
         else if ( $data['installed'] && $data['status'] & PLUGIN_OUTOFDATE )
         {
@@ -397,7 +410,8 @@
               'disable' => 'blue',
               'enable' => 'blue',
               'upgrade' => 'green',
-              'uninstall' => 'red'
+              'uninstall' => 'red',
+              'reimport' => 'green'
             );
           foreach ( $buttons as $button )
           {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/admin/UserRanks.php	Fri May 16 12:22:26 2008 -0400
@@ -0,0 +1,30 @@
+<?php
+
+/*
+ * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
+ * Version 1.1.4 (Caoineag alpha 4)
+ * Copyright (C) 2006-2008 Dan Fuhry
+ *
+ * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
+ */
+
+function page_Admin_UserRanks()
+{
+  global $db, $session, $paths, $template, $plugins; // Common objects
+  global $lang;
+  if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
+  {
+    $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
+    echo '<h3>' . $lang->get('adm_err_not_auth_title') . '</h3>';
+    echo '<p>' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
+    return;
+  }
+  
+  echo 'Hello world!';
+}
+
+?>