mirror of
https://github.com/e107inc/e107.git
synced 2025-08-12 17:44:37 +02:00
Issue #1336 and Forum menu prefs upgrade and newforumpost_menu fix. e_menu.php pending.
This commit is contained in:
@@ -41,6 +41,11 @@ class e_menu
|
||||
*/
|
||||
protected $_visibility_cache = array();
|
||||
|
||||
|
||||
protected $_current_menu = null;
|
||||
|
||||
protected $_current_parms = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -126,10 +131,17 @@ class e_menu
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the preferences/parms for the current menu.
|
||||
* @return array
|
||||
*/
|
||||
public function pref()
|
||||
{
|
||||
return $this->_current_parms;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -184,6 +196,21 @@ class e_menu
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set Parms for a specific menu.
|
||||
* @param string $plugin ie. plugin folder name.
|
||||
* @param string $menu menu name. including the _menu but not the .php
|
||||
* @param array $parms
|
||||
* @param string|int $location default 'all' or a menu area number..
|
||||
* @return int|boolean number of records updated or false.
|
||||
*/
|
||||
public function setParms($plugin, $menu, $parms=array(), $location = 'all')
|
||||
{
|
||||
$qry = 'menu_parms="'.e107::serialize($parms).'" WHERE menu_parms="" AND menu_path="'.$plugin.'/" AND menu_name="'.$menu.'" ';
|
||||
$qry .= ($location != 'all') ? 'menu_location='.intval($location) : '';
|
||||
|
||||
return e107::getDb()->update('menus', $qry);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -403,7 +430,7 @@ class e_menu
|
||||
// global $sql; // required at the moment.
|
||||
global $sc_style, $e107_debug;
|
||||
|
||||
$e107 = e107::getInstance();
|
||||
|
||||
$sql = e107::getDb();
|
||||
$ns = e107::getRender();
|
||||
$tp = e107::getParser();
|
||||
@@ -414,6 +441,10 @@ class e_menu
|
||||
unset($tmp);
|
||||
}
|
||||
|
||||
$this->_current_parms = $parm;
|
||||
$this->_current_menu = $mname;
|
||||
|
||||
|
||||
if($return)
|
||||
{
|
||||
ob_start();
|
||||
|
Reference in New Issue
Block a user