public function __construct($elemName, $elemArgs = '', $elemTheme = '', $dispEvents = '') { parent::__construct($elemName, $elemArgs, $elemTheme, $dispEvents); if (isset($this->mArgs['icon'])) { $this->mIcon = $this->mArgs['icon']; } $this->_fillDefinition(); }
public function getWidgetXml() { $container = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer'); // Get the message of the day $message = $container->getCurrentDomain()->getMotd(); // Check if the motd is empty. If it is empty, get the generic welcome message if (!strlen($message)) { $catalog = new \Innomatic\Locale\LocaleCatalog('innomatic::dashboard_welcome', $container->getCurrentUser()->getLanguage()); $message = $catalog->getStr('welcome_message'); } $xml = '<label><args><label>' . \Shared\Wui\WuiXml::cdata(nl2br($message)) . '</label></args></label>'; return $xml; }
public function __construct($elemName, $elemArgs = '', $elemTheme = '', $dispEvents = '') { parent::__construct($elemName, $elemArgs, $elemTheme, $dispEvents); if (isset($this->mArgs['itemtype'])) { $this->mItemType = $this->mArgs['itemtype']; } if (isset($this->mArgs['itemid'])) { $this->mItemId = $this->mArgs['itemid']; } if (isset($this->mArgs['defaultaction'])) { $this->mDefaultAction = $this->mArgs['defaultaction']; } if (isset($this->mArgs['acltype'])) { $this->mAclType = $this->mArgs['acltype']; } if (isset($this->mArgs['itemownerid'])) { $this->mItemOwnerId = $this->mArgs['itemownerid']; } $this->fillDefinition(); }
public function __construct($elemName, $elemArgs = '', $elemTheme = '', $dispEvents = '') { parent::__construct($elemName, $elemArgs, $elemTheme, $dispEvents); /* if ( isset($this->mArgs['frame'] ) and ( $this->mArgs['frame'] == 'true' or $this->mArgs['frame'] == 'false' ) ) $this->mArgs['frame'] = $this->mArgs['frame']; else $this->mArgs['frame'] = 'true'; */ if (isset($this->mArgs['toolbar']) and ($this->mArgs['toolbar'] == 'true' or $this->mArgs['toolbar'] == 'false')) { $this->mArgs['toolbar'] = $this->mArgs['toolbar']; } else { $this->mArgs['toolbar'] = 'false'; } $this->mArgs['frame'] = 'false'; $this->_fillDefinition(); }
/** * Sets a variable and its value. * * The variable will be extracted to the local scope of the template with * the same name given as parameter to the method. So setting a variable * named "title" will result in a $title variable available to the template. * * The value can be a string, a number or a PhpTemplate instance. In the * latter case, the variable content will be the result of the whole parsed * template of the PhpTemplate instance. * * The proper method for setting arrays is setArray(). * * @since 1.1 * @param string $name Name of the variable. * @param string|number|PhpTemplate $value variable content. * @see setArray() */ public function set($name, $value) { if ($value instanceof \Innomatic\Tpl\Template) { // This is a subtemplate, process it. // $this->vars[$name] = $value->parse(); } elseif (is_array($value)) { // This is an array, it must be passed encoded. // $this->vars[$name] = $value; $this->tplEngine->set($name, \Shared\Wui\WuiXml::encode($value)); } elseif (is_numeric($value)) { // This is a number, it must be passed as it is. // $this->vars[$name] = $value; $this->tplEngine->set($name, $value); } else { // This is a string, it must be passed as a CDATA. // $this->vars[$name] = $value; $this->tplEngine->set($name, \Shared\Wui\WuiXml::cdata($value)); } }
public static function getContentFromXml($name, $xmlText) { $wui_widget = new WuiXml($name, array('definition' => $xmlText)); $wui_widget->build(new \Innomatic\Wui\Dispatch\WuiDispatcher('')); $content = $wui_widget->render(); return $content; }