// Define default template dir on tree class

This commit is contained in:
Jerome Nadaud
2013-11-13 20:10:13 +01:00
parent c9a2410c57
commit afaeb15b7d
4 changed files with 53 additions and 11 deletions
+7 -3
View File
@@ -40,12 +40,13 @@ class TreeToolbarCore implements ITreeToolbarCore
return $this->render();
}
public function setActions($value)
public function setActions($actions)
{
if (!is_array($value) && !$value instanceof Traversable)
if (!is_array($actions) && !$actions instanceof Traversable)
throw new PrestaShopException('Action value must be an traversable array');
$this->_actions = $value;
foreach($actions as $action)
$this->addAction($action);
}
public function getActions()
@@ -165,6 +166,9 @@ class TreeToolbarCore implements ITreeToolbarCore
if (!isset($this->_actions))
$this->_actions = array();
if (isset($this->_template_directory))
$action->setTemplateDirectory($this->getTemplateDirectory());
$this->_actions[] = $action;
return $this;
}