protected function generateSource() { $result = false; $this->mLayout = ($this->mComments ? '<!-- begin ' . $this->mName . ' submit -->' : '') . '<input' . (isset($this->mArgs['id']) ? ' id="' . $this->mArgs['id'] . '"' : '') . $this->getEventsCompleteString() . ' class="normal" type="submit"' . ($this->mArgs['caption'] ? ' value="' . \Innomatic\Wui\Wui::utf8_entities($this->mArgs['caption']) . '"' : '') . ' tabindex="' . $this->mArgs['tabindex'] . '"' . ((isset($this->mArgs['needconfirm']) and $this->mArgs['needconfirm'] == 'true') ? ' onclick="return confirm(\'' . $this->mArgs['confirmmessage'] . '\')"' : '') . ((isset($this->mArgs['hint']) and $this->mArgs['hint']) ? ' alt="' . $this->mArgs['hint'] . '"' : '') . '>' . ($this->mComments ? '<!-- end ' . $this->mName . " submit -->\n" : ''); $result = true; return $result; }
protected function generateSource() { $result = false; $event_data = new WuiEventRawData($this->mDisp, $this->mName); $this->mLayout = ($this->mComments ? "<!-- begin " . $this->mName . " push button -->" : "") . '<button' . (isset($this->mArgs['id']) ? ' id="' . $this->mArgs['id'] . '"' : '') . $this->getEventsCompleteString() . ' class="normal" ' . "name=\"" . $event_data->getDataString() . "\"" . (strlen($this->mValue) ? " value=\"" . \Innomatic\Wui\Wui::utf8_entities($this->mValue) . "\"" : "") . ' tabindex="' . $this->mTabIndex . '"' . (strlen($this->mType) ? " type=\"" . $this->mType . "\"" : "") . ($this->mNeedConfirm == 'true' ? ' onclick="return confirm(\'' . $this->mConfirmMessage . '\')"' : '') . ">" . $this->mLabel . (strlen($this->mImage) ? "<img src=\"" . $this->mImage . "\"" . (strlen($this->mHint) ? " alt=\"" . \Innomatic\Wui\Wui::utf8_entities($this->mHint) . "\"" : "") . ">" : "") . "</button>" . ($this->mComments ? "<!-- end " . $this->mName . " push button -->\n" : ""); $result = true; return $result; }
protected function generateSource() { $result = false; $event_data = new \Innomatic\Wui\Dispatch\WuiEventRawData($this->mDisp, $this->mName); $this->mLayout = ($this->mComments ? '<!-- begin ' . $this->mName . ' radio -->' : '') . '<table border="0" cellpadding="0" cellspacing="0"><tr><td valign="middle"><input' . (isset($this->mArgs['id']) ? ' id="' . $this->mArgs['id'] . '"' : '') . $this->getEventsCompleteString() . ' class="normal" ' . (strlen($this->mHint) ? 'onMouseOver="wuiHint(\'' . str_replace("'", "\\'", $this->mHint) . '\');" onMouseOut="wuiUnHint();" ' : '') . 'type="radio" ' . 'name="' . $event_data->getDataString() . '"' . (strlen($this->mValue) ? ' value="' . $this->mValue . '"' : '') . ' tabindex="' . $this->mTabIndex . '"' . (strlen($this->mReadOnly) ? ' disabled' : '') . ($this->mChecked == 'true' ? ' checked' : '') . '></td><td valign="middle">' . \Innomatic\Wui\Wui::utf8_entities($this->mLabel) . '</td></tr></table>' . ($this->mComments ? '<!-- end ' . $this->mName . " radio -->\n" : ''); $result = true; return $result; }
protected function generateSource() { $result = false; if (isset($this->mArgs['elements']) and is_array($this->mArgs['elements']) and count($this->mArgs['elements'])) { $event_data = new \Innomatic\Wui\Dispatch\WuiEventRawData($this->mArgs['disp'], $this->mName); $this->mLayout = ($this->mComments ? '<!-- begin ' . $this->mName . " combobox -->\n" : '') . '<select' . (isset($this->mArgs['id']) ? ' id="' . $this->mArgs['id'] . '"' : '') . $this->getEventsCompleteString() . ' ' . ((isset($this->mArgs['hint']) and strlen($this->mArgs['hint'])) ? 'onMouseOver="wuiHint(\'' . str_replace("'", "\\'", $this->mArgs['hint']) . '\');" onMouseOut="wuiUnHint();" ' : '') . 'name="' . $event_data->getDataString() . "\"" . ' tabindex="' . $this->mArgs['tabindex'] . '"' . ">\n"; reset($this->mArgs['elements']); while (list($key, $val) = each($this->mArgs['elements'])) { $this->mLayout .= '<option value="' . $key . '"' . ((isset($this->mArgs['default']) and $this->mArgs['default'] == $key) ? ' selected' : '') . '>' . \Innomatic\Wui\Wui::utf8_entities($val) . "</option>\n"; } $this->mLayout .= $this->mComments ? "</select>\n<!-- end " . $this->mName . " combobox -->\n" : ''; $result = true; } return true; }
protected function generateSource() { $this->mLayout = $this->mComments ? '<!-- begin ' . $this->mName . ' statusbar -->' : ''; if (isset($this->mArgs['status']) and strlen($this->mArgs['status'])) { $this->mLayout .= '<table border="0" ' . (isset($this->mArgs['width']) ? 'width="' . $this->mArgs['width'] . '" ' : '') . ' cellspacing="0"' . ' cellpadding="3" bgcolor="' . $this->mThemeHandler->mColorsSet['statusbars']['bgcolor'] . "\">\n"; $this->mLayout .= "<tr>\n"; $this->mLayout .= '<td class="status" nowrap style="white-space: nowrap;' . ((isset($this->mArgs['color']) and strlen($this->mArgs['color'])) ? 'color:' . $this->mArgs['color'] . ';' : '') . '">' . ((isset($this->mArgs['status']) and strlen($this->mArgs['status'])) ? \Innomatic\Wui\Wui::utf8_entities($this->mArgs['status']) : ' ') . "</td>\n"; if ($this->mArgs['width'] == "100%") { $this->mLayout .= '<td width="100%"> </td>'; } $this->mLayout .= "</tr>\n"; $this->mLayout .= "</table>\n"; } $this->mLayout .= $this->mComments ? '<!-- end ' . $this->mName . " statusbar -->\n" : ''; return true; }
protected function generateSource() { if (is_array($this->mArgs['elements'])) { $event_data = new \Innomatic\Wui\Dispatch\WuiEventRawData(isset($this->mArgs['disp']) ? $this->mArgs['disp'] : '', $this->mName); $this->mLayout = ($this->mComments ? '<!-- begin ' . $this->mName . " listbox -->\n" : '') . '<select' . (isset($this->mArgs['id']) ? ' id="' . $this->mArgs['id'] . '"' : '') . $this->getEventsCompleteString() . ' ' . ((isset($this->mArgs['hint']) and strlen($this->mArgs['hint'])) ? 'onMouseOver="wuiHint(\'' . str_replace("'", "\\'", $this->mArgs['hint']) . '\');" onMouseOut="wuiUnHint();" ' : '') . 'name="' . $event_data->getDataString() . ((isset($this->mArgs['multiselect']) and $this->mArgs['multiselect'] == 'true') ? '[]' : '') . '" size="' . $this->mArgs['size'] . '"' . ((isset($this->mArgs['multiselect']) and $this->mArgs['multiselect'] == 'true') ? ' multiple' : '') . ' tabindex="' . $this->mArgs['tabindex'] . '"' . ">\n"; reset($this->mArgs['elements']); if (sizeof($this->mArgs['elements'])) { while (list($key, $val) = each($this->mArgs['elements'])) { $this->mLayout .= '<option value="' . $key . '"' . ((isset($this->mArgs['default']) and is_array($this->mArgs['default']) and in_array($key, $this->mArgs['default'])) ? ' selected' : '') . '>' . \Innomatic\Wui\Wui::utf8_entities($val) . "</option>\n"; } } else { $this->mLayout .= '<option value=""> </option>' . "\n"; } $this->mLayout .= "</select>\n" . ($this->mComments ? '<!-- end ' . $this->mName . " listbox -->\n" : ''); } return true; }
protected function generateSource() { $result = false; $event_data = new \Innomatic\Wui\Dispatch\WuiEventRawData(isset($this->mArgs['disp']) ? $this->mArgs['disp'] : '', $this->mName); $check_script = ''; if ((isset($this->mArgs['required']) and $this->mArgs['required'] == 'true') || (isset($this->mArgs['integer']) and $this->mArgs['integer'] == 'true') || (isset($this->mArgs['email']) and $this->mArgs['email'] == 'true')) { $check_script = ' <script language="JavaScript" type="text/javascript"> <!-- requiredFields[requiredFields.length] = new Array( "' . $event_data->getDataString() . '", "' . $this->mArgs['checkmessage'] . '"' . ($this->mArgs['required'] == 'true' ? ', "required"' : '') . ($this->mArgs['integer'] == 'true' ? ', "integer"' : '') . ($this->mArgs['email'] == 'true' ? ', "email"' : '') . ' ); --> </script>'; } $this->mLayout = ($this->mComments ? '<!-- begin ' . $this->mName . ' textarea -->' : '') . '<textarea' . (isset($this->mArgs['id']) ? ' id="' . $this->mArgs['id'] . '"' : '') . ' ' . (isset($this->mArgs['maxlength']) ? ' maxlength="' . $this->mArgs['maxlength'] . '"' : '') . ((isset($this->mArgs['hint']) and strlen($this->mArgs['hint'])) ? 'onMouseOver="wuiHint(\'' . str_replace("'", "\\'", $this->mArgs['hint']) . '\');" onMouseOut="wuiUnHint();" ' : '') . 'name="' . $event_data->getDataString() . '"' . (strlen($this->mArgs['rows']) ? ' rows="' . $this->mArgs['rows'] . '"' : '') . (strlen($this->mArgs['bgcolor']) ? ' STYLE="background-color: ' . $this->mArgs['bgcolor'] . ';"' : '') . (strlen($this->mArgs['cols']) ? ' cols="' . $this->mArgs['cols'] . '"' : '') . ' tabindex="' . $this->mArgs['tabindex'] . '"' . ((isset($this->mArgs['readonly']) and strlen($this->mArgs['readonly'])) ? ' readonly' : '') . '>' . ((isset($this->mArgs['value']) and strlen($this->mArgs['value'])) ? \Innomatic\Wui\Wui::utf8_entities($this->mArgs['value']) : '') . '</textarea>' . $check_script . ($this->mComments ? '<!-- end ' . $this->mName . " textarea -->\n" : ''); $result = true; return $result; }
function main_showrootwebserviceslog($eventData) { global $gLocale, $gPageTitle, $gXmlDefinition, $gToolbars; $gWui = \Innomatic\Wui\Wui::instance('\\Innomatic\\Wui\\Wui'); $gWui->loadWidget('vertgroup'); $gWui->loadWidget('toolbars'); $logContent = ''; if (file_exists(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/log/webservices.log')) { $cleanLogAction = new \Innomatic\Wui\Dispatch\WuiEventsCall(); $cleanLogAction->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'showrootwebserviceslog', '')); $cleanLogAction->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'cleanrootwebserviceslog', '')); $gToolbars['logs']['cleanlog'] = array('view' => array('label' => $gLocale->getStr('cleanlog_button'), 'themeimage' => 'documentdelete', 'horiz' => 'true', 'action' => $cleanLogAction->getEventsCallString())); if (file_exists(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/log/webservices.log')) { $logContent = file_get_contents(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/log/webservices.log'); } } $gXmlDefinition = '<vertgroup><name /> <children> <text><name>rootlog</name> <args> <disp>action</disp> <readonly>true</readonly> <rows>20</rows> <cols>120</cols> <value type="encoded">' . urlencode(\Innomatic\Wui\Wui::utf8_entities($logContent)) . '</value> </args> </text> </children> </vertgroup>'; $gPageTitle .= ' - ' . $gLocale->getStr('rootwebserviceslog_title'); }
function main_applicationlog($eventData) { global $gLocale, $gLocale, $gPageTitle, $wuiMainVertGroup, $gPageContent; $query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT appid FROM applications WHERE id=' . $eventData['appid']); $applicationData = $query->getFields(); $gPageContent = new WuiVertgroup('vgroup'); $appLogContent = ''; if (file_exists(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/applications/' . $applicationData['appid'] . '/application.log')) { $logToolbar = new WuiToolBar('logbar'); $cleanLogAction = new \Innomatic\Wui\Dispatch\WuiEventsCall(); $cleanLogAction->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'default', '')); $cleanLogAction->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'cleanmodlog', array('appid' => $applicationData['appid']))); $cleanLogButton = new WuiButton('cleanlogbutton', array('label' => $gLocale->getStr('cleanlog_button'), 'themeimage' => 'documentdelete', 'action' => $cleanLogAction->getEventsCallString())); $logToolbar->addChild($cleanLogButton); $logFrame = new WuiHorizframe('logframe'); $logFrame->addChild($logToolbar); $wuiMainVertGroup->addChild($logFrame); $appLogContent = file_get_contentes(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/applications/' . $applicationData['appid'] . '/application.log'); } $wuiVGroup->addChild(new WuiText('modlog', array('disp' => 'action', 'readonly' => 'true', 'value' => \Innomatic\Wui\Wui::utf8_entities($appLogContent), 'rows' => '20', 'cols' => '120')), 0, 1); $gPageTitle .= ' - ' . $applicationData['appid'] . ' - ' . $gLocale->getStr('modlog.title'); }
protected function generateSource() { $result = false; $event_data = new \Innomatic\Wui\Dispatch\WuiEventRawData($this->mDisp, $this->mName); $calendar_dateformat = str_replace('/', '\\/', $this->mLocaleCountryHandler->ShortDateFormat()); $calendar_dateformat = str_replace('d', 'DD', $calendar_dateformat); $calendar_dateformat = str_replace('m', 'MM', $calendar_dateformat); $calendar_dateformat = str_replace('y', 'YY', $calendar_dateformat); $calendar_dateformat = str_replace('Y', 'YYYY', $calendar_dateformat); $this->mLayout = ''; if ($this->mType == 'date') { $this->mLayout .= "<script language=\"JavaScript\">\n\nCalendar.Title = '" . $this->mLocaleHandler->getStr('calendar') . "';\nCalendar.TableGridColor = '" . $this->mThemeHandler->mColorsSet['tables']['gridcolor'] . "';\nCalendar.TableBgColor = '" . $this->mThemeHandler->mColorsSet['tables']['bgcolor'] . "';\nCalendar.TableHeaderBgColor = '" . $this->mThemeHandler->mColorsSet['tables']['headerbgcolor'] . "';\n\nCalendar.WeekDays = new Array( '" . $this->mLocaleHandler->getStr('mon') . "',\n '" . $this->mLocaleHandler->getStr('tue') . "',\n '" . $this->mLocaleHandler->getStr('wed') . "',\n '" . $this->mLocaleHandler->getStr('thu') . "',\n '" . $this->mLocaleHandler->getStr('fri') . "',\n '" . $this->mLocaleHandler->getStr('sat') . "',\n '" . $this->mLocaleHandler->getStr('sun') . "');\n\nCalendar.Months = new Array( '" . $this->mLocaleHandler->getStr('january') . "',\n '" . $this->mLocaleHandler->getStr('february') . "',\n '" . $this->mLocaleHandler->getStr('march') . "',\n '" . $this->mLocaleHandler->getStr('april') . "',\n '" . $this->mLocaleHandler->getStr('may') . "',\n '" . $this->mLocaleHandler->getStr('june') . "',\n '" . $this->mLocaleHandler->getStr('july') . "',\n '" . $this->mLocaleHandler->getStr('august') . "',\n '" . $this->mLocaleHandler->getStr('september') . "',\n '" . $this->mLocaleHandler->getStr('october') . "',\n '" . $this->mLocaleHandler->getStr('november') . "',\n '" . $this->mLocaleHandler->getStr('december') . "');\n</script>"; } $this->mLayout .= ($this->mComments ? '<!-- begin ' . $this->mName . ' date -->' : '') . '<span style="white-space: nowrap;"><input' . (isset($this->mArgs['id']) ? ' id="' . $this->mArgs['id'] . '"' : '') . $this->getEventsCompleteString() . ' class="normal" ' . (strlen($this->mHint) ? 'onMouseOver="wuiHint(\'' . str_replace("'", "\\'", $this->mHint) . '\');" onMouseOut="wuiUnHint();" ' : '') . 'type="text" name="' . $event_data->getDataString() . '"' . ' tabindex="' . $this->mTabIndex . '"' . (is_array($this->mValue) ? ' value="' . \Innomatic\Wui\Wui::utf8_entities($this->mType == 'date' ? $this->mLocaleCountryHandler->formatShortArrayDate($this->mValue) : $this->mLocaleCountryHandler->formatArrayTime($this->mValue)) . '"' : '') . ($this->mHint ? ' alt="' . $this->mHint . '"' : '') . (strlen($this->mSize) ? ' size="' . $this->mSize . '"' : '') . (strlen($this->mMaxLength) ? ' maxlength="' . $this->mMaxLength . '"' : '') . (strlen($this->mReadOnly) ? ' readonly' : '') . '>' . ($this->mReadOnly != 'true' ? $this->mType == 'date' ? " <a href=\"javascript:show_calendar( 'forms[' + GetFormNumber('" . $event_data->getDataString() . "') + '].elements[' + GetElementNumber('" . $event_data->getDataString() . "') + ']'," . (is_array($this->mValue) ? "'" . sprintf('%u', $this->mValue['mon'] - 1) . "','" . $this->mValue['year'] . "'" : 'null,null') . ",'" . $calendar_dateformat . "');\">" . '<img src="' . $this->mThemeHandler->mIconsBase . $this->mThemeHandler->mIconsSet['mini']['icons']['base'] . '/icons/' . $this->mThemeHandler->mIconsSet['icons']['calendar']['file'] . '" alt="" border="0" style="width: 16px; height: 16px;"></a>' : '' : '') . '</span>' . ($this->mComments ? '<!-- end ' . $this->mName . " string -->\n" : ''); return true; }
protected function generateSourceBegin() { $dashboard_id = ''; $prefs_id = ''; $container = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer'); // Check if Innomatic is in setup phase if (!($container->getState() == \Innomatic\Core\InnomaticContainer::STATE_SETUP)) { // Check if Innomatic is in root or domain mode if (!$container->isDomainStarted()) { // Root mode $root_db = $container->getDataAccess(); $groups_query = $root_db->execute('SELECT * FROM root_panels_groups ORDER BY name'); $num_groups = $groups_query->getNumberRows(); $tabs = array(); $tab_pages = array(); if ($num_groups > 0) { $cont_a = 0; unset($el); while (!$groups_query->eof) { $group_apps = false; $group_data = $groups_query->getFields(); if (strlen($group_data['catalog'])) { $tmp_locale = new LocaleCatalog($group_data['catalog'], $container->getLanguage()); $el[$group_data['id']]['groupname'] = $tmp_locale->getStr($group_data['name']); } else { $el[$group_data['id']]['groupname'] = $group_data['name']; } $pagesquery = $root_db->execute('SELECT * FROM root_panels WHERE groupid=' . $group_data['id'] . ' ORDER BY name'); if ($pagesquery) { $pagesnum = $pagesquery->getNumberRows(); if ($pagesnum > 0) { $group_apps = true; $cont_b = 0; while (!$pagesquery->eof) { $pagedata = $pagesquery->getFields(); if (strlen($pagedata['catalog']) > 0) { $tmploc = new LocaleCatalog($pagedata['catalog'], $container->getLanguage()); $descstr = $tmploc->getStr($pagedata['name']); } $tmp_eventscall = new \Innomatic\Wui\Dispatch\WuiEventsCall($pagedata['name']); $tmp_eventscall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'default', '')); if (strlen($pagedata['themeicontype'])) { $imageType = $pagedata['themeicontype']; } else { $imageType = 'icons'; } strlen($pagedata['themeicon']) and isset($this->mThemeHandler->mIconsSet[$imageType][$pagedata['themeicon']]) ? $imageUrl = $this->mThemeHandler->mIconsBase . $this->mThemeHandler->mIconsSet[$imageType][$pagedata['themeicon']]['base'] . '/' . $imageType . '/' . $this->mThemeHandler->mIconsSet[$imageType][$pagedata['themeicon']]['file'] : ($imageUrl = $pagedata['iconfile']); $el[$group_data['id']]['groupelements'][$cont_b]['name'] = $descstr; $el[$group_data['id']]['groupelements'][$cont_b]['image'] = $imageUrl; $el[$group_data['id']]['groupelements'][$cont_b]['action'] = $tmp_eventscall->getEventsCallString(); $el[$group_data['id']]['groupelements'][$cont_b]['themesized'] = 'true'; unset($tmp_eventscall); $cont_b++; $pagesquery->moveNext(); } } } // TODO Check if this section is for compatibility only - and remove it if ($group_data['name'] == 'innomatic') { $pagesquery = $root_db->execute('SELECT * FROM root_panels WHERE groupid=0 OR groupid IS NULL ORDER BY name'); if ($pagesquery) { $pagesnum = $pagesquery->getNumberRows(); if ($pagesnum > 0) { $group_apps = true; while (!$pagesquery->eof) { $pagedata = $pagesquery->getFields(); if (strlen($pagedata['catalog']) > 0) { $tmploc = new LocaleCatalog($pagedata['catalog'], $container->getLanguage()); $descstr = $tmploc->getStr($pagedata['name']); } $tmp_eventscall = new \Innomatic\Wui\Dispatch\WuiEventsCall($pagedata['name']); $tmp_eventscall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'default', '')); $el[$group_data['id']]['groupelements'][$cont_b]['name'] = $descstr; $el[$group_data['id']]['groupelements'][$cont_b]['image'] = $pagedata['iconfile']; $el[$group_data['id']]['groupelements'][$cont_b]['action'] = $tmp_eventscall->getEventsCallString(); $el[$group_data['id']]['groupelements'][$cont_b]['themesized'] = 'true'; unset($tmp_eventscall); $cont_b++; $pagesquery->moveNext(); } } } } $groups_query->moveNext(); if ($group_apps) { $cont_a++; } else { unset($el[$group_data['id']]); } } } } else { // Domain mode $tmpperm = new \Innomatic\Desktop\Auth\DesktopPanelAuthorizator($container->getCurrentDomain()->getDataAccess(), $container->getCurrentUser()->getGroup()); $tabs = array(); $tab_pages = array(); $groupsquery = $container->getCurrentDomain()->getDataAccess()->execute('SELECT * FROM domain_panels_groups ORDER BY name'); $numgroups = $groupsquery->getNumberRows(); if ($numgroups > 0) { $prefs_id = 0; $tools_id = 0; $dashboard_id = 0; $cont = 0; unset($el); while (!$groupsquery->eof) { $group_apps = false; $groupdata = $groupsquery->getFields(); if ($tmpperm->check($groupdata['id'], 'group') != \Innomatic\Desktop\Auth\DesktopPanelAuthorizator::NODE_NOTENABLED) { switch ($groupdata['name']) { case 'tools': $tools_id = $groupdata['id']; break; case 'preferences': $prefs_id = $groupdata['id']; break; case 'dashboard': $dashboard_id = $groupdata['id']; break; } if (strlen($groupdata['catalog']) > 0) { $tmploc = new LocaleCatalog($groupdata['catalog'], $container->getCurrentUser()->getLanguage()); $descstr = $tmploc->getStr($groupdata['name']); $el[$groupdata['id']]['groupname'] = $descstr; } else { $el[$group_data['id']]['groupname'] = $groupdata['name']; } $pagesquery = $container->getCurrentDomain()->getDataAccess()->execute('SELECT * FROM domain_panels WHERE groupid = ' . $groupdata['id'] . ' AND (hidden != ' . $container->getCurrentDomain()->getDataAccess()->formatText($container->getCurrentDomain()->getDataAccess()->fmttrue) . ' OR hidden IS NULL) ORDER BY name'); $pagesnum = $pagesquery->getNumberRows(); if ($pagesnum > 0) { $group_apps = true; $contb = 0; while (!$pagesquery->eof) { $pagedata = $pagesquery->getFields(); if ($tmpperm->check($pagedata['id'], 'page') != \Innomatic\Desktop\Auth\DesktopPanelAuthorizator::NODE_NOTENABLED) { if (strlen($pagedata['catalog']) > 0) { $tmploc = new LocaleCatalog($pagedata['catalog'], $container->getCurrentUser()->getLanguage()); $descstr = $tmploc->getStr($pagedata['name']); $tmp_eventscall = new \Innomatic\Wui\Dispatch\WuiEventsCall($pagedata['name']); $tmp_eventscall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'default', '')); if (strlen($pagedata['themeicontype'])) { $imageType = $pagedata['themeicontype']; } else { $imageType = 'apps'; } (strlen($pagedata['themeicon']) and isset($this->mThemeHandler->mIconsSet[$imageType][$pagedata['themeicon']])) ? $imageUrl = $this->mThemeHandler->mIconsBase . $this->mThemeHandler->mIconsSet[$imageType][$pagedata['themeicon']]['base'] . '/' . $imageType . '/' . $this->mThemeHandler->mIconsSet[$imageType][$pagedata['themeicon']]['file'] : ($imageUrl = $pagedata['iconfile']); $el[$groupdata['id']]['groupelements'][$contb]['name'] = $descstr; $el[$groupdata['id']]['groupelements'][$contb]['image'] = $imageUrl; $el[$groupdata['id']]['groupelements'][$contb]['action'] = $tmp_eventscall->getEventsCallString(); $el[$groupdata['id']]['groupelements'][$contb]['themesized'] = 'true'; unset($tmp_eventscall); } } $pagesquery->movenext(); $contb++; } } } // $cont++; if ($group_apps) { $cont++; } else { unset($el[$groupdata['id']]); } $groupsquery->movenext(); } //if ($prefs_id != 0) {} } } $menu = ''; // Dashboard is always the first menu if (isset($el[$dashboard_id])) { $menu .= '.|' . $el[$dashboard_id]['groupname'] . "\n"; foreach ($el[$dashboard_id]['groupelements'] as $panel) { $menu .= '..|' . $panel['name'] . '|' . $panel['action'] . "\n"; } } // Build the menu list foreach ($el as $id => $group) { // Skip dashboard and preferences menu if ($id == $prefs_id or $id == $dashboard_id) { continue; } $menu .= '.|' . $group['groupname'] . "\n"; foreach ($group['groupelements'] as $panel) { $menu .= '..|' . $panel['name'] . '|' . $panel['action'] . "\n"; } } // Preferences is always the last menu if (isset($el[$prefs_id])) { $menu .= '.|' . $el[$prefs_id]['groupname'] . "\n"; foreach ($el[$prefs_id]['groupelements'] as $panel) { $menu .= '..|' . $panel['name'] . '|' . $panel['action'] . "\n"; } } $registry = \Innomatic\Util\Registry::instance(); if (!$registry->isGlobalObject('singleton xlayersmenu')) { $mid = new \Innomatic\Wui\Widgets\Layersmenu\XLayersMenu(); $registry->setGlobalObject('singleton xlayersmenu', $mid); } else { $mid = $registry->getGlobalObject('singleton xlayersmenu'); } // Menu parameters $mid->libdir = $container->getHome() . 'core/lib/'; $mid->libwww = $container->getBaseUrl(false) . '/shared/'; $mid->tpldir = $container->getHome() . 'core/conf/layersmenu/'; $mid->imgdir = $this->mThemeHandler->mStyleDir; $mid->imgwww = $this->mThemeHandler->mStyleBase . $this->mThemeHandler->mStyleName . '/'; $mid->setMenuStructureString($menu); $mid->setDownArrowImg(basename($this->mThemeHandler->mStyle['arrowdownshadow'])); $mid->setForwardArrowImg(basename($this->mThemeHandler->mStyle['arrowrightshadow'])); $mid->parseStructureForMenu($this->mName); $mid->newHorizontalMenu($this->mName); } // User data if ($container->isDomainStarted()) { $user_data = $container->getCurrentUser()->getUserData(); $user_name = $user_data['fname'] . ' ' . $user_data['lname']; $domain_name = $container->getCurrentDomain()->domaindata['domainname']; $logout_events_call = new \Innomatic\Wui\Dispatch\WuiEventsCall(\Innomatic\Webapp\WebAppContainer::instance('\\Innomatic\\Webapp\\WebAppContainer')->getProcessor()->getRequest()->getUrlPath() . '/'); $innomatic_menu_locale = new LocaleCatalog('innomatic::domain_menu', $container->getCurrentUser()->getLanguage()); } else { // In root mode we show generic user data $user_name = 'root'; $domain_name = 'Innomatic'; $logout_events_call = new \Innomatic\Wui\Dispatch\WuiEventsCall(\Innomatic\Webapp\WebAppContainer::instance('\\Innomatic\\Webapp\\WebAppContainer')->getProcessor()->getRequest()->getUrlPath() . '/root'); $innomatic_menu_locale = new LocaleCatalog('innomatic::root_menu', $container->getLanguage()); } $logout_events_call->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('login', 'logout', '')); // Check the environment type and set the title and the header bar color switch ($container->getEnvironment()) { case \Innomatic\Core\InnomaticContainer::ENVIRONMENT_DEVELOPMENT: // Development environment $domain_name .= ' (' . $innomatic_menu_locale->getStr('environment_development') . ')'; $env_class = 'headerbar_dev'; break; case \Innomatic\Core\InnomaticContainer::ENVIRONMENT_INTEGRATION: // Integration environment $domain_name .= ' (' . $innomatic_menu_locale->getStr('environment_integration') . ')'; $env_class = 'headerbar_integration'; break; case \Innomatic\Core\InnomaticContainer::ENVIRONMENT_STAGING: // Staging environment $domain_name .= ' (' . $innomatic_menu_locale->getStr('environment_staging') . ')'; $env_class = 'headerbar_staging'; break; case \Innomatic\Core\InnomaticContainer::ENVIRONMENT_PRODUCTION: // Production environment $env_class = 'headerbar'; break; } // HTML $charset = 'UTF-8'; // $block = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"; // $block = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' . "\n"; $block = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . "\n"; $block .= "<html>\n"; $block .= "<head>\n"; // WUI javascript $block .= '<script language="JavaScript" type="text/javascript" src="' . $container->getBaseUrl(false) . '/shared/wui.js"></script>' . "\n"; $block .= "<script language=\"JavaScript\" type=\"text/javascript\" src=\"" . $container->getBaseUrl(false) . '/shared/' . "layersmenu.js\"></script>\n"; // WUI style $block .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $this->mThemeHandler->mStyle['css'] . "\">\n"; // JQuery $block .= '<link href="' . $container->getBaseUrl(false) . '/shared/jquery/css/jquery-ui-1.10.3.custom.min.css" rel="stylesheet">' . "\n"; $block .= '<script language="JavaScript" type="text/javascript" src="' . $container->getBaseUrl(false) . '/shared/jquery/js/jquery-1.9.1.js"></script>' . "\n"; $block .= '<script language="JavaScript" type="text/javascript" src="' . $container->getBaseUrl(false) . '/shared/jquery/js/jquery-ui-1.10.3.custom.min.js"></script>' . "\n"; $block .= '<link href="' . $container->getBaseUrl(false) . '/shared/jquery/css/jquery_validation_errors.css" rel="stylesheet">' . "\n"; $block .= '<script language="JavaScript" type="text/javascript" src="' . $container->getBaseUrl(false) . '/shared/jquery/js/jquery.validate.js"></script>' . "\n"; // Favicon $block .= '<link rel="shortcut icon" href="' . $container->getBaseUrl(false) . '/favicon.png" type="image/png"/>' . "\n"; // PNG Behavior // @todo Consider removing support for PNG behavior $block .= "<style type=\"text/css\">\nimg {\nbehavior: url(\"" . $container->getBaseUrl(false) . '/shared/' . "pngbehavior.htc\");\n}\n</style>\n"; // Page title $block .= "<title>" . \Innomatic\Wui\Wui::utf8_entities($this->mArgs['title']) . "</title>\n"; // Optional inline javascript code $block .= (isset($this->mArgs['javascript']) and strlen($this->mArgs['javascript'])) ? "<script language=\"JavaScript\">\n<!--\n" . $this->mArgs['javascript'] . "\n//-->\n</script>\n" : ''; // Content type $block .= '<meta http-equiv="Content-Type" content="text/html; charset=' . $charset . '">' . "\n"; $block .= '<meta name="MSSmartTagsPreventParsing" content="true">' . "\n"; // Optional auto refresh if ($this->mArgs['refresh']) { $block .= '<meta http-equiv="refresh" content="' . $this->mArgs['refresh'] . '">' . "\n"; } $block .= "</head>\n"; $block .= '<body bgcolor="' . $this->mThemeHandler->mColorsSet['pages']['bgcolor'] . '"'; if (isset($this->mArgs['background']) and strlen($this->mArgs['background'])) { $block .= ' style="background-image: url(\'' . $this->mArgs['background'] . '\');'; if (isset($this->mArgs['horizbackground']) and $this->mArgs['horizbackground'] == 'true') { $block .= ' background-repeat: repeat-x;'; } $block .= '"'; } $block .= ">\n"; $block .= '<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td valign="' . $this->mArgs['valign'] . '" align="' . $this->mArgs['align'] . '" style="height: 100%;">' . "\n"; if ($this->mArgs['border'] == 'true') { if (!($container->getState() == \Innomatic\Core\InnomaticContainer::STATE_SETUP)) { $menu_header = (isset($GLOBALS['gEnv']['runtime']['wui_menu']['header']) ? '' : $mid->MakeHeader()) . $mid->getMenu($this->mName); $menu_footer = $mid->MakeFooter(); } else { $menu_header = $menu_footer = ''; } $block .= "<table class=\"page\" border=\"0\" style=\"border-bottom: 0px solid " . $this->mThemeHandler->mColorsSet['pages']['border'] . ";\" width=\"100%\" cellspacing=\"0\" cellpadding=\"10\">\n" . '<thead id="page-thead" class="page"><tr class="' . $env_class . '">' . "\n" . "<td style=\"width: 100%; align: center; padding-left: 16px;\" align=\"left\">" . "<a href=\"" . $container->getBaseUrl(false) . "\"><img src=\"" . $this->mThemeHandler->mStyle['titlelogo'] . "\" align=\"left\" width=\"25\" height=\"25\" style=\"margin-right: 15px;\" border=\"0\" alt=\"Innomatic\"></a>" . "<span nowrap class=\"headerbar\" style=\"white-space: nowrap;\">" . $domain_name . '</span></td>' . '<td align="right" valign="middle" nowrap style="white-space: nowrap; padding-right: 10px;">' . '<table border="0" style="margin: 0px; padding: 0px;" cellpadding="0" cellspacing="0"><tr>'; if (!($container->getState() == \Innomatic\Core\InnomaticContainer::STATE_SETUP)) { $block .= '<td><span class="headerbar" style="white-space: nowrap;">' . $user_name . "</span></td>"; if ($container->isDomainStarted() == true) { // Tray bar items $domain_da = $container->getCurrentDomain()->getDataAccess(); $perm = new \Innomatic\Desktop\Auth\DesktopPanelAuthorizator($domain_da, $container->getCurrentUser()->getGroup()); // Extract the list of all the tray bar items $traybar_items_query = $domain_da->execute('SELECT * FROM domain_traybar_items ORDER BY name'); while (!$traybar_items_query->eof) { $panel = $traybar_items_query->getFields('panel'); // Do not show traybar items tied to a panel when the panel is not accessible to the current user if (strlen($panel)) { $node_id = $perm->getNodeIdFromFileName($panel); if ($perm->check($node_id, \Innomatic\Desktop\Auth\DesktopPanelAuthorizator::NODETYPE_PAGE) == \Innomatic\Desktop\Auth\DesktopPanelAuthorizator::NODE_NOTENABLED) { $traybar_items_query->moveNext(); continue; } } $class_name = $traybar_items_query->getFields('class'); if (class_exists($class_name)) { $traybar_item = new $class_name(); $traybar_item->prepare(); $block .= '<td style="padding-left: 15px;">' . $traybar_item->getHtml() . '</td>'; } $traybar_items_query->moveNext(); } } // Logout button $block .= '<td><a href="' . $logout_events_call->getEventsCallString() . '" alt="' . $innomatic_menu_locale->getStr('logout') . '"><img width="25" height="25" align="right" style="margin-left: 15px;" src="' . $this->mThemeHandler->mStyle['logout'] . '" alt="' . $innomatic_menu_locale->getStr('logout') . '" /></a></td>'; } // Menu and toolbar $block .= "</tr></table></td></tr>" . "<tr><td colspan=\"2\" style=\"border-bottom: 1px solid #cccccc; margin: 0px; padding: 0px; width: 100%; height: 45px; background-color: " . $this->mThemeHandler->mColorsSet['titlebars']['bgcolor'] . ";\" align=\"left\" valign=\"middle\" nowrap style=\"white-space: nowrap\">" . $menu_header . '</td></tr>' . "<tr><td id=\"sub-top-menu\" class=\"table-container\" colspan=\"2\" style=\"border-bottom: 1px solid #cccccc; margin: 0px; padding: 0px; height: 45px; background-color: white;\" align=\"left\" valign=\"middle\" nowrap style=\"white-space: nowrap\">" . "<table cellspacing=\"0\" cellpadding=\"0\" style=\"margin: 0px; padding: 4px;\"><tr><td>{[wui-titlebar-title]}{[wui-toolbars]}" . '</tr></table></td></tr><tr>' . '</thead><tbody id="page-tbody" class="page">' . "<td valign=\"top\" colspan=\"2\" style=\"\">\n"; // @todo Refactor and remove the globals $GLOBALS['gEnv']['runtime']['wui_menu']['header'] = true; $GLOBALS['gEnv']['runtime']['wui_menu']['footer'] = $menu_footer; } return $block; }
public function viewshowdataaccesslog($eventData) { $query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT * FROM domains WHERE id=' . $eventData['domainid']); if ($query->getNumberRows()) { $domainData = $query->getFields(); $wuiVgroup = new WuiVertgroup('vgroup'); $dbLogContent = ''; if (file_exists(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/domains/' . $domainData['domainid'] . '/log/dataaccess.log')) { $logToolbar = new WuiToolBar('logbar'); $cleanlogAction = new \Innomatic\Wui\Dispatch\WuiEventsCall(); $cleanlogAction->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'showdataaccesslog', array('domainid' => $eventData['domainid']))); $cleanlogAction->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'cleandataaccesslog', array('domainid' => $eventData['domainid']))); $cleanlogButton = new WuiButton('cleanlogbutton', array('label' => $this->_localeCatalog->getStr('cleanlog_button'), 'themeimage' => 'documentdelete', 'horiz' => 'true', 'action' => $cleanlogAction->getEventsCallString())); $logToolbar->addChild($cleanlogButton); $this->wuiMainvertgroup->addChild($logToolbar); $dbLogContent = file_get_contents(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/domains/' . $domainData['domainid'] . '/log/dataaccess.log'); } $wuiVgroup->addChild(new WuiText('dataaccesslog', array('disp' => 'action', 'readonly' => 'true', 'value' => \Innomatic\Wui\Wui::utf8_entities($dbLogContent), 'rows' => '20', 'cols' => '120')), 0, 1); $this->wuiMainframe->addChild($wuiVgroup); } $this->wuiTitlebar->mArgs['title'] .= ' - ' . $domainData['domainid'] . ' (' . $domainData['domainname'] . ') - ' . $this->_localeCatalog->getStr('showdataaccesslog_title'); }
public static function check_log(&$container) { $innomatic = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer'); if (!file_exists($innomatic->getHome() . 'core/log/innomatic.log')) { return; } $log_content = file_get_contents($innomatic->getHome() . 'core/log/innomatic.log'); $container->addChild(new WuiHorizBar('loghr')); $container->addChild(new WuiText("rootlog", array('disp' => 'action', "readonly" => "true", "value" => \Innomatic\Wui\Wui::utf8_entities($log_content), "rows" => "20", "cols" => "80")), 0, 1); @unlink($innomatic->getHome() . 'core/log/innomatic.log'); }
protected function generateSource() { $event_data = new \Innomatic\Wui\Dispatch\WuiEventRawData(isset($this->mArgs['disp']) ? $this->mArgs['disp'] : '', $this->mName); $event_data_id = new \Innomatic\Wui\Dispatch\WuiEventRawData(isset($this->mArgs['disp']) ? $this->mArgs['disp'] : '', $this->mName . '_id'); $this->mLayout = $this->mComments ? '<!-- begin ' . $this->mName . ' string -->' : ''; // JQuery autocomplete if ($this->mArgs['autocomplete'] == true) { //$jquery_id = 'jqautocomplete_'.$this->mName; $this->mLayout .= '<style> .ui-autocomplete-loading { background: white url(\'' . $this->mThemeHandler->mStyle['ajax_mini'] . '\') right center no-repeat; background-size: 16px 16px;} .ui-autocomplete { max-height: 250px; overflow-y: auto; } </style>'; $this->mLayout .= "<script type=\"text/javascript\">\n\$(document).ready(function () {\n\$(\"#" . $this->mArgs['id'] . "\").autocomplete({\nsource: \"" . $this->mArgs['autocompletesearchurl'] . "\",\nselect: function (event, ui) {\n\$( \"#" . $this->mArgs['id'] . "_value\" ).attr( \"value\", ui.item.id );\n},\nminLength: " . $this->mArgs['autocompleteminlength'] . "\n});\n});\n</script>\n"; $def_value = ''; if (isset($this->mArgs['value']) and strlen($this->mArgs['value']) and isset($this->mArgs['autocompletevalueid']) and $this->mArgs['autocompletevalueid'] != '') { $def_value = ' value=\'' . $this->mArgs['autocompletevalueid'] . '\''; } $this->mLayout .= "<input type='hidden' name='" . $event_data_id->getDataString() . "' id='" . $this->mArgs['id'] . '_value\'' . $def_value . '>'; } if ((isset($this->mArgs['required']) and $this->mArgs['required'] == 'true') || (isset($this->mArgs['integer']) and $this->mArgs['integer'] == 'true') || (isset($this->mArgs['email']) and $this->mArgs['email'] == 'true')) { $check_script = ' <script language="JavaScript" type="text/javascript"> <!-- requiredFields[requiredFields.length] = new Array( "' . $event_data->getDataString() . '", "' . $this->mArgs['checkmessage'] . '"'; $check_script .= (isset($this->mArgs['required']) and $this->mArgs['required'] == 'true') ? ', "required"' : ''; $check_script .= (isset($this->mArgs['integer']) and $this->mArgs['integer'] == 'true') ? ', "integer"' : ''; $check_script .= (isset($this->mArgs['email']) and $this->mArgs['email'] == 'true') ? ', "email"' : ''; $check_script .= ' ); --> </script>'; } $this->mLayout .= '<input' . (isset($this->mArgs['id']) ? ' id="' . $this->mArgs['id'] . '"' : '') . $this->getEventsCompleteString() . ' ' . ((isset($this->mArgs['hint']) and strlen($this->mArgs['hint'])) ? 'onMouseOver="wuiHint(\'' . str_replace("'", "\\'", $this->mArgs['hint']) . '\');" onMouseOut="wuiUnHint();" ' : '') . 'type="' . ((isset($this->mArgs['password']) and $this->mArgs['password'] == 'true') ? 'password' : 'text') . '" name="' . $event_data->getDataString() . '"'; $this->mLayout .= ' tabindex="' . $this->mArgs['tabindex'] . '"'; $this->mLayout .= (isset($this->mArgs['value']) and strlen($this->mArgs['value'])) ? ' value="' . \Innomatic\Wui\Wui::utf8_entities($this->mArgs['value']) . '"' : ''; $this->mLayout .= (isset($this->mArgs['hint']) and $this->mArgs['hint']) ? ' alt="' . $this->mArgs['hint'] . '"' : ''; $this->mLayout .= (isset($this->mArgs['bgcolor']) and strlen($this->mArgs['bgcolor'])) ? ' style="background-color: ' . $this->mArgs['bgcolor'] . ';"' : ''; $this->mLayout .= (isset($this->mArgs['size']) and strlen($this->mArgs['size'])) ? ' size="' . $this->mArgs['size'] . '"' : ''; $this->mLayout .= (isset($this->mArgs['maxlength']) and strlen($this->mArgs['maxlength'])) ? ' maxlength="' . $this->mArgs['maxlength'] . '"' : ''; $this->mLayout .= (isset($this->mArgs['readonly']) and strlen($this->mArgs['readonly'])) ? ' readonly' : ''; $this->mLayout .= '>' . ((isset($check_script) and strlen($check_script)) ? $check_script : ''); $this->mLayout .= $this->mComments ? '<!-- end ' . $this->mName . " string -->\n" : ''; return true; }
protected function generateSource() { $buttonTextColorClass = 'buttontext'; $mouseOutColor = $this->mThemeHandler->mColorsSet['pages']['bgcolor']; $mouseOverColor = $this->mThemeHandler->mColorsSet['buttons']['notselected']; if ($this->mArgs['mainaction'] == 'true') { $buttonTextColorClass = 'buttontextmainaction'; $mouseOutColor = '#24c128'; $mouseOverColor = '#00ff06'; } elseif ($this->mArgs['dangeraction'] == 'true') { $buttonTextColorClass = 'buttontextdangeraction'; $mouseOutColor = '#e93f33'; $mouseOverColor = '#ff1100'; } $this->mArgs['mainaction'] = 'false'; if ($this->mArgs['themeimagetype'] == 'actions') { $image_width = 20; $image_height = 20; } else { if ($this->mArgs['themeimagetype'] == 'mini') { $image_width = 15; $image_height = 15; } else { if ($this->mArgs['themeimagetype'] == 'big') { $image_width = 60; $image_height = 60; } else { if (isset($this->mArgs['themeimage']) and strlen($this->mArgs['themeimage'])) { $image_width = 30; $image_height = 30; } } } } $sizes = ''; if (isset($this->mArgs['themeimage']) and strlen($this->mArgs['themeimage'])) { $sizes = ' style="width: ' . $image_width . 'px; height: ' . $image_height . 'px;"'; } else { if (isset($this->mArgs['width']) or isset($this->mArgs['height'])) { $sizes = ' style="'; isset($this->mArgs['width']) ? $sizes .= 'width: ' . $this->mArgs['width'] . 'px;' : ''; isset($this->mArgs['height']) ? $sizes .= 'height: ' . $this->mArgs['height'] . 'px;' : ''; $sizes .= '"'; } } $this->mLayout = ($this->mComments ? '<!-- begin ' . $this->mName . ' button -->' : '') . '<table' . (isset($this->mArgs['id']) ? ' id="' . $this->mArgs['id'] . '"' : '') . $this->getEventsCompleteString() . ($this->mArgs['compact'] == 'true' ? ' cellpadding="1" cellspacing="0"' : ' cellpadding="4"') . ' style="background-color: ' . $mouseOutColor . ';' . ($this->mArgs['disabled'] == 'true' ? 'cursor: default;' : 'cursor: pointer;') . '"' . ($this->mArgs['disabled'] == 'true' ? '' : ($this->mArgs['highlight'] == 'true' ? ' onMouseOver="this.style.backgroundColor=\'' . $mouseOverColor . '\';' . ((isset($this->mArgs['label']) and strlen($this->mArgs['label'])) ? 'wuiHint(\'' . str_replace("'", "\\'", $this->mArgs['label']) . '\');' : '') . '" onMouseOut="this.style.backgroundColor=\'' . $mouseOutColor . '\';wuiUnHint();"' : '') . ' onClick="' . ((isset($this->mArgs['needconfirm']) and $this->mArgs['needconfirm'] == 'true') ? 'javascript:if ( confirm(\'' . $this->mArgs['confirmmessage'] . '\') ) {' : '') . ($this->mArgs['highlight'] == 'true' ? 'this.style.backgroundColor=\'' . $this->mThemeHandler->mColorsSet['buttons']['selected'] . '\';' : '') . ((isset($this->mArgs['formsubmit']) and strlen($this->mArgs['formsubmit'])) ? 'void(submitForm(\'' . $this->mArgs['formsubmit'] . '\',\'' . $this->mArgs['action'] . '\',\'' . (isset($this->mArgs['formcheckmessage']) ? $this->mArgs['formcheckmessage'] : '') . '\',\'' . ((isset($this->mArgs['target']) and strlen($this->mArgs['target'])) ? $this->mArgs['target'] : '') . '\'));' : ((isset($this->mArgs['target']) and strlen($this->mArgs['target']) and $this->mArgs['target'] != '_blank') ? $this->mArgs['target'] . '.' : '') . ((isset($this->mArgs['target']) and $this->mArgs['target'] == '_blank') ? 'window.open(\'' : 'location.href=\'') . $this->mArgs['action'] . ((isset($this->mArgs['target']) and $this->mArgs['target'] == '_blank') ? '\')' : '\'')) . ((isset($this->mArgs['needconfirm']) and $this->mArgs['needconfirm'] == 'true') ? '}' : '') . '"') . '><tr valign="middle"><td class="normalbig" align="center" ' . ($this->mArgs['nowrap'] == 'true' ? 'nowrap style="white-space: nowrap" ' : '') . ' valign="middle"><center>' . ((isset($this->mArgs['image']) and strlen($this->mArgs['image'])) ? '<img src="' . $this->mArgs['image'] . '" align="middle" border="0"' . $sizes . ((isset($this->mArgs['hint']) and strlen($this->mArgs['hint'])) ? ' alt="' . $this->mArgs['hint'] . '"' : 'alt=""') . '>' . ((isset($this->mArgs['horiz']) and $this->mArgs['horiz']) == 'true' ? '</center></td><td class="normalbig" align="center" ' . ($this->mArgs['nowrap'] == 'true' ? 'nowrap style="white-space: nowrap"' : '') . ' valign="middle"><center>' : '<br>') : '') . ($this->mArgs['disabled'] == 'true' ? '<font color="' . $this->mThemeHandler->mColorsSet['buttons']['disabledtext'] . '">' . ($this->mArgs['mainaction'] == 'true' ? '<strong>' : '') . ((isset($this->mArgs['label']) and strlen($this->mArgs['label'])) ? \Innomatic\Wui\Wui::utf8_entities($this->mArgs['label']) : "") . ($this->mArgs['mainaction'] == 'true' ? '</strong>' : '') . '</font>' : '<font color="' . $this->mThemeHandler->mColorsSet['buttons']['text'] . '"><span class="' . $buttonTextColorClass . '">' . ($this->mArgs['mainaction'] == 'true' ? '<strong>' : '') . ((isset($this->mArgs['label']) and strlen($this->mArgs['label'])) ? \Innomatic\Wui\Wui::utf8_entities($this->mArgs['label']) : "") . ($this->mArgs['mainaction'] == 'true' ? '</strong>' : '')) . '</span></font></center></td></tr></table>' . ($this->mComments ? '<!-- end ' . $this->mName . " button -->\n" : ''); return true; }
protected function generateSource() { $eventData = new \Innomatic\Wui\Dispatch\WuiEventRawData($this->mArgs['disp'], $this->mName); $this->mLayout = ($this->mComments ? '<!-- begin ' . $this->mName . ' string -->' : '') . '<input' . (isset($this->mArgs['id']) ? ' id="' . $this->mArgs['id'] . '"' : '') . ' type="hidden" name="' . $eventData->getDataString() . '"' . (strlen($this->mArgs['value']) ? ' value="' . \Innomatic\Wui\Wui::utf8_entities($this->mArgs['value']) . '"' : '') . '>' . ($this->mComments ? '<!-- end ' . $this->mName . " string -->\n" : ''); return true; }
/** * Generate Source Html of this Widget * @return string code html */ public function generateSource() { $basicstyles = '{ name: "basicstyles", items: [ "Bold", "Italic" ] },'; $paragraph = '{ name: "paragraph", items: [ "NumberedList", "BulletedList", "-", "Outdent", "Indent" ] },'; $links = '{ name: "links", items: [ "Link", "Unlink" ] },'; $this->mLayout = ($this->mComments ? '<!-- begin ' . $this->mName . ' textarea -->' : '') . ($this->mInline ? '<style> .cke_textarea_inline[title~=' . $this->mId . '] { padding-left: 10px; padding-right: 10px; height: ' . $this->mHeight . 'px; overflow: auto; border: 1px solid gray; -webkit-appearance: textfield; } </style>' : '') . '<textarea id="' . $this->mId . '" name="' . $this->mId . '" >' . ((isset($this->mValue) and strlen($this->mValue)) ? \Innomatic\Wui\Wui::utf8_entities($this->mValue) : '') . '</textarea>' . '<script type="text/javascript">' . ' $.getScript("../shared/ckeditor/ckeditor.js", function(){' . ' function onChange(){ document.getElementById("' . $this->mId . '").innerHTML = CKEDITOR.instances.' . $this->mId . '.getData(); }' . ' CKEDITOR.' . ($this->mInline ? 'inline' : 'replace') . '( "' . $this->mId . '", { ' . ' width:"' . $this->mWidth . 'px",' . ' height:"' . $this->mHeight . 'px",' . ' on: { change: onChange }, toolbar: [' . ($this->mBasicstyles ? $basicstyles : '') . ($this->mParagraph ? $paragraph : '') . ($this->mLinks ? $links : '') . ' { name: "about", items: [ "About" ] } ], });' . ' });' . '</script>' . ($this->mComments ? '<!-- end ' . $this->mName . " textarea -->\n" : ''); return true; }