[geeklog-cvs] geeklog: Source code cosmetics

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Feb 21 14:53:37 EST 2010


changeset 7749:2aebb10845a7
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/2aebb10845a7
user: Dirk Haun <dirk at haun-online.de>
date: Sun Feb 21 11:24:07 2010 +0100
description:
Source code cosmetics

diffstat:

 public_html/admin/moderation.php |  61 ++++++++++++++----------------
 1 files changed, 29 insertions(+), 32 deletions(-)

diffs (118 lines):

diff -r 63ffcd1093eb -r 2aebb10845a7 public_html/admin/moderation.php
--- a/public_html/admin/moderation.php	Sun Feb 21 10:50:10 2010 +0100
+++ b/public_html/admin/moderation.php	Sun Feb 21 11:24:07 2010 +0100
@@ -53,18 +53,18 @@
 * @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   void
+* @return   string                  HTML for rendered item
 *
 */
-function render_cc_item (&$template, $url = '', $image = '', $label = '')
+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)) . '%');
+    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 $template->parse('cc_main_options', 'ccitem', false);
     }
 
     return '';
@@ -75,8 +75,6 @@
 *
 * @param    string  $token  CSRF token
 * @return   string          HTML for the C&C block
-* @todo The moderation items should be displayed with the help of ul/li
-* instead of div's. 
 *
 */
 function commandcontrol($token)
@@ -268,7 +266,7 @@
 
     if (empty($type)) {
         // something is terribly wrong, bail
-        $retval .= COM_errorLog("Submission type not set in moderation.php");
+        COM_errorLog("Submission type not set in moderation.php");
         return $retval;
     }
 
@@ -369,9 +367,8 @@
     }
 
     $listoptions = array('chkdelete' => true, 'chkfield' => 'id');
-    $table = ADMIN_simpleList('ADMIN_getListField_moderation', $header_arr,
-                              $text_arr, $data_arr, $listoptions, $form_arr);
-    $retval .= $table;
+    $retval .= ADMIN_simpleList('ADMIN_getListField_moderation', $header_arr,
+                                $text_arr, $data_arr, $listoptions, $form_arr);
 
     return $retval;
 }
@@ -512,7 +509,7 @@
                 $T = DB_fetchArray ($result);
                 if ($T['archive_flag'] == 1) {
                     $frontpage = 0;
-                } else if (isset ($_CONF['frontpage'])) {
+                } elseif (isset ($_CONF['frontpage'])) {
                     $frontpage = $_CONF['frontpage'];
                 } else {
                     $frontpage = 1;
@@ -615,23 +612,23 @@
         }
 
         switch ($action[$i]) {
-            case 'delete': // Ok, delete everything related to this user
-                if ($uid[$i] > 1) {
-                    USER_deleteAccount ($uid[$i]);
-                }
-                break;
+        case 'delete': // Ok, delete everything related to this user
+            if ($uid[$i] > 1) {
+                USER_deleteAccount($uid[$i]);
+            }
+            break;
 
-            case 'approve':
-                $uid[$i] = COM_applyFilter($uid[$i], true);
-                $result = DB_query ("SELECT email,username, uid FROM {$_TABLES['users']} WHERE uid = $uid[$i]");
-                $nrows = DB_numRows($result);
-                if ($nrows == 1) {
-                    $A = DB_fetchArray($result);
-                    $sql = "UPDATE {$_TABLES['users']} SET status=3 WHERE uid={$A['uid']}";
-                    DB_query($sql);
-                    USER_createAndSendPassword ($A['username'], $A['email'], $A['uid']);
-                }
-                break;
+        case 'approve':
+            $uid[$i] = COM_applyFilter($uid[$i], true);
+            $result = DB_query("SELECT email,username, uid FROM {$_TABLES['users']} WHERE uid = $uid[$i]");
+            $nrows = DB_numRows($result);
+            if ($nrows == 1) {
+                $A = DB_fetchArray($result);
+                $sql = "UPDATE {$_TABLES['users']} SET status=3 WHERE uid={$A['uid']}";
+                DB_query($sql);
+                USER_createAndSendPassword($A['username'], $A['email'], $A['uid']);
+            }
+            break;
         }
     }
 
@@ -641,7 +638,7 @@
         foreach ($_POST['delitem'] as $del_uid) {
             $del_uid = COM_applyFilter($del_uid,true);
             if ($del_uid > 1) {
-                USER_deleteAccount ($del_uid);
+                USER_deleteAccount($del_uid);
             }
         }
     }



More information about the geeklog-cvs mailing list