]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-guest_add.php
More constant rewrites
[mailer.git] / inc / modules / admin / what-guest_add.php
index 3bd9a5c284d4375446d907944b84a3908cc63ecb..52e768a92ae45cc97318d96b8dd8136e4de77de6 100644 (file)
@@ -41,12 +41,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR("admin", __FILE__);
 
 // Check if the admin has entered title and what-php file name...
-if (((empty($_POST['title'])) || (empty($_POST['menu']))) && (isset($_POST['ok']))) {
+if (((!REQUEST_ISSET_POST(('title'))) || (!REQUEST_ISSET_POST(('menu')))) && (IS_FORM_SENT())) {
        // Abort adding the menu entry
-       unset($_POST['ok']);
+       REQUEST_UNSET_POST('ok');
 }
 
-if (!isset($_POST['ok'])) {
+if (!IS_FORM_SENT()) {
        // Create arrays
        $menus = array(); $titles = array(); $below = array();
 
@@ -152,9 +152,7 @@ WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
                                }
                                $OUT .= "</option>\n";
                        }
-               }
-                else
-               {
+               } else {
                        $OUT .= "      <option value=\"".$m."\">".$titles[$key]."</option>\n";
                }
        }
@@ -166,37 +164,30 @@ WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
 
        // Display form
        LOAD_TEMPLATE("admin_guest_add");
-}
- elseif (!IS_DEMO())
-{
+} elseif (!IS_DEMO()) {
        // Insert new menu entry
-       if (!empty($_POST['menu']))
-       {
+       if (REQUEST_ISSET_POST(('menu'))) {
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('%s','%s','%s','%s','%s','%s')",
  array(
-       $_POST['menu'],
-       $_POST['name'],
-       $_POST['title'],
-       bigintval($_POST['sort']),
-       $_POST['visible'],
-       $_POST['active'],
+       REQUEST_POST('menu'),
+       REQUEST_POST('name'),
+       REQUEST_POST('title'),
+       bigintval(REQUEST_POST('sort')),
+       REQUEST_POST('visible'),
+       REQUEST_POST('active'),
 ), __FILE__, __LINE__);
-       }
-        else
-       {
+       } else {
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (action, title, sort, visible, locked) VALUES ('%s','%s','%s','%s','%s')",
  array(
-       $_POST['name'],
-       $_POST['title'],
-       bigintval($_POST['sort']),
-       $_POST['visible'],
-       $_POST['active'],
+       REQUEST_POST('name'),
+       REQUEST_POST('title'),
+       bigintval(REQUEST_POST('sort')),
+       REQUEST_POST('visible'),
+       REQUEST_POST('active'),
 ), __FILE__, __LINE__);
        }
        LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED'));
-}
- else
-{
+} else {
        // Demo mode!
        LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_NOT_SAVED'));
 }