[geeklog-cvs] geeklog: Added an icon to make the plugin update option somewhat...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Oct 29 11:54:13 EDT 2009


changeset 7394:fdb273c78589
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/fdb273c78589
user: Dirk Haun <dirk at haun-online.de>
date: Mon Sep 28 22:20:30 2009 +0200
description:
Added an icon to make the plugin update option somewhat more obvious

diffstat:

 language/english.php                              |   1 +
 language/english_utf-8.php                        |   1 +
 public_html/admin/plugins.php                     |  26 ++++++++++++++++----------
 public_html/docs/english/theme.html               |   3 +++
 public_html/docs/history                          |   3 +++
 public_html/layout/professional/images/update.png |     
 system/lib-admin.php                              |  12 +++++++++++-
 7 files changed, 35 insertions(+), 11 deletions(-)

diffs (109 lines):

diff -r db4c6eb6e843 -r fdb273c78589 language/english.php
--- a/language/english.php	Sun Sep 27 21:26:06 2009 +0200
+++ b/language/english.php	Mon Sep 28 22:20:30 2009 +0200
@@ -1065,6 +1065,7 @@
     39 => 'Upload a plugin',
     40 => 'You can upload a plugin archive (.tar.gz, .tgz, .zip) directly here:',
     41 => 'Upload',
+    42 => 'Click to update',
 
     // to match the PHP error constants,
     // http://www.php.net/manual/en/features.file-upload.errors.php
diff -r db4c6eb6e843 -r fdb273c78589 language/english_utf-8.php
--- a/language/english_utf-8.php	Sun Sep 27 21:26:06 2009 +0200
+++ b/language/english_utf-8.php	Mon Sep 28 22:20:30 2009 +0200
@@ -1065,6 +1065,7 @@
     39 => 'Upload a plugin',
     40 => 'You can upload a plugin archive (.tar.gz, .tgz, .zip) directly here:',
     41 => 'Upload',
+    42 => 'Click to update',
 
     // to match the PHP error constants,
     // http://www.php.net/manual/en/features.file-upload.errors.php
diff -r db4c6eb6e843 -r fdb273c78589 public_html/admin/plugins.php
--- a/public_html/admin/plugins.php	Sun Sep 27 21:26:06 2009 +0200
+++ b/public_html/admin/plugins.php	Mon Sep 28 22:20:30 2009 +0200
@@ -1165,17 +1165,23 @@
 
 // MAIN
 $display = '';
-if (isset($_POST['pluginenabler']) && SEC_checkToken()) {
-    if (isset($_POST['enabledplugins'])) {
-        changePluginStatus($_POST['enabledplugins']);
-    } else {
-        changePluginStatus(array());
+if (isset($_POST['pluginenabler'])) { // JavaScript-triggered POST request
+    if (isset($_POST['updatethisplugin'])) {
+        // translate into a standard update request (see below)
+        $_POST['mode'] = $LANG32[34];
+        $_POST['pi_name'] = $_POST['updatethisplugin'];
+    } elseif (SEC_checkToken()) {
+        if (isset($_POST['enabledplugins'])) {
+            changePluginStatus($_POST['enabledplugins']);
+        } else {
+            changePluginStatus(array());
+        }
+
+        // force a refresh so that the information of the plugin that was just
+        // enabled / disabled (menu entries, etc.) is displayed properly
+        header('Location: ' . $_CONF['site_admin_url'] . '/plugins.php');
+        exit;
     }
-
-    // force a refresh so that the information of the plugin that was just
-    // enabled / disabled (menu entries, etc.) is displayed properly
-    header('Location: ' . $_CONF['site_admin_url'] . '/plugins.php');
-    exit;
 }
 
 $mode = '';
diff -r db4c6eb6e843 -r fdb273c78589 public_html/docs/english/theme.html
--- a/public_html/docs/english/theme.html	Sun Sep 27 21:26:06 2009 +0200
+++ b/public_html/docs/english/theme.html	Mon Sep 28 22:20:30 2009 +0200
@@ -198,6 +198,9 @@
 <h2><a name="changes">Theme changes in Geeklog 1.6.1</a></h2>
 
 <ul>
+<li>Added an icon, <tt>images/update.png</tt>, to be displayed in the admin's
+    list of plugins when a plugin needs to be updated. The icon should have the
+    same size as the "edit" icon (16x16 pixel in the Professional theme).</li>
 <li>Cosmetics: Fixed the position of the story preview when using the
     advanced editor (was slightly shifted to the right, <a
     href="http://project.geeklog.net/tracking/view.php?id=963">bug #0000963</a>). Changes to the <code><div id="preview"></code> in
diff -r db4c6eb6e843 -r fdb273c78589 public_html/docs/history
--- a/public_html/docs/history	Sun Sep 27 21:26:06 2009 +0200
+++ b/public_html/docs/history	Mon Sep 28 22:20:30 2009 +0200
@@ -3,6 +3,9 @@
 Oct ??, 2009 (1.6.1)
 ------------
 
+- Added an icon to make the plugin update option somewhat more obvious [Dirk]
+  (icon "stock_update-data.png" taken from Gnome 2.18 icon theme set by
+  AMAZIGH Aneglus, released under the GPL)
 - Changing the Post Mode in Advanced Editor mode selected the wrong tab
   (bug #0000980, patch provided by dengen)
 - Made the former $cc parameter for COM_mail an optional array of additional
diff -r db4c6eb6e843 -r fdb273c78589 public_html/layout/professional/images/update.png
Binary file public_html/layout/professional/images/update.png has changed
diff -r db4c6eb6e843 -r fdb273c78589 system/lib-admin.php
--- a/system/lib-admin.php	Sun Sep 27 21:26:06 2009 +0200
+++ b/system/lib-admin.php	Mon Sep 28 22:20:30 2009 +0200
@@ -1064,7 +1064,17 @@
             } else {
                 $retval = "{$LANG32[37]}: $pi_installed_version, {$LANG32[36]}: $plugin_code_version";
                 if ($A['pi_enabled'] == 1) {
-                    $retval .= " <b>{$LANG32[38]}</b>";
+                    $retval .= " <b>{$LANG32[38]}</b>"
+                        . ' <input type="image" src="' . $_CONF['layout_url']
+                        . '/images/update.png" alt="[' . $LANG32[38]
+                        . ']" name="updatethisplugin" value="' . $A['pi_name']
+                        . '" onclick="submit()" title="' . $LANG32[42] . '"'
+                        . XHTML . '>';
+                    if (! isset($added_token)) {
+                        $retval .= '<input type="hidden" name="' . CSRF_TOKEN
+                                . '" ' . 'value="' . $token . '"' . XHTML . '>';
+                        $added_token = true;
+                    }
                 }
             }
             break;



More information about the geeklog-cvs mailing list