]> git.mxchange.org Git - mailer.git/blobdiff - 0.2.1/inc/modules/admin/what-config_home.php
win32 to unix line delimiters changed
[mailer.git] / 0.2.1 / inc / modules / admin / what-config_home.php
index db688e6dfd53e026855317a70910bcf3c65a2453..d5806152cf865b930b00b3e635e9f0962c6c3e7d 100644 (file)
-<?php\r
-/************************************************************************\r
- * MXChange v0.2.1                                    Start: 09/22/2004 *\r
- * ================                             Last change: 09/22/2004 *\r
- *                                                                      *\r
- * -------------------------------------------------------------------- *\r
- * File              : what-config_home.php                             *\r
- * -------------------------------------------------------------------- *\r
- * Short description : Set "home" page                                  *\r
- * -------------------------------------------------------------------- *\r
- * Kurzbeschreibung  : "Home"-Seite festlegen                           *\r
- * -------------------------------------------------------------------- *\r
- *                                                                      *\r
- * -------------------------------------------------------------------- *\r
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *\r
- * For more information visit: http://www.mxchange.org                  *\r
- *                                                                      *\r
- * This program is free software; you can redistribute it and/or modify *\r
- * it under the terms of the GNU General Public License as published by *\r
- * the Free Software Foundation; either version 2 of the License, or    *\r
- * (at your option) any later version.                                  *\r
- *                                                                      *\r
- * This program is distributed in the hope that it will be useful,      *\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of       *\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *\r
- * GNU General Public License for more details.                         *\r
- *                                                                      *\r
- * You should have received a copy of the GNU General Public License    *\r
- * along with this program; if not, write to the Free Software          *\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *\r
- * MA  02110-1301  USA                                                  *\r
- ************************************************************************/\r
-\r
-// Some security stuff...\r
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))\r
-{\r
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";\r
-       require($INC);\r
-}\r
-// Add description as navigation point\r
-ADD_DESCR("admin", basename(__FILE__));\r
-\r
-$sub = "";\r
-if (!empty($_GET['sub'])) $sub = $_GET['sub'];\r
-\r
-switch ($sub)\r
-{\r
-case "": // Output selection table\r
-       LOAD_TEMPLATE("admin_config_home_main");\r
-       break;\r
-\r
-case "settings": // Settings related to the index page\r
-       if (isset($_POST['ok']))\r
-       {\r
-               // Save settings\r
-               ADMIN_SAVE_SETTINGS($_POST, "_config", "config='0'");\r
-               OUTPUT_HTML ("<A href=\"".URL."/modules.php?module=admin&amp;what=config_home&amp;sub=settings\">".ADMIN_CONTINUE_TO_CONFIG."</A>");\r
-       }\r
-        else\r
-       {\r
-               // Prepare data for the template\r
-               $content = array_fill(-1, 60, "");\r
-               $content[$CONFIG['index_delay']] = " selected=\"selected\"";\r
-\r
-               define('__INDEX_COOKIE_SELECTION', CREATE_TIME_SELECTIONS($CONFIG['index_cookie'], "index_cookie", "YMWD"));\r
-               LOAD_TEMPLATE("admin_config_home_settings", false, $content);\r
-       }\r
-       break;\r
-\r
-case "target": // Set which what-file will be placed in home-page (only modules.php?module=index)\r
-       if (isset($_GET['home']))\r
-       {\r
-               // Set new home\r
-               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET index_home='%s' WHERE config='0' LIMIT 1", array($_GET['home']), __FILE__, __LINE__);\r
-               $CONFIG['index_home'] = $_GET['home'];\r
-       }\r
-\r
-       // Load all what menu points\r
-       $result = SQL_QUERY("SELECT id, what, title\r
- FROM "._MYSQL_PREFIX."_guest_menu\r
- WHERE action='main' AND what != '' AND locked='N'\r
- ORDER BY sort", __FILE__, __LINE__);\r
-\r
-       $SW = 2; $OUT = ""; $atitle = "";\r
-       while (list($id, $wht, $wtitle) = SQL_FETCHROW($result))\r
-       {\r
-               $LINK = "<A href=\"".URL."/modules.php?module=admin&amp;what=config_home&amp;sub=target&amp;home=".$wht."\">"._IS_NEW_HOME."</A>";\r
-               if ($wht == $CONFIG['index_home'])\r
-               {\r
-                       // Is current home\r
-                       $LINK   = "<STRONG class=\"admin_note\">"._IS_CURRENT_HOME."</STRONG>";\r
-                       $atitle = "<STRONG class=\"admin_note\">".$atitle."</STRONG>";\r
-                       $wtitle = "<STRONG class=\"admin_note\">".$wtitle."</STRONG>";\r
-               }\r
-\r
-               // Add row...\r
-               $OUT .= "<TR>\r
-         <TD class=\"switch_sw".$SW." bottom right\">&nbsp;".$id."</TD>\r
-         <TD class=\"switch_sw".$SW." bottom right\">&nbsp;".$wtitle."</TD>\r
-         <TD class=\"switch_sw".$SW." bottom\" align=\"center\">\r
-           ".$LINK."\r
-         </TD>\r
-       </TR>\n";\r
-\r
-               // Switch color\r
-               $SW = 3 - $SW;\r
-       }\r
-\r
-       // Free memory\r
-       SQL_FREERESULT($result);\r
-       define('__HOME_ROWS', $OUT);\r
-\r
-       // Load template\r
-       LOAD_TEMPLATE("admin_config_home");\r
-       break;\r
-}\r
-//\r
-?>\r
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/22/2004 *
+ * ================                             Last change: 09/22/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-config_home.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Set "home" page                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : "Home"-Seite festlegen                           *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
+{
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+$sub = "";
+if (!empty($_GET['sub'])) $sub = $_GET['sub'];
+
+switch ($sub)
+{
+case "": // Output selection table
+       LOAD_TEMPLATE("admin_config_home_main");
+       break;
+
+case "settings": // Settings related to the index page
+       if (isset($_POST['ok']))
+       {
+               // Save settings
+               ADMIN_SAVE_SETTINGS($_POST, "_config", "config='0'");
+               OUTPUT_HTML ("<A href=\"".URL."/modules.php?module=admin&amp;what=config_home&amp;sub=settings\">".ADMIN_CONTINUE_TO_CONFIG."</A>");
+       }
+        else
+       {
+               // Prepare data for the template
+               $content = array_fill(-1, 60, "");
+               $content[$CONFIG['index_delay']] = " selected=\"selected\"";
+
+               define('__INDEX_COOKIE_SELECTION', CREATE_TIME_SELECTIONS($CONFIG['index_cookie'], "index_cookie", "YMWD"));
+               LOAD_TEMPLATE("admin_config_home_settings", false, $content);
+       }
+       break;
+
+case "target": // Set which what-file will be placed in home-page (only modules.php?module=index)
+       if (isset($_GET['home']))
+       {
+               // Set new home
+               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_config SET index_home='%s' WHERE config='0' LIMIT 1", array($_GET['home']), __FILE__, __LINE__);
+               $CONFIG['index_home'] = $_GET['home'];
+       }
+
+       // Load all what menu points
+       $result = SQL_QUERY("SELECT id, what, title
+ FROM "._MYSQL_PREFIX."_guest_menu
+ WHERE action='main' AND what != '' AND locked='N'
+ ORDER BY sort", __FILE__, __LINE__);
+
+       $SW = 2; $OUT = ""; $atitle = "";
+       while (list($id, $wht, $wtitle) = SQL_FETCHROW($result))
+       {
+               $LINK = "<A href=\"".URL."/modules.php?module=admin&amp;what=config_home&amp;sub=target&amp;home=".$wht."\">"._IS_NEW_HOME."</A>";
+               if ($wht == $CONFIG['index_home'])
+               {
+                       // Is current home
+                       $LINK   = "<STRONG class=\"admin_note\">"._IS_CURRENT_HOME."</STRONG>";
+                       $atitle = "<STRONG class=\"admin_note\">".$atitle."</STRONG>";
+                       $wtitle = "<STRONG class=\"admin_note\">".$wtitle."</STRONG>";
+               }
+
+               // Add row...
+               $OUT .= "<TR>
+         <TD class=\"switch_sw".$SW." bottom right\">&nbsp;".$id."</TD>
+         <TD class=\"switch_sw".$SW." bottom right\">&nbsp;".$wtitle."</TD>
+         <TD class=\"switch_sw".$SW." bottom\" align=\"center\">
+           ".$LINK."
+         </TD>
+       </TR>\n";
+
+               // Switch color
+               $SW = 3 - $SW;
+       }
+
+       // Free memory
+       SQL_FREERESULT($result);
+       define('__HOME_ROWS', $OUT);
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_home");
+       break;
+}
+//
+?>