6 * Base module for all modules
8 * @author Sebastian Skejø
14 protected $_core = null;
15 protected $_toModel = null;
18 * Default constructor. Redefined constructors must take $core as first argument and call $this->_init($core)
19 * @param AOOSCore $core A reference to the core object
20 * @param bool $toModel If this is set to 'true' module must implement the public function: AOOSModel toModel();
22 public function __construct(&$core, $toModel = false)
24 $this->_init($core, $toModel);
28 * Must be called when redefining constructor. Takes core object as first argument.
29 * @param AOOSCore $core A reference to the core object
31 private function _init($core, $toModel)
33 if (!$core instanceof AOOSCore ||
!isset($core))
38 if (!is_bool($toModel))
44 // $this->_toModel = $_toModel;
48 * Translates a given string to language selected in settings
49 * @param string $stringID The unique ID of the string to translate
51 public function tr($stringID)
56 $string = $this->_core
->getTranslatedString($stringID);
58 catch (AOOSException
$e)