More use of EL, fix for admin links
authorRoland Häder <roland@mxchange.org>
Mon, 28 Jun 2010 05:39:36 +0000 (05:39 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 28 Jun 2010 05:39:36 +0000 (05:39 +0000)
inc/functions.php
inc/modules/admin/what-list_cats.php
inc/modules/admin/what-list_user.php
templates/de/html/admin/admin_list_cats.tpl
templates/de/html/admin/admin_list_cats_404.tpl
templates/de/html/admin/admin_list_cats_row.tpl
templates/de/html/admin/admin_list_user_row.tpl
templates/de/html/admin/admin_user_details.tpl

index f9a51c0..3ce992e 100644 (file)
@@ -178,7 +178,7 @@ function doFinalCompilation ($code, $insertComments = true) {
        $cnt = 0;
 
        // Compile all out
-       while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 3)) {
+       while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 4)) {
                // Init common variables
                $content = array();
                $newContent = '';
@@ -2058,13 +2058,16 @@ function isUrlValid ($URL, $compile=true) {
 }
 
 // Generate a list of administrative links to a given userid
-function generateMemberAdminActionLinks ($userid, $status = '') {
+function generateMemberAdminActionLinks ($userid) {
        // Make sure userid is a number
        if ($userid != bigintval($userid)) debug_report_bug(__FUNCTION__, __LINE__, 'userid is not a number!');
 
        // Define all main targets
        $targetArray = array('del_user', 'edit_user', 'lock_user', 'add_points', 'sub_points');
 
+       // Get user status
+       $status = getFetchedUserData('userid', $userid, 'status');
+
        // Begin of navigation links
        $OUT = '[';
 
@@ -2087,10 +2090,10 @@ function generateMemberAdminActionLinks ($userid, $status = '') {
                        $OUT .= strtoupper($tar);
                }
                $OUT .= '--}</a></span>|';
-       }
+       } // END - foreach
 
        // Finish navigation link
-       $OUT = substr($OUT, 0, -7) . ']';
+       $OUT = substr($OUT, 0, -1) . ']';
 
        // Return string
        return $OUT;
index 75b3895..d581889 100644 (file)
@@ -55,7 +55,6 @@ if (isGetRequestParameterSet('userid')) {
                // Prepare constants
                // @TODO No longer needed? define('__CATS_BASE'   , '<a href="{%url=modules.php?module=admin&amp;userid=');
                $content['userid']       = bigintval(getRequestParameter('userid'));
-               $content['member_links'] = generateMemberAdminActionLinks($content['userid']);
                $content['email']        = '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . $content['surname'] . ' ' . $content['family'] . '</a>';
 
                // Ok, list categories of this user
index 87e9901..ba6f073 100644 (file)
@@ -139,7 +139,6 @@ LIMIT 1",
                }
 
                // Prepare data for template
-               $content['admin_links']       = generateMemberAdminActionLinks($userid, $content['status']);
                $content['email_link']        = generateEmailLink($content['email'], 'user_data');
                $content['last_online']       = generateDateTime($content['last_online'], 0);
                if ($content['emails_sent'] > 0) $content['emails_sent'] = $base . '&amp;what=email_details&amp;userid=' . $userid . '%}">' . translateComma($content['emails_sent']) . '</a>]';
@@ -307,7 +306,6 @@ LIMIT 1",
                        // Transfer data to array
                        $content['sw']             = $SW;
                        $content['email']          = '[<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . $content['email'] . '</a>]';
-                       $content['alinks']         = generateMemberAdminActionLinks($content['userid'], $content['status']);
                        $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], 2);
                        $content['refs']           = countSumTotalData($content['userid'], 'user_refs', 'id', 'userid', true);
                        $content['locked']         = countSumTotalData($content['userid'], 'user_points', 'locked_points');
index b03053d..ce601b6 100644 (file)
@@ -13,7 +13,7 @@
                                <u>{--ADMIN_MEMBER_FUNCTIONS--}:</u>
                        </div>
                        <div>
-                               $content[member_links]
+                               {%pipe,generateMemberAdminActionLinks=$content[userid]%}
                        </div>
                </td>
        </tr>
index 586cec2..b78420d 100644 (file)
@@ -1,13 +1,15 @@
-<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
-       <tr>
-               <td align="center" class="admin_title bottom">
-                       <strong>{--ADMIN_MEMBER_NO_CATS_1--}<a href="{%url=modules.php?module=admin&amp;what=list_user&amp;userid=$content[userid]%}">$content[userid]</a>{--ADMIN_MEMBER_NO_CATS_2--}</strong>
-               </td>
-       </tr>
-       <tr>
-               <td align="center" class="admin_title">
-                       <u>{--ADMIN_MEMBER_FUNCTIONS--}:</u><br />
-                       $content[member_links]
-               </td>
-       </tr>
-</table>
+<div align="center">
+<div class="admin_table dashed">
+       <div class="admin_title bottom">
+               <strong>{--ADMIN_MEMBER_NO_CATS_1--}<a href="{%url=modules.php?module=admin&amp;what=list_user&amp;userid=$content[userid]%}">$content[userid]</a>{--ADMIN_MEMBER_NO_CATS_2--}</strong>
+       </div>
+       <div class="admin_title">
+               <div>
+                       <u>{--ADMIN_MEMBER_FUNCTIONS--}:</u>
+               </div>
+               <div>
+                       {%pipe,generateMemberAdminActionLinks=$content[userid]%}
+               </div>
+       </div>
+</div>
+</div>
index 2154813..b31b720 100644 (file)
@@ -1,6 +1,11 @@
 <tr>
-       <td class="bottom switch_sw$content[sw]" width="30" align="right">$content[cnt].&nbsp;&nbsp;</td>
-       <td class="bottom switch_sw$content[sw]">$content[cat]</td>
-       <td class="bottom switch_sw$content[sw] left" width="50"
-               align="center">$content[sel]</td>
+       <td class="bottom switch_sw$content[sw]" width="30" align="right">
+               $content[cnt].
+       </td>
+       <td class="bottom switch_sw$content[sw]">
+               $content[cat]
+       </td>
+       <td class="bottom switch_sw$content[sw] left" width="50" align="center">
+               $content[sel]
+       </td>
 </tr>
index 7dba30c..1529a0d 100644 (file)
@@ -55,5 +55,5 @@
        <td align="center" class="switch_sw$content[sw] bottom">---</td>
 </tr>
 <tr>
-       <td height="22" colspan="5" class="admin_title">$content[alinks]</td>
+       <td height="22" colspan="5" class="admin_title">{%pipe,generateMemberAdminActionLinks=$content[userid]%}</td>
 </tr>
index f31519e..d8012e8 100644 (file)
        </tr>
        <tr>
                <td align="center" class="admin_footer top" colspan="4">
-                       <strong>{--ADMIN_MEMBER_FUNCTIONS--}:</strong><br />
-                       $content[admin_links]
+                       <div>
+                               <strong>{--ADMIN_MEMBER_FUNCTIONS--}:</strong>
+                       </div>
+                       <div>
+                               {%pipe,generateMemberAdminActionLinks=$content[userid]%}
+                       </div>
                </td>
        </tr>
 </table>