/** * Launches a panel in the base Innomatic desktop. * * @param string $resource Panel name. */ public function executeBase($resource) { $path = 'base'; // TODO verificare se e' ancora necessario dopo aver creato \Innomatic\Wui\Wui::setTheme() if (!($this->container->getState() == \Innomatic\Core\InnomaticContainer::STATE_SETUP)) { $appCfg = new \Innomatic\Application\ApplicationSettings('innomatic'); if (strlen($appCfg->getKey('wui-root-theme'))) { \Innomatic\Wui\Wui::instance('\\Innomatic\\Wui\\Wui')->setTheme($appCfg->getKey('wui-root-theme')); } unset($appCfg); } else { $path = 'setup'; } if (substr($resource, -1, 1) != '/') { include 'innomatic/desktop/layout/' . $path . '/' . basename($resource) . '.php'; } else { \Innomatic\Webapp\WebAppContainer::instance('\\Innomatic\\Webapp\\WebAppContainer')->getProcessor()->getResponse()->addHeader('P3P', 'CP="CUR ADM OUR NOR STA NID"'); include 'innomatic/desktop/layout/' . $path . '/index.php'; } }
public static function setDomainTheme() { $container = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer'); // Wui theme // $user_settings = new \Innomatic\Domain\User\UserSettings($container->getCurrentDomain()->getDataAccess(), $container->getCurrentUser()->getUserId()); $user_theme = $user_settings->getKey('wui-theme', true); if (!strlen($user_theme)) { $app_cfg = new \Innomatic\Application\ApplicationSettings('innomatic'); if (strlen($app_cfg->getKey('wui-root-theme'))) { $user_theme = $app_cfg->getKey('wui-root-theme'); if (!strlen($user_theme)) { $user_theme = \Innomatic\Wui\Wui::DEFAULT_THEME; } } else { $user_theme = \Innomatic\Wui\Wui::DEFAULT_THEME; } unset($app_cfg); } \Innomatic\Wui\Wui::instance('\\Innomatic\\Wui\\Wui')->setTheme($user_theme); }
/** * Innomatic * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE. * * @copyright 1999-2014 Innoteam Srl * @license http://www.innomatic.io/license/ New BSD License * @link http://www.innomatic.io * @since Class available since Release 5.0 */ function main_page() { $innomatic_locale = new \Innomatic\Locale\LocaleCatalog('innomatic::root_menu', \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getLanguage()); $app_cfg = new \Innomatic\Application\ApplicationSettings('innomatic'); if (is_object(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()) and !(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getState() == \Innomatic\Core\InnomaticContainer::STATE_SETUP)) { $app_cfg = new \Innomatic\Application\ApplicationSettings('innomatic'); $innomatic_logo_disabled = $app_cfg->getKey('innomatic-biglogo-disabled'); } else { $innomatic_logo_disabled = 0; } $wui = \Innomatic\Wui\Wui::instance('\\Innomatic\\Wui\\Wui', true); $wui->loadWidget('page'); $wui->loadWidget('vertgroup'); $wui->loadWidget('button'); $wui->loadWidget('horizbar'); $wui->loadWidget('horizgroup'); $wui->loadWidget('label'); $page_params['title'] = 'Innomatic' . (strlen(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getPlatformName()) ? ' - ' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getPlatformName() . (strlen(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getPlatformGroup()) ? '.' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getPlatformGroup() : '') : ''); $page_params['border'] = 'false'; $wui_page = new WuiPage('page', $page_params); $wui_vertgroup = new WuiVertgroup('vertgroup', array('align' => 'center', 'groupalign' => 'center', 'groupvalign' => 'middle', 'height' => '100%', 'width' => '0%')); $wui_center_group = new WuiVertgroup('center_group', array('align' => 'center', 'groupalign' => 'center', 'groupvalign' => 'middle', 'height' => '0%')); $wui_buttons_group = new WuiHorizgroup('buttons', array('align' => 'middle', 'groupalign' => 'center', 'width' => '0%')); $query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT count(id) AS domains FROM domains'); if ($query->getFields('domains') > 0) { $wui_buttons_group->addChild(new WuiButton('domain', array('label' => $innomatic_locale->getStr('domainadmin'), 'image' => $wui_page->mThemeHandler->mStyle['domainaccess'], 'horiz' => 'true', 'action' => 'domain/', 'width' => 32, 'height' => 32))); } $wui_buttons_group->addChild(new WuiButton('root', array('label' => $innomatic_locale->getStr('rootadmin'), 'image' => $wui_page->mThemeHandler->mStyle['rootaccess'], 'horiz' => 'true', 'action' => 'root/', 'width' => 32, 'height' => 32))); if ($app_cfg->getKey('innomatic-link-disabled') != '1') { $wui_buttons_group->addChild(new WuiButton('innomaticlogo', array('label' => $innomatic_locale->getStr('innomatichome'), 'image' => $wui_page->mThemeHandler->mStyle['innomaticminilogo'], 'horiz' => 'true', 'action' => 'http://www.innomatic.io/', 'width' => 32, 'height' => 32))); } if ($app_cfg->getKey('serviceprovider-link-disabled') != '1') { $serviceprovider_link_filename = $app_cfg->getKey('serviceprovider-link-filename'); if (strlen($serviceprovider_link_filename) and file_exists(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'shared/' . $serviceprovider_link_filename)) { $wui_buttons_group->addChild(new WuiButton('userlogo', array('label' => $app_cfg->getKey('serviceprovider-name'), 'image' => \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getBaseUrl(false) . '/shared/' . $serviceprovider_link_filename, 'horiz' => 'true', 'action' => $app_cfg->getKey('serviceprovider-url')))); } } $wui_logos_group = new WuiVertgroup('buttons_group', array('align' => 'center', 'groupalign' => 'center', 'groupvalign' => 'middle', 'height' => '0%')); if ($innomatic_logo_disabled != '1') { if (\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getEdition() == \Innomatic\Core\InnomaticContainer::EDITION_MULTITENANT) { $edition = '_asp'; } else { $edition = '_enterprise'; } if (isset($wui_page->mThemeHandler->mStyle['biglogo' . $edition])) { $biglogo_image = $wui_page->mThemeHandler->mStyle['biglogo' . $edition]; } else { $biglogo_image = $wui_page->mThemeHandler->mStyle['biglogo']; } $wui_button = new WuiButton('button', array('action' => ' http://www.innomatic.io', 'target' => '_top', 'image' => $biglogo_image, 'highlight' => 'false')); $wui_logos_group->addChild($wui_button); } if (is_object(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()) and \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getState() != \Innomatic\Core\InnomaticContainer::STATE_SETUP) { // Service Provider personalization // $serviceprovider_biglogo_filename = $app_cfg->getKey('serviceprovider-biglogo-filename'); $serviceprovider_url = $app_cfg->getKey('serviceprovider-url'); if ($app_cfg->getKey('serviceprovider-biglogo-disabled') != '1') { if (strlen($serviceprovider_biglogo_filename) and file_exists(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'shared/' . $serviceprovider_biglogo_filename)) { $serviceprovider_button = new WuiButton('serviceproviderbutton', array('action' => strlen($serviceprovider_url) ? $serviceprovider_url : ' http://www.innomatic.io', 'target' => '_top', 'image' => \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getBaseUrl(false) . '/shared/' . $serviceprovider_biglogo_filename, 'highlight' => 'false')); $wui_logos_group->addChild($serviceprovider_button); } } } $wui_center_group->addChild($wui_buttons_group); $wui_center_group->addChild(new WuiHorizBar('hb')); $wui_center_group->addChild($wui_logos_group); $label_text = strlen(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getPlatformName()) ? \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getPlatformName() . (strlen(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getPlatformGroup()) ? '.' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getPlatformGroup() : '') : ''; if (strlen($label_text)) { //$wui_center_group->addChild(new WuiHorizBar('hb')); $wui_center_group->addChild(new WuiLabel('label', array('label' => $label_text, 'color' => $wui_page->mThemeHandler->mColorsSet['buttons']['text']))); } $wui_vertgroup->addChild($wui_center_group); $wui_page->addChild($wui_vertgroup); $wui->addChild($wui_page); $wui->render(); }
function main_default($eventData) { global $wuiMainFrame, $wuiTitleBar, $innomaticLocale, $actionDispatcher, $wuiMainStatus, $wuiComments, $compressedOb; $appCfg = new \Innomatic\Application\ApplicationSettings('innomatic'); $themesQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT name,catalog FROM wui_themes '); while (!$themesQuery->eof) { $tmpLocale = new \Innomatic\Locale\LocaleCatalog($themesQuery->getFields('catalog'), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getLanguage()); $elements[$themesQuery->getFields('name')] = $tmpLocale->getStr($themesQuery->getFields('name')); $themesQuery->moveNext(); } asort($elements); $themesXmlDef = '<vertgroup><name>vgroup</name><args><halign>center</halign></args><children> <form><name>theme</name><args><action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'default', ''), array('action', 'settheme', '')))) . '</action></args><children> <grid><name>themegrid</name><children> <label row="0" col="0"><name>themelabel</name><args><label type="encoded">' . urlencode($innomaticLocale->getStr('themes_label')) . '</label><bold>true</bold></args></label> <listbox row="1" col="0"><name>theme</name><args><elements type="array">' . WuiXml::encode($elements) . '</elements><default>' . \Innomatic\Wui\Wui::instance('\\Innomatic\\Wui\\Wui')->getThemeName() . '</default><disp>action</disp><size>10</size></args></listbox> </children></grid> <submit><name>submit</name><args><caption type="encoded">' . urlencode($innomaticLocale->getStr('settheme_submit')) . '</caption></args></submit> </children></form> </children></vertgroup>'; // Service provider settings // Service Provider // $serviceProviderFrame = new WuiVertframe('serviceproviderframe'); $serviceProviderVGroup = new WuiVertgroup('serviceprovidervgroup', array('width' => '100%')); $serviceProviderVGroup->addChild(new WuiLabel('serviceproviderlabel', array('label' => $innomaticLocale->getStr('serviceproviderframe_label'), 'bold' => 'true'))); $serviceProviderGrid = new WuiGrid('serviceprovidergrid', array('rows' => '4', 'cols' => '2')); // Service Provider name // $serviceProviderGrid->addChild(new WuiLabel('serviceprovidername_label', array('label' => $innomaticLocale->getStr('serviceprovidername_label'))), 0, 0); $serviceProviderGrid->addChild(new WuiString('serviceprovidername', array('disp' => 'action', 'size' => '30', 'value' => $appCfg->getKey('serviceprovider-name'))), 0, 1); // Service Provider url // $serviceProviderGrid->addChild(new WuiLabel('serviceproviderurl_label', array('label' => $innomaticLocale->getStr('serviceproviderurl_label'))), 1, 0); $serviceProviderGrid->addChild(new WuiString('serviceproviderurl', array('disp' => 'action', 'size' => '30', 'value' => $appCfg->getKey('serviceprovider-url'))), 1, 1); // Service Provider big logo // $serviceProviderGrid->addChild(new WuiLabel('serviceproviderbiglogo_label', array('label' => $innomaticLocale->getStr('serviceproviderbiglogo_label'))), 2, 0); $serviceProviderGrid->addChild(new WuiFile('serviceproviderbiglogo', array('disp' => 'action')), 2, 1); // Service Provider link logo // $serviceProviderGrid->addChild(new WuiLabel('serviceproviderlogo_label', array('label' => $innomaticLocale->getStr('serviceproviderlogo_label'))), 3, 0); $serviceProviderGrid->addChild(new WuiFile('serviceproviderlinklogo', array('disp' => 'action')), 3, 1); $serviceProviderVGroup->addChild($serviceProviderGrid); $serviceProviderVGroup->addChild(new WuiSubmit('serviceprovidersubmit', array('caption' => $innomaticLocale->getStr('serviceprovider_submit')))); $formEventsCall = new \Innomatic\Wui\Dispatch\WuiEventsCall(); $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'setserviceprovider', '')); $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'default', '')); $serviceProviderForm = new WuiForm('setserviceproviderform', array('action' => $formEventsCall->getEventsCallString())); $serviceProviderForm->addChild($serviceProviderVGroup); // Enabled icons // $enableVGroup = new WuiVertgroup('enablevgroup', array('width' => '100%')); $enableVGroup->addChild(new WuiLabel('enablelabel', array('label' => $innomaticLocale->getStr('enabled_icons_label'), 'bold' => 'true'))); $enableGrid = new WuiGrid('enablegrid', array('rows' => '5', 'cols' => '2')); // Innomatic site link // $enableGrid->addChild(new WuiLabel('innomaticlabel', array('label' => $innomaticLocale->getStr('innomatic_link_enabled_label'))), 0, 1); $enableGrid->addChild(new WuiCheckBox('innomaticicon', array('disp' => 'action', 'checked' => $appCfg->getKey('innomatic-link-disabled') ? 'false' : 'true')), 0, 0); // Service Provider link // $enableGrid->addChild(new WuiLabel('serviceprovidericonlabel', array('label' => $innomaticLocale->getStr('serviceprovider_link_enabled_label'))), 1, 1); $enableGrid->addChild(new WuiCheckBox('serviceprovidericon', array('disp' => 'action', 'checked' => $appCfg->getKey('serviceprovider-link-disabled') ? 'false' : 'true')), 1, 0); // Innomatic big logo // $enableGrid->addChild(new WuiLabel('innomaticbigiconlabel', array('label' => $innomaticLocale->getStr('innomatic_biglogo_enabled_label'))), 2, 1); $enableGrid->addChild(new WuiCheckBox('innomaticbigicon', array('disp' => 'action', 'checked' => $appCfg->getKey('innomatic-biglogo-disabled') ? 'false' : 'true')), 2, 0); // Service Provider logo // $enableGrid->addChild(new WuiLabel('serviceprovidericonlabel', array('label' => $innomaticLocale->getStr('serviceprovider_biglogo_enabled_label'))), 3, 1); $enableGrid->addChild(new WuiCheckBox('serviceproviderbigicon', array('disp' => 'action', 'checked' => $appCfg->getKey('serviceprovider-biglogo-disabled') ? 'false' : 'true')), 3, 0); $enableVGroup->addChild($enableGrid); $enableVGroup->addChild(new WuiSubmit('enablesubmit', array('caption' => $innomaticLocale->getStr('enable_submit')))); $formEventsCall = new \Innomatic\Wui\Dispatch\WuiEventsCall(); $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'setenabledicons', '')); $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'default', '')); $enableForm = new WuiForm('setenableform', array('action' => $formEventsCall->getEventsCallString())); $enableForm->addChild($enableVGroup); // Advanced settings // $advancedVGroup = new WuiVertgroup('enablevgroup', array('width' => '100%')); $advancedVGroup->addChild(new WuiLabel('enablelabel', array('label' => $innomaticLocale->getStr('advancedsettings_label'), 'bold' => 'true'))); $advancedGrid = new WuiGrid('enablegrid', array('rows' => '2', 'cols' => '2')); // Compressed output buffering // $advancedGrid->addChild(new WuiLabel('compressed-ob-label', array('label' => $innomaticLocale->getStr('compressed-ob_label'))), 0, 1); if (!strlen($compressedOb)) { if (\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getConfig()->value('CompressedOutputBuffering') == '1') { $compressedOb = 'true'; } else { $compressedOb = 'false'; } } $advancedGrid->addChild(new WuiCheckBox('compressed-ob', array('disp' => 'action', 'checked' => $compressedOb)), 0, 0); // WUI code comments // $advancedGrid->addChild(new WuiLabel('wui-comments-label', array('label' => $innomaticLocale->getStr('wui-comments_label'))), 1, 1); if (!strlen($wuiComments)) { if (\Innomatic\Wui\Wui::showSourceComments()) { $wuiComments = 'true'; } else { $wuiComments = 'false'; } } $advancedGrid->addChild(new WuiCheckBox('wui-comments', array('disp' => 'action', 'checked' => $wuiComments)), 1, 0); $advancedVGroup->addChild($advancedGrid); $advancedVGroup->addChild(new WuiSubmit('enablesubmit', array('caption' => $innomaticLocale->getStr('advanced_submit')))); $formEventsCall = new \Innomatic\Wui\Dispatch\WuiEventsCall(); $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'setadvanced', '')); $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'default', '')); $advancedForm = new WuiForm('setenableform', array('action' => $formEventsCall->getEventsCallString())); $advancedForm->addChild($advancedVGroup); $tabHeaders[0]['label'] = $innomaticLocale->getStr('themes_title'); $tabHeaders[1]['label'] = $innomaticLocale->getStr('serviceproviderframe_label'); $tabHeaders[2]['label'] = $innomaticLocale->getStr('enabled_icons_label'); $tabHeaders[3]['label'] = $innomaticLocale->getStr('advancedsettings_label'); $tab = new WuiTab('interface', array('tabactionfunction' => 'interface_tab_action_builder', 'activetab' => isset($eventData['activetab']) ? $eventData['activetab'] : '', 'tabs' => $tabHeaders)); $tab->addChild(new WuiXml('page', array('definition' => $themesXmlDef))); $tab->addChild($serviceProviderForm); $tab->addChild($enableForm); $tab->addChild($advancedForm); $wuiMainFrame->addChild($tab); $wuiTitleBar->mTitle .= ' - ' . $innomaticLocale->getStr('default_title'); }
* @since Class available since Release 5.0 */ use Shared\Wui; $container = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer'); $wui = \Innomatic\Wui\Wui::instance('\\Innomatic\\Wui\\Wui'); $wui->loadWidget('button'); $wui->loadWidget('grid'); $wui->loadWidget('horizframe'); $wui->loadWidget('horizgroup'); $wui->loadWidget('image'); $wui->loadWidget('label'); $wui->loadWidget('link'); $wui->loadWidget('page'); $wui->loadWidget('vertframe'); $wui->loadWidget('vertgroup'); $app_cfg = new \Innomatic\Application\ApplicationSettings('innomatic'); $wuiPage = new WuiPage('page', array('title' => 'Innomatic')); $wui_vertgroup = new WuiVertgroup('vertgroup', array('align' => 'center', 'groupalign' => 'center', 'groupvalign' => 'middle', 'height' => '100%')); $wui_buttons_group = new WuiVertgroup('buttons_group', array('align' => 'center', 'groupalign' => 'center', 'groupvalign' => 'middle', 'height' => '0%')); if ($app_cfg->getKey('innomatic-biglogo-disabled') != '1') { if ($container->getEdition() == \Innomatic\Core\InnomaticContainer::EDITION_MULTITENANT) { $edition = '_asp'; } else { $edition = '_enterprise'; } if (isset($wuiPage->mThemeHandler->mStyle['biglogo' . $edition])) { $biglogo_image = $wuiPage->mThemeHandler->mStyle['biglogo' . $edition]; } else { $biglogo_image = $wuiPage->mThemeHandler->mStyle['biglogo']; } $wui_button = new WuiButton('button', array('action' => ' http://www.innomatic.io', 'target' => '_top', 'image' => $biglogo_image, 'highlight' => 'false'));