$menus = array(); $titles = array(); $below = array();
// Get all available main menus
- $result = SQL_QUERY("SELECT action, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) ORDER BY sort", __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT action, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) ORDER BY `sort`", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0)
{
// Read menu structure
// Load sub menus :)
foreach ($menus as $key_main => $value_main)
{
- $result = SQL_QUERY_ESC("SELECT what, title, sort FROM "._MYSQL_PREFIX."_admin_menu WHERE action='%s' AND what != '' AND what IS NOT NULL ORDER BY sort",
+ $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
array($value_main), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0)
{
}
}
}
- $OUT = " <SELECT class=\"admin_select\" name=\"sort\" size=\"1\">
- <OPTION value=\"0\">".IS_FIRST_MENU."</OPTION>\n";
+ $OUT = " <select class=\"admin_select\" name=\"sort\" size=\"1\">
+ <option value=\"0\">".IS_FIRST_MENU."</option>\n";
foreach ($below as $key => $m)
{
if (is_array($m))
{
foreach ($m as $key2 => $m2)
{
- $OUT .= " <OPTION value=\"".$m2."\">".$titles[$key][$key2];
+ $OUT .= " <option value=\"".$m2."\">".$titles[$key][$key2];
foreach ($menus as $k => $v)
{
if (($v == $key) && (!is_array($v)))
$OUT .= " (".$titles[$k].")";
}
}
- $OUT .= "</OPTION>\n";
+ $OUT .= "</option>\n";
}
}
else
{
- $OUT .= " <OPTION value=\"".$m."\">".$titles[$key]."</OPTION>\n";
+ $OUT .= " <option value=\"".$m."\">".$titles[$key]."</option>\n";
}
}
- $OUT .= "</SELECT>";
+ $OUT .= "</select>";
define('__BELOW_SELECTION' , $OUT);
define('__WHAT_SELECTION' , ADMIN_MAKE_MENU_SELECTION("admin", "what", "name"));
// Display form
LOAD_TEMPLATE("admin_admin_add");
-}
- elseif (!IS_DEMO())
-{
+} elseif (!IS_DEMO()) {
// Insert new menu entry
- if (!empty($_POST['menu']))
- {
+ if (!empty($_POST['menu'])) {
// Add sub menu
- $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('%s','%s','%s','%s','%s')",
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('%s','%s','%s','%s','%s')",
array(
$_POST['menu'],
$_POST['name'],
), __FILE__, __LINE__
);
CACHE_PURGE_ADMIN_MENU(0, $_POST['menu'], $_POST['name']);
- }
- else
- {
+ } else {
// Add main menu
- $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, title, descr, sort) VALUES ('%s','%s','%s','%s')",
+ SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (action, title, descr, sort) VALUES ('%s','%s','%s','%s')",
array(
$_POST['name'],
$_POST['title'],
);
CACHE_PURGE_ADMIN_MENU(0, $_POST['name']);
}
- LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE);
-}
- else
-{
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED'));
+} else {
// Is demo login!
- LOAD_TEMPLATE("admin_settings_saved", false, SETTINGS_NOT_SAVED);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_NOT_SAVED'));
}
//