[geeklog-hg] geeklog: Split up the submissions page and added the Command & C...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Tue Jun 25 14:03:08 EDT 2013


changeset 9127:9ff105efd6ee
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/9ff105efd6ee
user: Tom <websitemaster at cogeco.net>
date: Tue Jun 25 13:59:21 2013 -0400
description:
Split up the submissions page and added the Command & Control page as the Admin Home. Command and Control icons are now grouped - Core, Plugins, Tools, and Users. (feature request #0001627)

diffstat:

 language/english.php                                                          |   10 +-
 language/english_utf-8.php                                                    |   10 +-
 plugins/spamx/autoinstall.php                                                 |    4 +-
 plugins/spamx/functions.inc                                                   |    2 +-
 public_html/admin/clearctl.php                                                |    2 +-
 public_html/admin/index.php                                                   |  284 +++++++++-
 public_html/admin/moderation.php                                              |  225 +------
 public_html/docs/english/config.html                                          |    3 +-
 public_html/layout/denim/admin/commandcontrol/commandcontrol.thtml            |   19 +
 public_html/layout/denim/admin/moderation/ccitem.thtml                        |    1 -
 public_html/layout/denim/admin/moderation/ccrow.thtml                         |    1 -
 public_html/layout/denim/admin/moderation/moderation.thtml                    |    7 -
 public_html/layout/denim/css_ltr/ie6.css                                      |   14 +-
 public_html/layout/denim/css_ltr/ie7.css                                      |   14 +-
 public_html/layout/denim/css_ltr/style.css                                    |   14 +-
 public_html/layout/denim/css_rtl/ie6.css                                      |   14 +-
 public_html/layout/denim/css_rtl/ie7.css                                      |   14 +-
 public_html/layout/denim/css_rtl/style.css                                    |   14 +-
 public_html/layout/denim/images/icons/log_viewer.png                          |  Bin 
 public_html/layout/denim/images/icons/moderation.png                          |  Bin 
 public_html/layout/denim/javascript/iepngfix.js                               |    2 +-
 public_html/layout/modern_curve/admin/commandcontrol/commandcontrol.thtml     |   19 +
 public_html/layout/modern_curve/admin/moderation/ccitem.thtml                 |    5 -
 public_html/layout/modern_curve/admin/moderation/ccrow.thtml                  |    5 -
 public_html/layout/modern_curve/admin/moderation/moderation.thtml             |    7 -
 public_html/layout/modern_curve/css/admin/commandcontrol.css                  |   49 +
 public_html/layout/modern_curve/css/admin/moderation.css                      |   50 -
 public_html/layout/modern_curve/images/icons/log_viewer.png                   |  Bin 
 public_html/layout/modern_curve/images/icons/moderation.png                   |  Bin 
 public_html/layout/modern_curve/style.css.php                                 |    2 +-
 public_html/layout/professional/admin/commandcontrol/commandcontrol.thtml     |   25 +
 public_html/layout/professional/admin/moderation/ccitem.thtml                 |    5 -
 public_html/layout/professional/admin/moderation/ccrow.thtml                  |    3 -
 public_html/layout/professional/admin/moderation/moderation.thtml             |    3 -
 public_html/layout/professional/images/icons/log_viewer.png                   |  Bin 
 public_html/layout/professional/images/icons/moderation.png                   |  Bin 
 public_html/layout/professional_css/admin/commandcontrol/commandcontrol.thtml |   19 +
 public_html/layout/professional_css/admin/moderation/ccitem.thtml             |    6 -
 public_html/layout/professional_css/admin/moderation/ccrow.thtml              |    6 -
 public_html/layout/professional_css/admin/moderation/moderation.thtml         |    8 -
 public_html/layout/professional_css/css/admin.css                             |   22 +-
 public_html/layout/professional_css/css/admin/commandcontrol.css              |   51 +
 public_html/layout/professional_css/css/admin/moderation.css                  |   52 -
 public_html/layout/professional_css/images/icons/log_viewer.png               |  Bin 
 public_html/layout/professional_css/images/icons/moderation.png               |  Bin 
 public_html/lib-common.php                                                    |   18 +-
 system/lib-plugins.php                                                        |    4 +-
 system/lib-security.php                                                       |   41 +-
 48 files changed, 629 insertions(+), 425 deletions(-)

diffs (truncated from 1670 to 300 lines):

diff -r 790c64a078d1 -r 9ff105efd6ee language/english.php
--- a/language/english.php	Sun Jun 23 09:53:07 2013 -0400
+++ b/language/english.php	Tue Jun 25 13:59:21 2013 -0400
@@ -55,7 +55,7 @@
     11 => 'Stories',
     12 => 'Blocks',
     13 => 'Topics',
-    14 => '',
+    14 => 'Command & Control',
     15 => '',
     16 => '',
     17 => 'Users',
@@ -1036,6 +1036,7 @@
 
 ###############################################################################
 # admin/moderation.php
+# admin/index.php
 
 $LANG29 = array(
     1 => 'Approve',
@@ -1060,7 +1061,12 @@
     40 => 'User Submissions',
     41 => 'Comment Submissions',
     42 => 'Username',
-    43 => 'Auto-publish Comments?'
+    43 => 'Auto-publish Comments?',
+    'core' => 'Core',
+    'plugins' => 'Plugins',
+    'tools' => 'Tools',
+    'users' => 'Users',
+    'submissions_desc' => "To modify or delete a user submssion, click on that item's edit icon below. To approve and delete multiple submissions use the radio options in the lists and then click submit."
 );
 
 ###############################################################################
diff -r 790c64a078d1 -r 9ff105efd6ee language/english_utf-8.php
--- a/language/english_utf-8.php	Sun Jun 23 09:53:07 2013 -0400
+++ b/language/english_utf-8.php	Tue Jun 25 13:59:21 2013 -0400
@@ -55,7 +55,7 @@
     11 => 'Stories',
     12 => 'Blocks',
     13 => 'Topics',
-    14 => '',
+    14 => 'Command & Control',
     15 => '',
     16 => '',
     17 => 'Users',
@@ -1036,6 +1036,7 @@
 
 ###############################################################################
 # admin/moderation.php
+# admin/index.php
 
 $LANG29 = array(
     1 => 'Approve',
@@ -1060,7 +1061,12 @@
     40 => 'User Submissions',
     41 => 'Comment Submissions',
     42 => 'Username',
-    43 => 'Auto-publish Comments?'
+    43 => 'Auto-publish Comments?',
+    'core' => 'Core',
+    'plugins' => 'Plugins',
+    'tools' => 'Tools',
+    'users' => 'Users',    
+    'submissions_desc' => "To modify or delete a user submssion, click on that item's edit icon below. To approve and delete multiple submissions use the radio options in the lists and then click submit." 
 );
 
 ###############################################################################
diff -r 790c64a078d1 -r 9ff105efd6ee plugins/spamx/autoinstall.php
--- a/plugins/spamx/autoinstall.php	Sun Jun 23 09:53:07 2013 -0400
+++ b/plugins/spamx/autoinstall.php	Tue Jun 25 13:59:21 2013 -0400
@@ -51,8 +51,8 @@
     $info = array(
         'pi_name'         => $pi_name,
         'pi_display_name' => $pi_display_name,
-        'pi_version'      => '1.3.0',
-        'pi_gl_version'   => '1.8.0',
+        'pi_version'      => '1.3.1',
+        'pi_gl_version'   => '2.0.1',
         'pi_homepage'     => 'http://www.geeklog.net/'
     );
 
diff -r 790c64a078d1 -r 9ff105efd6ee plugins/spamx/functions.inc
--- a/plugins/spamx/functions.inc	Sun Jun 23 09:53:07 2013 -0400
+++ b/plugins/spamx/functions.inc	Tue Jun 25 13:59:21 2013 -0400
@@ -121,7 +121,7 @@
     if (SEC_hasRights('spamx.admin')) {
         $retval = array($LANG_SX00['plugin_name'],
             $_CONF['site_admin_url'] . '/plugins/spamx/index.php',
-            plugin_geticon_spamx ());
+            plugin_geticon_spamx (), 'tools');
     }
 
     return $retval;
