From 9e0955c96d888fc2e00014498d095a7d65ab48fb Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 9 Oct 2011 21:03:50 +0000 Subject: improved the way modules are taken from an xml configuration string --- .../Application/Controllers/BaseController.php | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'h-source/Application/Controllers/BaseController.php') diff --git a/h-source/Application/Controllers/BaseController.php b/h-source/Application/Controllers/BaseController.php index 13bbb66..2d8c0a7 100644 --- a/h-source/Application/Controllers/BaseController.php +++ b/h-source/Application/Controllers/BaseController.php @@ -168,6 +168,20 @@ class BaseController extends Controller return null; } +// get the HTML of a module from the xml configuration string +// $xmlPath: array conitaining the path + protected function getModule($xmlPath) + { + $tracksHelpLabel = null; + $xml = $this->getBox($xmlPath); + if ($xml) + { + $box_news = new BoxParser($xml); + $tracksHelpLabel = $box_news->render(); + } + return $tracksHelpLabel; + } + protected function right($lang = 'en') { $hard = new HardwareModel(); @@ -179,14 +193,8 @@ class BaseController extends Controller $data['numbLogged'] = count($logged); //render the boxes inside the right column - $data['htmlRightBox'] = null; - $xml = $this->getBox(array('right_column')); - if ($xml) - { - $box_news = new BoxParser($xml); - $data['htmlRightBox'] = $box_news->render(); - } - + $data['htmlRightBox'] = $this->getModule(array('right_column')); + $data['language_links'] = $this->buildLanguageLinks($this->lang); $data['lastModif'] = $this->m['HistoryModel'] -- cgit v1.2.3