]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
More constant rewrites
[mailer.git] / inc / modules / admin / admin-inc.php
index f96c247a98d1e07dbe9edf4f3e6bdc095520c4fe..f73c5c7782f40c452769ac04fabbe07a0b04019c 100644 (file)
@@ -349,25 +349,21 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) {
                                }
                                $OUT .= "<tr>
        <td class=\"admin_menu\" colspan=\"2\">
                                }
                                $OUT .= "<tr>
        <td class=\"admin_menu\" colspan=\"2\">
-               <NOBR>&nbsp;<strong>&middot;</strong>&nbsp;";
-                               if (($menu == $act) && (empty($wht)))
-                               {
+               <nobr>&nbsp;<strong>&middot;</strong>&nbsp;";
+                               if (($menu == $act) && (empty($wht))) {
                                        $OUT .= "<strong>";
                                        $OUT .= "<strong>";
-                               }
-                                else
-                               {
+                               } else {
                                        $OUT .= "[<a href=\"{!URL!}/modules.php?module=admin&amp;action=".$menu."\">";
                                }
                                        $OUT .= "[<a href=\"{!URL!}/modules.php?module=admin&amp;action=".$menu."\">";
                                }
+
                                $OUT .= $title;
                                $OUT .= $title;
-                               if (($menu == $act) && (empty($wht)))
-                               {
+
+                               if (($menu == $act) && (empty($wht))) {
                                        $OUT .= "</strong>";
                                        $OUT .= "</strong>";
-                               }
-                                else
-                               {
+                               } else {
                                        $OUT .= "</a>]";
                                }
                                        $OUT .= "</a>]";
                                }
-                               $OUT .= "</NOBR></td>
+                               $OUT .= "</nobr></td>
 </tr>\n";
                                $result_what = SQL_QUERY_ESC("SELECT what, title, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`, id DESC",
                                        array($menu), __FUNCTION__, __LINE__);
 </tr>\n";
                                $result_what = SQL_QUERY_ESC("SELECT what, title, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`, id DESC",
                                        array($menu), __FUNCTION__, __LINE__);
@@ -381,53 +377,47 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) {
                <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_menu_sub\">\n";
                                        while (list($wht_sub, $title_what, $desc_what) = SQL_FETCHROW($result_what)) {
                                                // Filename
                <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_menu_sub\">\n";
                                        while (list($wht_sub, $title_what, $desc_what) = SQL_FETCHROW($result_what)) {
                                                // Filename
-                                               $INC = sprintf("%sinc/modules/admin/what-%s.php", constant('PATH'), $wht_sub);
+                                               $INC = sprintf("inc/modules/admin/what-%s.php", $wht_sub);
                                                if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) {
                                                        $ACL = ADMINS_CHECK_ACL("", $wht_sub);
                                                } else {
                                                        // ACL is "allow"... hmmm
                                                        $ACL = true;
                                                }
                                                if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) {
                                                        $ACL = ADMINS_CHECK_ACL("", $wht_sub);
                                                } else {
                                                        // ACL is "allow"... hmmm
                                                        $ACL = true;
                                                }
+
+                                               // Is the file readable?
                                                $readable = INCLUDE_READABLE($INC);
                                                $readable = INCLUDE_READABLE($INC);
+
+                                               // Access allowed?
                                                if ($ACL === true) {
                                                        // Insert compiled title and description
                                                        $GLOBALS['menu']['title'][$wht_sub]      = $title_what;
                                                        $GLOBALS['menu']['description'][$wht_sub] = $desc_what;
                                                        $OUT .= "<tr>
        <td class=\"admin_menu\" colspan=\"2\">
                                                if ($ACL === true) {
                                                        // Insert compiled title and description
                                                        $GLOBALS['menu']['title'][$wht_sub]      = $title_what;
                                                        $GLOBALS['menu']['description'][$wht_sub] = $desc_what;
                                                        $OUT .= "<tr>
        <td class=\"admin_menu\" colspan=\"2\">
-               <NOBR>&nbsp;<strong>--&gt;</strong>&nbsp;";
-                                                       if ($readable === true)
-                                                       {
-                                                               if ($wht == $wht_sub)
-                                                               {
+               <nobr>&nbsp;<strong>--&gt;</strong>&nbsp;";
+                                                       if ($readable === true) {
+                                                               if ($wht == $wht_sub) {
                                                                        $OUT .= "<strong>";
                                                                        $OUT .= "<strong>";
-                                                               }
-                                                                else
-                                                               {
+                                                               } else {
                                                                        $OUT .= "[<a href=\"{!URL!}/modules.php?module=admin&amp;what=".$wht_sub."\">";
                                                                }
                                                                        $OUT .= "[<a href=\"{!URL!}/modules.php?module=admin&amp;what=".$wht_sub."\">";
                                                                }
-                                                       }
-                                                        else
-                                                       {
+                                                       } else {
                                                                $OUT .= "<i class=\"admin_note\">";
                                                        }
                                                                $OUT .= "<i class=\"admin_note\">";
                                                        }
+
                                                        $OUT .= $title_what;
                                                        $OUT .= $title_what;
-                                                       if ($readable === true)
-                                                       {
-                                                               if ($wht == $wht_sub)
-                                                               {
+
+                                                       if ($readable === true) {
+                                                               if ($wht == $wht_sub) {
                                                                        $OUT .= "</strong>";
                                                                        $OUT .= "</strong>";
-                                                               }
-                                                                else
-                                                               {
+                                                               } else {
                                                                        $OUT .= "</a>]";
                                                                }
                                                                        $OUT .= "</a>]";
                                                                }
-                                                       }
-                                                        else
-                                                       {
+                                                       } else {
                                                                $OUT .= "</em>";
                                                        }
                                                                $OUT .= "</em>";
                                                        }
-                                                       $OUT .= "</NOBR></td>
+                                                       $OUT .= "</nobr></td>
 </tr>\n";
                                                }
                                        }
 </tr>\n";
                                                }
                                        }
