mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 12:08:47 +02:00
N°2847 - Refactor some early choices
- TWIG: Change calls to object methods from simple notation (eg. oObject.Id) to complete notation (eg. oObject.GetId()) to avoid confusion with use of arrays and variables (eg. aObject.sId) - UIBlock: $sId should not be first parameter as most of the time it can be ignored and generated by the system - NewsroomMenu: Rename method for something more less ambiguous - Html: Embed content in <div /> so we can easily find all such HTML fragments in the UI
This commit is contained in:
@@ -32,23 +32,35 @@ use Combodo\iTop\Application\UI\Component\PopoverMenu\PopoverMenu;
|
||||
*/
|
||||
class NewsroomMenu extends PopoverMenu
|
||||
{
|
||||
// Overloaded constants
|
||||
const HTML_TEMPLATE_REL_PATH = 'components/popover-menu/newsroom-menu/layout';
|
||||
const JS_TEMPLATE_REL_PATH = 'components/popover-menu/newsroom-menu/layout';
|
||||
|
||||
const JS_FILES_REL_PATH = [
|
||||
'js/components/newsroom-menu.js',
|
||||
];
|
||||
|
||||
/** @var array $aParams */
|
||||
protected $aParams;
|
||||
|
||||
|
||||
/**
|
||||
* Set all parameters at once
|
||||
*
|
||||
* @param array $aParams
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function SetParams($aParams)
|
||||
{
|
||||
$this->aParams = $aParams;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function GetParams()
|
||||
/**
|
||||
* Return all parameters as a JSON string
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
public function GetParamsAsJson()
|
||||
{
|
||||
return json_encode($this->aParams);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user