]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
Naming convention applied to language strings, new API function added:
[mailer.git] / inc / modules / admin / admin-inc.php
index b95b6a2523e4e2f4c43634bb6a038a82de585f32..7638b2fc067c98e0dd2b0ae7e9fa1ba180398ac4 100644 (file)
@@ -99,7 +99,7 @@ function ifAdminLoginDataIsValid ($adminLogin, $adminPassword) {
                                $ret = 'done';
                        } else {
                                // Set status
-                               $ret = 'pass';
+                               $ret = 'password';
                        }
                } // END - if
        } // END - if
@@ -139,7 +139,7 @@ function ifAdminCookiesAreValid ($adminLogin, $passHash) {
                        $ret = 'done';
                } else {
                        // Set status
-                       $ret = 'pass';
+                       $ret = 'password';
                }
        } // END - if
 
@@ -289,7 +289,7 @@ ORDER BY
                                                $OUT .= '[<a href="{%url=modules.php?module=admin&amp;action=' . $menu . '%}">';
                                        }
                                } else {
-                                       $OUT .= '<em style="cursor:help" class="admin_note" title="{%message,MENU_ACTION_404=' . $menu . '}">';
+                                       $OUT .= '<em style="cursor:help" class="notice" title="{%message,MENU_ACTION_404=' . $menu . '}">';
                                }
 
                                $OUT .= $title;
@@ -359,7 +359,7 @@ ORDER BY
                                                                        $OUT .= '[<a href="{%url=modules.php?module=admin&amp;what=' . $what_sub . '%}">';
                                                                }
                                                        } else {
-                                                               $OUT .= '<em style="cursor:help" class="admin_note" title="{%message,MENU_WHAT_404=' . $what_sub . '%}">';
+                                                               $OUT .= '<em style="cursor:help" class="notice" title="{%message,MENU_WHAT_404=' . $what_sub . '%}">';
                                                        }
 
                                                        $OUT .= $title_what;
@@ -423,14 +423,14 @@ function addMemberSelectionBox ($def = 0, $add_all = false, $return = false, $no
 
        if ($return === false) {
                // Remeber options in constant
-               $content['member_selection'] = $OUT;
+               $content['form_selection'] = $OUT;
                $content['what']             = getWhat();
 
                // Load template
-               loadTemplate('admin_member_selection_box', false, $content);
+               loadTemplate('admin_form_selection_box', false, $content);
        } else {
                // Return content in selection frame
-               return '<select class="admin_select" name="' . handleFieldWithBraces($field) . '" size="1">' . $OUT . '</select>';
+               return '<select class="form_select" name="' . handleFieldWithBraces($field) . '" size="1">' . $OUT . '</select>';
        }
 }
 