@@ -652,7 +642,8 @@ function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default="") {
        $handle = opendir(sprintf("%sinc/modules/%s/", constant('PATH'), $menu)) or mxchange_die("Cannot load menu ".$menu."!");
 
        // Init the selection box
        $handle = opendir(sprintf("%sinc/modules/%s/", constant('PATH'), $menu)) or mxchange_die("Cannot load menu ".$menu."!");
 
        // Init the selection box
-       $OUT = "<select name=\"".$name."\" class=\"admin_select\" size=\"1\">\n <option value=\"\">{--IS_TOP_MENU--}</option>\n";
+       $OUT = "<select name=\"".$name."\" class=\"admin_select\" size=\"1\">
+       <option value=\"\">{--IS_TOP_MENU--}</option>\n";
 
        // Walk through all files
        while ($file = readdir($handle)) {
 
        // Walk through all files
        while ($file = readdir($handle)) {
@@ -772,7 +763,7 @@ function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") {
                } // END - foreach
 
                // Output status
                } // END - foreach
 
                // Output status
-               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_STATUS_CHANGED_1.$cnt.ADMIN_STATUS_CHANGED_2.count($IDs).ADMIN_STATUS_CHANGED_3);
+               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('ADMIN_STATUS_CHANGED'), $cnt, count($IDs)));
        } else {
                // Nothing selected!
                LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NOTHING_SELECTED_CHANGE'));
        } else {
                // Nothing selected!
                LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NOTHING_SELECTED_CHANGE'));
@@ -1001,7 +992,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu
                                LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ALL_ENTRIES_REMOVED'));
                        } else {
                                // Some are still there :(
                                LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ALL_ENTRIES_REMOVED'));
                        } else {
                                // Some are still there :(
-                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_SOME_ENTRIES_NOT_DELETED, SQL_AFFECTEDROWS(), count($IDs)));
+                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('ADMIN_SOME_ENTRIES_NOT_DELETED'), SQL_AFFECTEDROWS(), count($IDs)));
                        }
                } else {
                        // List for deletion confirmation
                        }
                } else {
                        // List for deletion confirmation
@@ -1091,7 +1082,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc
                                LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ALL_ENTRIES_EDITED'));
                        } else {
                                // Some are still there :(
                                LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_ALL_ENTRIES_EDITED'));
                        } else {
                                // Some are still there :(
-                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_SOME_ENTRIES_NOT_EDITED, $affected, count($IDs)));
+                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(getMessage('ADMIN_SOME_ENTRIES_NOT_EDITED'), $affected, count($IDs)));
                        }
                } else {
                        // List for editing
                        }
                } else {
                        // List for editing