]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
Fixes for menu system (still SQL is broken)
[mailer.git] / inc / modules / admin / admin-inc.php
index 7976506243625b366d4a6e0c9453420b302b421d..4cce611c952a78030bd4db5954dcc2ef7a297552 100644 (file)
@@ -534,7 +534,7 @@ function adminMenuSelectionBox_DEPRECATED ($mode, $default = '', $defid = '') {
 }
 
 // Wrapper for $_POST and adminSaveSettings
-function adminSaveSettingsFromPostData ($tableName = "_config", $whereStatement = "config=0", $translateComma = array(), $alwaysAdd = false) {
+function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement = 'config=0', $translateComma = array(), $alwaysAdd = false) {
        // Get the array
        $postData = postRequestArray();
 
@@ -543,7 +543,7 @@ function adminSaveSettingsFromPostData ($tableName = "_config", $whereStatement
 }
 
 // Save settings to the database
-function adminSaveSettings (&$postData, $tableName = "_config", $whereStatement = "config=0", $translateComma = array(), $alwaysAdd = false) {
+function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = 'config=0', $translateComma = array(), $alwaysAdd = false) {
        // Prepare all arrays, variables
        $DATA = array();
        $skip = false;
@@ -677,7 +677,7 @@ function adminAddMenuSelectionBox ($menu, $type, $name, $default = '') {
 
 // Creates a user-profile link for the admin. This function can also be used for many other purposes
 function generateUserProfileLink ($userid, $title = '', $what = 'list_user') {
-       if (($title == '') && ($title != 0)) {
+       if (($title == '') && ($userid > 0)) {
                // Set userid as title
                $title = $userid;
        } // END - if
@@ -685,10 +685,15 @@ function generateUserProfileLink ($userid, $title = '', $what = 'list_user') {
        if (($title == 0) && ($what == 'list_refs')) {
                // Return title again
                return $title;
-       } // END - if
+       } elseif (isExtensionActive('nickname')) {
+               // Get nickname
+               $nick = getNickname($userid);
+
+               // Is it not empty, use it as title else the userid
+               if (!empty($nick)) $title = $nick . '(' . $userid . ')'; else $title = $userid;
+       }
 
        // Return link
-       //* DEBUG: */ outputHtml("a:".$title."<br />");
        return '[<a href="{?URL?}/modules.php?module=admin&amp;what=' . $what . '&amp;userid=' . $userid . '" title="{--ADMIN_USER_PROFILE_TITLE--}">' . $title . '</a>]';
 }