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 f9a51c0cb6e0006883b0a6450a1e28d0fe1bf620..3ce992eb42afe71452a779c07c9c123b0c24e503 100644 (file)
@@ -178,7 +178,7 @@ function doFinalCompilation ($code, $insertComments = true) {
        $cnt = 0;
 
        // Compile all out
        $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 = '';
                // 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
 }
 
 // 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');
 
        // 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 = '[';
 
        // Begin of navigation links
        $OUT = '[';
 
@@ -2087,10 +2090,10 @@ function generateMemberAdminActionLinks ($userid, $status = '') {
                        $OUT .= strtoupper($tar);
                }
                $OUT .= '--}</a></span>|';
                        $OUT .= strtoupper($tar);
                }
                $OUT .= '--}</a></span>|';
-       }
+       } // END - foreach
 
        // Finish navigation link
 
        // Finish navigation link
-       $OUT = substr($OUT, 0, -7) . ']';
+       $OUT = substr($OUT, 0, -1) . ']';
 
        // Return string
        return $OUT;
 
        // Return string
        return $OUT;
index 75b3895a0b1d794281c4b8ec8175dd31caca789b..d581889e30ae86fc90d9074554ae33f24ac240f3 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'));
                // 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
                $content['email']        = '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . $content['surname'] . ' ' . $content['family'] . '</a>';
 
                // Ok, list categories of this user
index 87e9901869dc176511512f618ea9776eaf6b6b5e..ba6f073cd1fb68b508226ef02f9bcb5c4b1116a1 100644 (file)
@@ -139,7 +139,6 @@ LIMIT 1",
                }
 
                // Prepare data for template
                }
 
                // 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>]';
                $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>]';
                        // 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');
                        $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 b03053d10b4ab99d9d578f1bdbc123d526e7ddc3..ce601b671bcf891fe843b6bba4ce5d3bce385e75 100644 (file)
@@ -13,7 +13,7 @@
                                <u>{--ADMIN_MEMBER_FUNCTIONS--}:</u>
                        </div>
                        <div>
                                <u>{--ADMIN_MEMBER_FUNCTIONS--}:</u>
                        </div>
                        <div>
-                               $content[member_links]
+                               {%pipe,generateMemberAdminActionLinks=$content[userid]%}
                        </div>
                </td>
        </tr>
                        </div>
                </td>
        </tr>
index 586cec2b80219baa5a33b0879f202694429e618b..b78420dae49dd3097bb354c89e6511f8274aa8b9 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 2154813676b590233b5f9bab72ab750f870043e8..b31b720baf6ab80a5b28f5e7df0b9abb46d4d67f 100644 (file)
@@ -1,6 +1,11 @@
 <tr>
 <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>
 </tr>
index 7dba30c6b3ae4afe4177025f598ba068a3840273..1529a0df5e37bed282bafe1921db3515417123c6 100644 (file)
@@ -55,5 +55,5 @@
        <td align="center" class="switch_sw$content[sw] bottom">---</td>
 </tr>
 <tr>
        <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>
 </tr>
index f31519e5ab8fdca68a57946019537ca6057e0b71..d8012e8bbce62c8737c56455327535b27f39aac1 100644 (file)
        </tr>
        <tr>
                <td align="center" class="admin_footer top" colspan="4">
        </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>
                </td>
        </tr>
 </table>