From d22fa6e71e81743b277da0873e2abe7fc7bb5d98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 28 Jun 2010 05:39:36 +0000 Subject: [PATCH 1/1] More use of EL, fix for admin links --- inc/functions.php | 11 +++++--- inc/modules/admin/what-list_cats.php | 1 - inc/modules/admin/what-list_user.php | 2 -- templates/de/html/admin/admin_list_cats.tpl | 2 +- .../de/html/admin/admin_list_cats_404.tpl | 28 ++++++++++--------- .../de/html/admin/admin_list_cats_row.tpl | 13 ++++++--- .../de/html/admin/admin_list_user_row.tpl | 2 +- .../de/html/admin/admin_user_details.tpl | 8 ++++-- 8 files changed, 39 insertions(+), 28 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index f9a51c0cb6..3ce992eb42 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -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 .= '--}|'; - } + } // END - foreach // Finish navigation link - $OUT = substr($OUT, 0, -7) . ']'; + $OUT = substr($OUT, 0, -1) . ']'; // Return string return $OUT; diff --git a/inc/modules/admin/what-list_cats.php b/inc/modules/admin/what-list_cats.php index 75b3895a0b..d581889e30 100644 --- a/inc/modules/admin/what-list_cats.php +++ b/inc/modules/admin/what-list_cats.php @@ -55,7 +55,6 @@ if (isGetRequestParameterSet('userid')) { // Prepare constants // @TODO No longer needed? define('__CATS_BASE' , '' . $content['surname'] . ' ' . $content['family'] . ''; // Ok, list categories of this user diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index 87e9901869..ba6f073cd1 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -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 . '&what=email_details&userid=' . $userid . '%}">' . translateComma($content['emails_sent']) . ']'; @@ -307,7 +306,6 @@ LIMIT 1", // Transfer data to array $content['sw'] = $SW; $content['email'] = '[' . $content['email'] . ']'; - $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'); diff --git a/templates/de/html/admin/admin_list_cats.tpl b/templates/de/html/admin/admin_list_cats.tpl index b03053d10b..ce601b671b 100644 --- a/templates/de/html/admin/admin_list_cats.tpl +++ b/templates/de/html/admin/admin_list_cats.tpl @@ -13,7 +13,7 @@ {--ADMIN_MEMBER_FUNCTIONS--}:
- $content[member_links] + {%pipe,generateMemberAdminActionLinks=$content[userid]%}
diff --git a/templates/de/html/admin/admin_list_cats_404.tpl b/templates/de/html/admin/admin_list_cats_404.tpl index 586cec2b80..b78420dae4 100644 --- a/templates/de/html/admin/admin_list_cats_404.tpl +++ b/templates/de/html/admin/admin_list_cats_404.tpl @@ -1,13 +1,15 @@ - - - - - - - -
- {--ADMIN_MEMBER_NO_CATS_1--}$content[userid]{--ADMIN_MEMBER_NO_CATS_2--} -
- {--ADMIN_MEMBER_FUNCTIONS--}:
- $content[member_links] -
+
+
+
+ {--ADMIN_MEMBER_NO_CATS_1--}$content[userid]{--ADMIN_MEMBER_NO_CATS_2--} +
+
+
+ {--ADMIN_MEMBER_FUNCTIONS--}: +
+
+ {%pipe,generateMemberAdminActionLinks=$content[userid]%} +
+
+
+
diff --git a/templates/de/html/admin/admin_list_cats_row.tpl b/templates/de/html/admin/admin_list_cats_row.tpl index 2154813676..b31b720baf 100644 --- a/templates/de/html/admin/admin_list_cats_row.tpl +++ b/templates/de/html/admin/admin_list_cats_row.tpl @@ -1,6 +1,11 @@ - $content[cnt].   - $content[cat] - $content[sel] + + $content[cnt]. + + + $content[cat] + + + $content[sel] + diff --git a/templates/de/html/admin/admin_list_user_row.tpl b/templates/de/html/admin/admin_list_user_row.tpl index 7dba30c6b3..1529a0df5e 100644 --- a/templates/de/html/admin/admin_list_user_row.tpl +++ b/templates/de/html/admin/admin_list_user_row.tpl @@ -55,5 +55,5 @@ --- - $content[alinks] + {%pipe,generateMemberAdminActionLinks=$content[userid]%} diff --git a/templates/de/html/admin/admin_user_details.tpl b/templates/de/html/admin/admin_user_details.tpl index f31519e5ab..d8012e8bbc 100644 --- a/templates/de/html/admin/admin_user_details.tpl +++ b/templates/de/html/admin/admin_user_details.tpl @@ -187,8 +187,12 @@ - {--ADMIN_MEMBER_FUNCTIONS--}:
- $content[admin_links] +
+ {--ADMIN_MEMBER_FUNCTIONS--}: +
+
+ {%pipe,generateMemberAdminActionLinks=$content[userid]%} +
-- 2.30.2