diff -r 790c64a078d1 -r 9ff105efd6ee public_html/admin/clearctl.php
--- a/public_html/admin/clearctl.php	Sun Jun 23 09:53:07 2013 -0400
+++ b/public_html/admin/clearctl.php	Tue Jun 25 13:59:21 2013 -0400
@@ -45,5 +45,5 @@
 
 CTL_clearCache();
 
-echo COM_refresh($_CONF['site_admin_url'] . '/moderation.php?msg=500');
+echo COM_refresh($_CONF['site_admin_url'] . '/index.php?msg=500');
 ?>
\ No newline at end of file
diff -r 790c64a078d1 -r 9ff105efd6ee public_html/admin/index.php
--- a/public_html/admin/index.php	Sun Jun 23 09:53:07 2013 -0400
+++ b/public_html/admin/index.php	Tue Jun 25 13:59:21 2013 -0400
@@ -26,10 +26,292 @@
 
 require_once('../lib-common.php');
 
+
 // MAIN
 if (isset ($_GET['mode']) && ($_GET['mode'] == 'logout')) {
     print COM_refresh($_CONF['site_url'] . '/users.php?mode=logout');
 }
-print COM_refresh($_CONF['site_admin_url'] . '/moderation.php');
+
+// Uncomment the line below if you need to debug the HTTP variables being passed
+// to the script.  This will sometimes cause errors but it will allow you to see
+// the data being passed in a POST operation
+// echo COM_debug($_POST);
+
+// this defines the amount of icons displayed next to another in the CC-block
+define ('ICONS_PER_ROW', 6);
+
+/**
+* Display a reminder to execute the security check script
+*
+* @return   string      HTML for security reminder (or empty string)
+*/
+function security_check_reminder()
+{
+    global $_CONF, $_TABLES, $_IMAGE_TYPE, $MESSAGE;
+
+    $retval = '';
+
+    if (!SEC_inGroup ('Root')) {
+        return $retval;
+    }
+
+    $done = DB_getItem ($_TABLES['vars'], 'value', "name = 'security_check'");
+    if ($done != 1) {
+        $retval .= COM_showMessage(92);
+    }
+
+    return $retval;
+}
+
+/**
+* Renders an entry (icon) for the "Command and Control" center
+*
+* @param    template    $template   template to use
+* @param    string      $url        URL the entry links to
+* @param    string      $image      URL of the icon
+* @param    string      $label      text to use under the icon
+* @return   string                  HTML for rendered item
+*
+*/
+function render_cc_item(&$template, $url = '', $image = '', $label = '')
+{
+    if (! empty($url)) {
+        $template->set_var('page_url', $url);
+        $template->set_var('page_image', $image);
+        $template->set_var('option_label', $label);
+        $template->set_var('cell_width', ((int)(100 / ICONS_PER_ROW)) . '%');
+
+        return $template->parse('cc_main_options', 'ccitem', false);
+    }
+
+    return '';
+}
+
+/**
+* Prints the command & control block at the top
+*
+* @param    string  $token  CSRF token
+* @return   string          HTML for the C&C block
+*
+*/
+function commandcontrol($token)
+{
+    global $_CONF, $_CONF_FT, $_TABLES, $LANG01, $LANG29, $LANG_LOGVIEW, $_IMAGE_TYPE, $_DB_dbms;
+
+    $retval = '';
+
+    $admin_templates = COM_newTemplate($_CONF['path_layout'] . 'admin/commandcontrol');
+    $admin_templates->set_file (array ('cc'     => 'commandcontrol.thtml'));
+    $blocks = array('ccgroup', 'ccrow', 'ccitem');
+    foreach ($blocks as $block) {
+        $admin_templates->set_block('cc', $block);
+    }       
+
+    $retval .= COM_startBlock ('Geeklog ' . VERSION . ' -- ' . $LANG29[34], '',
+                               COM_getBlockTemplate ('_admin_block', 'header'));
+    
+    
+    // Get any plugin items
+    $plugins = PLG_getCCOptions ();
+    $cc_core = array();
+    $cc_plugins = array();
+    $cc_tools = array();
+    $cc_users = array();
+    for ($i = 0; $i < count ($plugins); $i++) {
+        $cur_plugin = current ($plugins);
+
+        $item = array('condition' => SEC_hasRights('story.edit'),
+                        'url' => $cur_plugin->adminurl,
+                        'lang' => $cur_plugin->adminlabel, 'image' => $cur_plugin->plugin_image);        
+        
+        switch ($cur_plugin->admingroup) {
+            case 'core':
+                $cc_core[] = $item;
+                break;
+                
+            case 'tools':
+                $cc_tools[] = $item;
+                break;
+
+            case 'users':
+                $cc_users[] = $item;
+                break;                
+                
+            default:
+                $cc_plugins[] = $item;
+                break;
+        }
+        next ($plugins);
+    }
+    
+    // Command & Control Group Layout
+    $ccgroups = array('core', 'plugins', 'tools', 'users');
+    foreach ($ccgroups as $ccgroup) {
+        // Clear a few things before starting group
+        $admin_templates->clear_var ('cc_rows');
+        $cc_arr = array();
+        $items = array();
+        
+        $admin_templates->set_var('lang_group', $LANG29[$ccgroup]);
+        $admin_templates->set_var('cc_icon_width', floor(100/ICONS_PER_ROW));
+
+        switch ($ccgroup) {
+            // Core - Blocks, Content Syndication, Stories, Topics, Submissions, Trackbacks
+            case 'core':
+                $showTrackbackIcon = (($_CONF['trackback_enabled'] ||
+                                      $_CONF['pingback_enabled'] || $_CONF['ping_enabled'])
+                                     && SEC_hasRights('story.ping'));
+                
+                $cc_arr = array(
+                    array('condition' => SEC_hasRights('topic.edit'),
+                        'url' => $_CONF['site_admin_url'] . '/topic.php',
+                        'lang' => $LANG01[13], 'image' => $_CONF['layout_url'] . '/images/icons/topic.' . $_IMAGE_TYPE),
+                    array('condition' => SEC_hasRights('block.edit'),
+                        'url' => $_CONF['site_admin_url'] . '/block.php',
+                        'lang' => $LANG01[12], 'image' => $_CONF['layout_url'] . '/images/icons/block.' . $_IMAGE_TYPE),
+                    array('condition' => SEC_hasRights('story.edit'),
+                        'url' => $_CONF['site_admin_url'] . '/story.php',
+                        'lang' => $LANG01[11], 'image' =>  $_CONF['layout_url'] . '/images/icons/story.' . $_IMAGE_TYPE),
+                    array('condition' => SEC_hasModerationAccess(),
+                        'url' => $_CONF['site_admin_url'] . '/moderation.php',
+                        'lang' => $LANG01[10], 'image' =>  $_CONF['layout_url'] . '/images/icons/moderation.' . $_IMAGE_TYPE),
+                    array('condition' => SEC_hasRights ('syndication.edit'),
+                        'url' => $_CONF['site_admin_url'] . '/syndication.php',
+                        'lang' => $LANG01[38], 'image' => $_CONF['layout_url'] . '/images/icons/syndication.' . $_IMAGE_TYPE),
+                    array('condition' => $showTrackbackIcon,
+                        'url' => $_CONF['site_admin_url'] . '/trackback.php',
+                        'lang' => $LANG01[116], 'image' => $_CONF['layout_url'] . '/images/icons/trackback.' . $_IMAGE_TYPE),
+                );
+
+                // Merge any items that belong to this group from plugins
+                $cc_arr = array_merge($cc_arr, $cc_core);
+                break;
+                
+            // Plugins - All ungrouped plugins
+            case 'plugins':
+                $cc_arr = $cc_plugins;
+                break;
+            
+            // Tools - Db backups, Clear cache, Log Viewer, GL Version Test, Plugins, Configuration, Documentation, SPAM-X Plugin                
+            case 'tools':
+                $docsUrl = $_CONF['site_url'] . '/docs/english/index.html';
+                if ($_CONF['link_documentation'] == 1) {
+                    $doclang = COM_getLanguageName();
+                    $docs = 'docs/' . $doclang . '/index.html';
+                    if (file_exists($_CONF['path_html'] . $docs)) {
+                        $docsUrl = $_CONF['site_url'] . '/' . $docs;
+                    }
+                }
+                $showClearCacheIcon = ($_CONF['cache_templates'] && SEC_inGroup('Root'));
+                
+                $cc_arr = array(
+                    array('condition' => SEC_hasRights($_CONF_FT, 'OR'),
+                        'url'=>$_CONF['site_admin_url'] . '/configuration.php',
+                        'lang' => $LANG01[129], 'image' => $_CONF['layout_url'] . '/images/icons/configuration.' . $_IMAGE_TYPE),
+                    array('condition' => ($_CONF['link_documentation'] == 1),
+                        'url' => $docsUrl,
+                        'lang' => $LANG01[113], 'image' => $_CONF['layout_url'] . '/images/icons/docs.' . $_IMAGE_TYPE),
+                    array('condition' => (SEC_inGroup ('Root') &&
+                                          ($_CONF['link_versionchecker'] == 1)),



More information about the geeklog-cvs mailing list