$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)
{
// 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
- 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
- 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'));
}
//