- $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)
- {
+ $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
// Read menu structure
- while (list($act, $title, $sort) = SQL_FETCHROW($result))
- {
+ // @TODO Cant this be rewritten?
+ while ($content = SQL_FETCHARRAY($result)) {
// Menu actions
// Menu actions
- $menus[] = $act;
+ $menus[] = $content['action'];
// Menu titles
// Menu titles
- $titles[] = $title;
+ $titles[] = $content['title'];
// Below this menu point should the new be added so we simply increase the sort value by 1 :-)
// Below this menu point should the new be added so we simply increase the sort value by 1 :-)
- $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)
- {
+ 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`",
+ array($value_main), __FILE__, __LINE__);
+ if (SQL_NUMROWS($result) > 0) {
+ // Init arrays
$menus[$value_main] = array();
$titles[$value_main] = array();
$below[$value_main] = array();
$menus[$value_main] = array();
$titles[$value_main] = array();
$below[$value_main] = array();
+
// Read menu structure
// Read menu structure
- while (list($act, $title, $sort) = SQL_FETCHROW($result))
- {
+ while ($content = SQL_FETCHARRAY($result)) {
// Menu actions
// Menu actions
- $menus[$value_main][] = $act;
+ $menus[$value_main][] = $content['what'];
// Menu titles
// Menu titles
- $titles[$value_main][] = $title;
+ $titles[$value_main][] = $content['title'];
// Below this menu point should the new be added so we simply increase the sort value by 1 :-)
// Below this menu point should the new be added so we simply increase the sort value by 1 :-)