@@ -447,7 +447,7 @@ function adminMenuSelectionBox_DEPRECATED ($mode, $default = '', $defid = '') {
                // Load menu as selection
                $OUT = '<select name="' . $mode . '_menu';
                if ((!empty($defid)) || ($defid == '0')) $OUT .= '[' . $defid . ']';
-               $OUT .= '" size="1" class="admin_select">
+               $OUT .= '" size="1" class="form_select">
        <option value="">{--SELECT_NONE--}</option>';
                // Load all entries
                while ($content = SQL_FETCHARRAY($result)) {
@@ -589,7 +589,7 @@ function adminAddMenuSelectionBox ($menu, $type, $name, $default = '') {
        $menuArray = getArrayFromDirectory(sprintf("inc/modules/%s/", $menu), '', false, false);
 
        // Init the selection box
-       $OUT = '<select name="' . $name . '" class="admin_select" size="1"><option value="">{--IS_TOP_MENU--}</option>';
+       $OUT = '<select name="' . $name . '" class="form_select" size="1"><option value="">{--ADMIN_IS_TOP_MENU--}</option>';
 
        // Walk through all files
        foreach ($menuArray as $file) {
@@ -623,7 +623,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 == '') && ($userid > 0)) {
+       if (($title == '') && (isValidUserId($userid))) {
                // Set userid as title
                $title = $userid;
        } elseif ($userid == 0) {
@@ -739,9 +739,6 @@ function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '', $
 
        // Is the raw userid set?
        if (postRequestParameter($userid, $id) > 0) {
-               // Generate subject
-               $subject = '{--MEMBER_' . strtoupper($subject) . '_' . strtoupper($table) . '_SUBJECT--}';
-
                // Load email template
                if (!empty($subjectPart)) {
                        $mail = loadEmailTemplate('member_' . $mode . '_' . strtolower($subjectPart) . '_' . $table, $content);
@@ -750,11 +747,11 @@ function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '', $
                }
 
                // Send email out
-               sendEmail(postRequestParameter($userid, $id), $subject, $mail);
+               sendEmail(postRequestParameter($userid, $id), strtoupper('{--MEMBER_' . $subject . '_' . $table . '_SUBJECT--}'), $mail);
        } // END - if
 
        // Generate subject
-       $subject = '{--ADMIN_' . strtoupper($subject) . '_' . strtoupper($table) . '_SUBJECT--}';
+       $subject = strtoupper('{--ADMIN_' . $subject . '_' . $table . '_SUBJECT--}');
 
        // Send admin notification out
        if (!empty($subjectPart)) {
@@ -863,7 +860,7 @@ function adminBuilderStatusHandler ($mode, $IDs, $table, $columns, $filterFuncti
                                        } // END - if
                                } elseif (isset($content[$column])) {
                                        // Unfinished!
-                                       debug_report_bug(__FUNCTION__, __LINE__, ":UNFINISHED: id={$id}/{$column}[".gettype($statusInfo)."] = {$content[$column]}");
+                                       debug_report_bug(__FUNCTION__, __LINE__, ':UNFINISHED: id=' . $id . ',column=' . $column . '[' . gettype($statusInfo) . '] = ' . $content[$column]);
                                }
                        } // END - foreach
 
@@ -1131,7 +1128,7 @@ function sendAdminPasswordResetLink ($email) {
        unset($content['password']);
 
        // Prepare email
-       $mailText = loadEmailTemplate('admin_reset_password', $content);
+       $mailText = loadEmailTemplate('form_reset_password', $content);
 
        // Send it out
        sendEmail($email, '{--ADMIN_RESET_PASS_LINK_SUBJECT--}', $mailText);
@@ -1178,7 +1175,7 @@ function doResetAdminPassword ($login, $password) {
                array($passHash, $login), __FUNCTION__, __LINE__);
 
        // Run filters
-       runFilterChain('post_admin_reset_pass', array('login' => $login, 'hash' => $passHash));
+       runFilterChain('post_form_reset_pass', array('login' => $login, 'hash' => $passHash));
 
        // Return output
        return '{--ADMIN_PASSWORD_RESET_DONE--}';
@@ -1247,7 +1244,7 @@ function setAdminMenuHasEntries ($action, $hasEntries) {
 // Creates a link to the user's admin-profile
 function adminCreateUserLink ($userid) {
        // Is the userid set correctly?
-       if ($userid > 0) {
+       if (isValidUserId($userid)) {
                // Create a link to that profile
                return '{%url=modules.php?module=admin&amp;what=list_user&amp;userid=' . bigintval($userid) . '%}';
        } // END - if
@@ -1259,7 +1256,7 @@ function adminCreateUserLink ($userid) {
 // Generate a "link" for the given admin id (admin_id)
 function generateAdminLink ($adminId) {
        // No assigned admin is default
-       $adminLink = '<span class="admin_note">{--ADMIN_NO_ADMIN_ASSIGNED--}</span>';
+       $adminLink = '<span class="notice">{--ADMIN_NO_ADMIN_ASSIGNED--}</span>';
 
        // Zero? = Not assigned
        if (bigintval($adminId) > 0) {
@@ -1274,11 +1271,11 @@ function generateAdminLink ($adminId) {
                                $adminLink = '<a href="' . generateEmailLink(getAdminEmail($adminId), 'admins') . '" title="{--ADMIN_CONTACT_LINK_TITLE--}">' . $login . '</a>';
                        } else {
                                // Extension not found
-                               $adminLink = getMaskedMessage('EXTENSION_PROBLEM_EXTENSION_NOT_INSTALLED', 'admins');
+                               $adminLink = getMaskedMessage('ADMIN_TASK_ROW_EXTENSION_NOT_INSTALLED', 'admins');
                        }
                } else {
                        // Maybe deleted?
-                       $adminLink = '<div class="admin_note">' . getMaskedMessage('ADMIN_ID_404', $adminId) . '</div>';
+                       $adminLink = '<div class="notice">' . getMaskedMessage('ADMIN_ID_404', $adminId) . '</div>';
                }
        } // END - if