public function executesettheme($eventData) { $userCfg = new UserSettings(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserId()); $userCfg->setKey('wui-theme', $eventData['theme']); if (User::isAdminUser(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserName(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDomainId())) { $domainCfg = new DomainSettings(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()); $domainCfg->EditKey('wui-theme', $eventData['theme']); } $wui = \Innomatic\Wui\Wui::instance('\\Innomatic\\Wui\\Wui'); $wui->setTheme($eventData['theme']); \Innomatic\Webapp\WebAppContainer::instance('\\Innomatic\\Webapp\\WebAppContainer')->getProcessor()->getResponse()->addHeader('Location', WuiEventsCall::buildEventsCallString('', array(array('view', 'default', ''), array('action', 'settheme2', '')))); }
function main_default($eventData) { global $wuiMainFrame, $innomaticLocale, $wuiTitleBar; $wuiGrid = new WuiGrid('grid', array('rows' => '3', 'cols' => '2')); $wuiGrid->addChild(new WuiLabel('oldpasswordlabel', array('label' => $innomaticLocale->getStr('rootpasswordold_label'))), 0, 0); $wuiGrid->addChild(new WuiString('oldpassword', array('disp' => 'action', 'password' => 'true')), 0, 1); $wuiGrid->addChild(new WuiLabel('newpasswordalabel', array('label' => $innomaticLocale->getStr('rootpassworda_label'))), 1, 0); $wuiGrid->addChild(new WuiString('newpassworda', array('disp' => 'action', 'password' => 'true')), 1, 1); $wuiGrid->addChild(new WuiLabel('newpasswordblabel', array('label' => $innomaticLocale->getStr('rootpasswordb_label'))), 2, 0); $wuiGrid->addChild(new WuiString('newpasswordb', array('disp' => 'action', 'password' => 'true')), 2, 1); $wuiVGroup = new WuiVertgroup('vertgroup', array('align' => 'center')); $wuiVGroup->addChild($wuiGrid); $wuiVGroup->addChild(new WuiSubmit('submit', array('caption' => $innomaticLocale->getStr('rootpasschange_submit')))); $formEventsCall = new WuiEventsCall(); $formEventsCall->addEvent(new WuiEvent('view', 'default', '')); $formEventsCall->addEvent(new WuiEvent('action', 'edit', '')); $wuiForm = new WuiForm('form', array('action' => $formEventsCall->getEventsCallString())); $wuiForm->addChild($wuiVGroup); $wuiMainFrame->addChild($wuiForm); }
function main_editclipping($eventData) { global $gXml_def, $gLocale, $customers; $innowork_clipping = new InnoworkClipping(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess(), $eventData['id']); $clipping_data = $innowork_clipping->GetItem(); $headers[0]['label'] = $gLocale->getStr('editclipping.header'); $gXml_def = ' <horizgroup> <children> <table> <args> <headers type="array">' . WuiXml::encode($headers) . '</headers> </args> <children> <form row="0" col="0"><name>editclipping</name> <args> <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default'), array('action', 'editclipping', array('id' => $eventData['id']))))) . '</action> </args> <children> <grid> <children> <label row="0" col="0"> <args> <label type="encoded">' . urlencode($gLocale->getStr('name.label')) . '</label> </args> </label> <string row="0" col="1"><name>name</name> <args> <disp>action</disp> <size>20</size> <value type="encoded">' . urlencode($clipping_data['name']) . '</value> </args> </string> <label row="1" col="0"> <args> <label type="encoded">' . urlencode($gLocale->getStr('description.label')) . '</label> </args> </label> <text row="1" col="1"><name>description</name> <args> <disp>action</disp> <rows>5</rows> <cols>40</cols> <value type="encoded">' . urlencode($clipping_data['description']) . '</value> </args> </text> </children> </grid> </children> </form> <horizgroup row="1" col="0"> <children> <button> <args> <themeimage>buttonok</themeimage> <label type="encoded">' . urlencode($gLocale->getStr('edit_clipping.button')) . '</label> <formsubmit>editclipping</formsubmit> <frame>false</frame> <horiz>true</horiz> <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default'), array('action', 'editclipping', array('id' => $eventData['id']))))) . '</action> </args> </button> </children> </horizgroup> </children> </table> <innoworkitemacl><name>itemacl</name> <args> <itemtype>clipping</itemtype> <itemid>' . $eventData['id'] . '</itemid> <itemownerid>' . $clipping_data['ownerid'] . '</itemownerid> <defaultaction type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'editclipping', array('id' => $eventData['id']))))) . '</defaultaction> </args> </innoworkitemacl> </children> </horizgroup>'; }
public static function buildEventsCallString($eventsCallUrl, $eventsArray) { $tmp_action = new WuiEventsCall($eventsCallUrl); if (is_array($eventsArray)) { while (list(, $event) = each($eventsArray)) { $tmp_action->addEvent(new WuiEvent($event[0], $event[1], isset($event[2]) ? $event[2] : '')); } } return $tmp_action->getEventsCallString(); }
function main_stats($eventData) { global $gPage_title, $gPage_content, $gLocale; $stats_ok = false; require_once 'innomatic/locale/LocaleCountry.php'; $locale_country = new LocaleCountry(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getCountry()); if (isset($eventData['statsfrom']) and isset($eventData['statsto'])) { //$stats_ok = true; $from_date = $locale_country->GetDateArrayFromShortDateStamp($eventData['statsfrom']); $from_ts = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->GetTimestampFromDateArray($from_date); $from_secs = mktime(0, 0, 0, $from_date['mon'], $from_date['mday'], $from_date['year']); $to_date = $locale_country->GetDateArrayFromShortDateStamp($eventData['statsto']); $to_date['hours'] = 23; $to_date['minutes'] = 59; $to_date['seconds'] = 59; $to_ts = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->GetTimestampFromDateArray($to_date); $to_secs = mktime(23, 59, 59, $to_date['mon'], $to_date['mday'], $to_date['year']); $stats_query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->execute('SELECT * ' . 'FROM innowork_core_itemslog ' . 'WHERE eventtime>=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->formatText($from_ts) . ' ' . 'AND eventtime<=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->formatText($to_ts)); $users_stats_query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->execute('SELECT username,count(username) AS count ' . 'FROM innowork_core_itemslog ' . 'WHERE eventtime>=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->formatText($from_ts) . ' ' . 'AND eventtime<=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->formatText($to_ts) . ' ' . 'GROUP BY username'); $stats_data = $_stats_data = array(); while (!$stats_query->eof) { $tmp_date = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->GetDateArrayFromTimestamp($stats_query->getFields('eventtime')); if (!isset($_stats_data[$tmp_date['year'] . $tmp_date['mon'] . $tmp_date['mday']])) { $_stats_data[$tmp_date['year'] . $tmp_date['mon'] . $tmp_date['mday']]['changes'] = 1; } else { $_stats_data[$tmp_date['year'] . $tmp_date['mon'] . $tmp_date['mday']]['changes']++; } $_stats_data[$tmp_date['year'] . $tmp_date['mon'] . $tmp_date['mday']]['day'] = $tmp_date['mday']; $stats_query->MoveNext(); } for ($i = $from_secs; $i <= $to_secs; $i += 60 * 60 * 24) { $tmp_date_array = $locale_country->GetDateArrayFromUnixTimestamp($i); if (!isset($_stats_data[$tmp_date_array['year'] . $tmp_date_array['mon'] . $tmp_date_array['mday']])) { $_stats_data[$tmp_date_array['year'] . $tmp_date_array['mon'] . $tmp_date_array['mday']]['changes'] = 0; $_stats_data[$tmp_date_array['year'] . $tmp_date_array['mon'] . $tmp_date_array['mday']]['day'] = $tmp_date_array['mday']; } } ksort($_stats_data); $x_array = $y_array = array(); $cont = 1; foreach ($_stats_data as $id => $value) { $x_array[] = $cont++; $y_array[] = $value['changes']; } reset($_stats_data); require_once 'phplot/PHPlot.php'; $regression_data = phplot_regression($x_array, $y_array); $cont = 0; foreach ($_stats_data as $value) { $stats_data[] = array($value['day'], $value['changes'], $regression_data[$cont++][2]); } $users_stats_data = array(); while (!$users_stats_query->eof) { if (strpos($users_stats_query->getFields('username'), '@')) { $username = substr($users_stats_query->getFields('username'), 0, strpos($users_stats_query->getFields('username'), '@')); } else { $username = $users_stats_query->getFields('username'); } $users_stats_data[] = array(ucfirst($username), $users_stats_query->getFields('count')); $users_stats_query->MoveNext(); } $stats_ok = true; } else { $from_date = $locale_country->getDateArrayFromSafeTimestamp($locale_country->SafeFormatTimestamp(time() - 60 * 60 * 24 * 30)); $to_date = $locale_country->getDateArrayFromSafeTimestamp($locale_country->SafeFormatTimestamp()); } require_once 'innomatic/wui/dispatch/WuiEventsCall.php'; $xml_def = ' <vertgroup> <children> <form><name>stats</name> <args> <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'stats')))) . '</action> </args> <children> <horizgroup> <args> <align>middle</align> </args> <children> <label> <args> <label type="encoded">' . urlencode($gLocale->getStr('stats_from.label')) . '</label> </args> </label> <date><name>statsfrom</name> <args> <disp>view</disp> <value type="array">' . WuiXml::encode($from_date) . '</value> </args> </date> <label> <args> <label type="encoded">' . urlencode($gLocale->getStr('stats_to.label')) . '</label> </args> </label> <date><name>statsto</name> <args> <disp>view</disp> <value type="array">' . WuiXml::encode($to_date) . '</value> </args> </date> <button> <args> <themeimage>buttonok</themeimage> <horiz>true</horiz> <label type="encoded">' . urlencode($gLocale->getStr('get_stats.button')) . '</label> <formsubmit>stats</formsubmit> <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'stats')))) . '</action> </args> </button> </children> </horizgroup> </children> </form>'; if ($stats_ok) { $legend = array($gLocale->getStr('activites_legend.label'), $gLocale->getStr('trend_legend.label')); $xml_def .= '<horizbar/> <phplot> <args> <data type="array">' . WuiXml::encode($stats_data) . '</data> <width>600</width> <height>350</height> <title type="encoded">' . urlencode($gLocale->getStr('statistics.title')) . '</title> <legend type="array">' . WuiXml::encode($legend) . '</legend> <pointsize>1</pointsize> </args> </phplot> <phplot> <args> <data type="array">' . WuiXml::encode($users_stats_data) . '</data> <width>600</width> <height>350</height> <title type="encoded">' . urlencode($gLocale->getStr('statistics_users.title')) . '</title> <plottype>bars</plottype> <pointsize>1</pointsize> </args> </phplot>'; } $xml_def .= ' </children> </vertgroup>'; $gPage_content = new WuiXml('page', array('definition' => $xml_def)); $gPage_title = $gLocale->getStr('statistics.title'); }
function methods_list_action_builder($pageNumber) { $tmpMainDisp = new WuiDispatcher('view'); $eventData = $tmpMainDisp->getEventData(); return WuiEventsCall::buildEventsCallString('', array(array('view', 'showmethods', array('methodspage' => $pageNumber, 'accountid' => $eventData['accountid'])))); }
function _FillDefinition() { $result = true; require_once 'innomatic/locale/LocaleCatalog.php'; require_once 'innomatic/locale/LocaleCountry.php'; $row = 0; $this->mDefinition = ' <vertgroup><name>searchresult</name><children>'; while (list($type, $results) = each($this->mSearchResult)) { if (count($results)) { $tmp_locale = new LocaleCatalog($this->mSummaries[$type]['catalog'], \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage()); /* $itemtype_call = new WuiEventsCall( $val['domainpanel'] ); $itemtype_call->addEvent( new WuiEvent( 'view', 'default', '' ) ); <button> <name>itemtypeimage</name> <args><themeimage>'.$val['icon'].'</themeimage><themeimagetype>'.$val['icontype'].'</themeimagetype><action>'.$itemtype_call->getEventsCallString().'</action></args> </button> */ $this->mDefinition .= '<button><name>type</name> <args> <themeimage>' . $this->mSummaries[$type]['icon'] . '</themeimage> <themeimagetype>' . $this->mSummaries[$type]['icontype'] . '</themeimagetype> <action>' . WuiXml::cdata(WuiEventsCall::buildEventsCallString($this->mSummaries[$type]['domainpanel'], array(array('view', 'default', '')))) . '</action> <label type="encoded">' . WuiXml::cdata(urlencode($this->mSummaries[$type]['label'])) . '</label> <horiz>true</horiz> </args> </button>'; $headers = array(); $header_count = 1; $locale_country = new LocaleCountry(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getCountry()); while (list(, $keyname) = each($this->mSummaries[$type]['viewablesearchresultkeys'])) { $headers[$header_count++]['label'] = $tmp_locale->getStr($keyname); } $this->mDefinition .= '<table><name>searchresult</name><args><headers type="array">' . WuiXml::encode($headers) . '</headers></args><children>'; $row = 0; //$col = 1; while (list($id, $result) = each($results)) { $col = 1; switch ($result['_acl']['type']) { case InnoworkAcl::TYPE_PRIVATE: $image = 'user'; break; case InnoworkAcl::TYPE_PUBLIC: case InnoworkAcl::TYPE_ACL: $image = 'useradd'; break; } $this->mDefinition .= '<button row="' . $row . '" col="0"><name>acl</name> <args> <themeimage>' . $image . '</themeimage> <themeimagetype>mini</themeimagetype> <compact>true</compact> <action>' . WuiXml::cdata(WuiEventsCall::buildEventsCallString($this->mSummaries[$type]['domainpanel'], array(array($this->mSummaries[$type]['showdispatcher'], $this->mSummaries[$type]['showevent'], array('id' => $result['id']))))) . '</action> </args> </button>'; foreach ($this->mSummaries[$type]['viewablesearchresultkeys'] as $key) { $value = $result[$key]; if ($col == 1) { $this->mDefinition .= '<link row="' . $row . '" col="' . $col . '"><name>key</name> <args> <compact>true</compact> <link>' . WuiXml::cdata(WuiEventsCall::buildEventsCallString($this->mSummaries[$type]['domainpanel'], array(array($this->mSummaries[$type]['showdispatcher'], $this->mSummaries[$type]['showevent'], array('id' => $result['id']))))) . '</link> <label type="encoded">' . WuiXml::cdata(strlen($value) > 35 ? urlencode(substr($value, 0, 32)) . '...' : urlencode($value)) . '</label> <title type="encoded">' . WuiXml::cdata(urlencode(str_replace('"', '', $value))) . '</title> </args> </link>'; } else { $key_type = explode(':', $this->mSummaries[$type]['keys'][$key]); switch ($key_type[0]) { case 'text': $value = strlen($value) > 35 ? substr($value, 0, 32) . '...' : $value; break; case 'timestamp': $value = $locale_country->FormatShortArrayDate(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->GetDateArrayFromTimestamp($value)); break; case 'boolean': if ($value == \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->fmttrue) { $value = 'true'; } else { $value = 'false'; } break; case 'table': if (strlen($value)) { $tmp_query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->execute('SELECT ' . $key_type[2] . ' FROM ' . $key_type[1] . ' WHERE id=' . $value); if ($tmp_query->getNumberRows()) { $value = $tmp_query->getFields($key_type[2]); } else { $value = ''; } $tmp_query->Free(); } else { $value = ''; } break; case 'userid': if (strlen($value)) { $tmp_query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->execute('SELECT id,username,fname,lname FROM domain_users WHERE id=' . $value); if ($tmp_query->getNumberRows()) { $value = $tmp_query->getFields('fname') . ' ' . $tmp_query->getFields('lname'); } else { $value = ''; } $tmp_query->Free(); } else { $value = ''; } break; default: break; } $this->mDefinition .= '<label row="' . $row . '" col="' . $col . '"><name>key</name> <args> <compact>true</compact> <nowrap>false</nowrap> <label type="encoded">' . WuiXml::cdata(urlencode($value)) . '</label> </args> </label>'; } $col++; } if ($this->mTrashcan == 'true') { $locale = new LocaleCatalog('innowork-core::misc', \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage()); $this->mDefinition .= '<button row="' . $row . '" col="' . $col . '"><name>restore</name> <args> <label type="encoded">' . WuiXml::cdata(urlencode($locale->getStr('restore.button'))) . '</label> <horiz>true</horiz> <frame>false</frame> <themeimagetype>mini</themeimagetype> <themeimage>undo</themeimage> <action>' . WuiXml::cdata(WuiEventsCall::buildEventsCallString('1innoworkcore', array(array('view', 'trashcan'), array('action', 'restore_item', array('itemtype' => $type, 'itemid' => $result['id']))))) . '</action> </args> </button>'; } if ($this->mClipping == 'true' and $this->mClippingId) { $locale = new LocaleCatalog('innowork-core::misc', \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage()); $this->mDefinition .= '<button row="' . $row . '" col="' . $col . '"><name>remove</name> <args> <label type="encoded">' . WuiXml::cdata(urlencode($locale->getStr('remove_from_clipping.button'))) . '</label> <horiz>true</horiz> <frame>false</frame> <themeimagetype>mini</themeimagetype> <themeimage>editdelete</themeimage> <action>' . WuiXml::cdata(WuiEventsCall::buildEventsCallString('innoworkclippings', array(array('view', 'showclipping', array('id' => $this->mClippingId)), array('action', 'remove_item', array('id' => $this->mClippingId, 'itemtype' => $type, 'itemid' => $result['id']))))) . '</action> </args> </button>'; } $row++; } $this->mDefinition .= '</children></table>'; } } $this->mDefinition .= '</children></vertgroup>'; return $result; }
public function viewEditrole($eventData) { $role = new \Innomatic\Domain\User\Role((int) $eventData['id']); $formEventsCall = new WuiEventsCall(); $formEventsCall->addEvent(new WuiEvent('action', 'editrole', array('id' => $eventData['id']))); $formEventsCall->addEvent(new WuiEvent('view', 'roles', '')); $xml = '<vertgroup><children> <form><name>roledata</name> <args> <action>' . WuiXml::cdata($formEventsCall->getEventsCallString()) . '</action> </args> <children> <vertgroup><children> <vertgroup><children> <grid> <children> <label row="0" col="0"><args><label>' . WuiXml::cdata($this->localeCatalog->getStr('rolename_label')) . '</label></args></label> <string row="0" col="1"><name>name</name><args><disp>action</disp><value>' . WuiXml::cdata($role->getName()) . '</value><size>25</size></args></string> <label row="1" col="0"><args><label>' . WuiXml::cdata($this->localeCatalog->getStr('roledescription_label')) . '</label></args></label> <text row="1" col="1"><name>description</name><args><disp>action</disp><value>' . WuiXml::cdata($role->getDescription()) . '</value><rows>5</rows><cols>40</cols></args></text> </children> </grid> </children></vertgroup> </children></vertgroup> <horizbar /> <horizgroup><children> <button><name>save</name> <args> <themeimage>buttonok</themeimage> <label>' . WuiXml::cdata($this->localeCatalog->getStr('saverole_button')) . '</label> <action>' . WuiXml::cdata($formEventsCall->getEventsCallString()) . '</action> <formsubmit>roledata</formsubmit> <horiz>true</horiz> <frame>false</frame> </args> </button> </children></horizgroup> </children> </form> </children></vertgroup>'; $this->wuiMainframe->addChild(new WuiXml('user', array('definition' => $xml))); $this->wuiTitlebar->mTitle .= ' - ' . $userData['username'] . ' - ' . $this->localeCatalog->getStr('edituser_title'); }
protected function generateSource() { if ($this->mrWuiDisp->getEventName() == 'treemenu-' . $this->mName) { $disp_data = $this->mrWuiDisp->getEventData(); if (isset($disp_data['activegroup'])) { $this->mActiveGroup = $disp_data['activegroup']; $this->StoreSession(array('activegroup' => $this->mActiveGroup)); } } if (is_array($this->mElements)) { $this->mLayout = ($this->mComments ? '<!-- begin ' . $this->mName . ' treemenu -->' : '') . "<table border=\"0\"" . (strlen($this->mWidth) ? " width=\"" . $this->mWidth . "\"" : "") . ">\n"; reset($this->mElements); while (list($key, $val) = each($this->mElements)) { // Set default group // if (!$this->mActiveGroup) { $this->mActiveGroup = $key; } if ($this->mAllGroupsActive == "true" or $key == $this->mActiveGroup) { $this->mLayout .= "<tr><td align=\"center\" class=\"boldbig\"><center>" . " <table width=\"100%\" border=\"0\" bgcolor=\"" . $this->mThemeHandler->mColorsSet['buttons']['selected'] . "\" cellspacing=\"0\" cellpadding=\"3\">\n <tr>\n <td><img src=\"" . $this->mThemeHandler->mStyle['arrowright'] . "\"></td>\n <td valign=\"middle\" align=\"center\" width=\"100%\" class=\"boldbig\"><center>" . $val["groupname"] . "</center></td>\n </tr>\n </table>" . '</center></td></tr>'; if (isset($val['groupelements']) and is_array($val['groupelements'])) { while (list($keyitem, $valitem) = each($val['groupelements'])) { $target = ''; if (isset($valitem['target']) and strlen($valitem['target'])) { $target = $valitem['target']; } else { if (strlen($this->mTarget)) { $target = $this->mTarget; } } //if ( !isset($val['themesized'] ) ) $this->mLayout .= '<tr><td align="center" class="normal" ' . 'style="cursor: pointer;" ' . " onMouseOver=\"this.style.backgroundColor='" . $this->mThemeHandler->mColorsSet['buttons']['notselected'] . "'\" " . " onMouseOut=\"this.style.backgroundColor='" . $this->mThemeHandler->mColorsSet['pages']['bgcolor'] . "'\" " . ' onClick="this.style.backgroundColor=\'' . $this->mThemeHandler->mColorsSet['pages']['bgcolor'] . '\';' . (((strlen($target) and $target != '_blank') ? ($target == '_top' ? '' : 'parent.') . $target . '.' : '') . ($target == '_blank' ? 'window.open(\'' : 'location.href=\'') . $valitem['action'] . ($target == '_blank' ? '\')' : '\'')) . '"><center><img src="' . $valitem['image'] . '" border="0"' . ((isset($valitem['themesized']) and $valitem['themesized'] != 'false') ? ' style="width: 32px; height: 32px;"' : '') . '><br><font color="' . $this->mThemeHandler->mColorsSet['buttons']['text'] . '">' . $valitem['name'] . '</font></center></td></tr>'; } } } else { $events_call = new WuiEventsCall(); $events_call->addEvent(new WuiEvent("wui", "treemenu-" . $this->mName, array("activegroup" => $key))); reset($this->mDispEvents); while (list(, $event) = each($this->mDispEvents)) { $events_call->addEvent($event); } $this->mLayout .= '<tr><td align="center" class="boldbig"><center>' . ' <table width="100%" style="cursor: pointer;" ' . " onMouseOver=\"this.style.backgroundColor='" . $this->mThemeHandler->mColorsSet['buttons']['selected'] . "'\" " . " onMouseOut=\"this.style.backgroundColor='" . $this->mThemeHandler->mColorsSet['buttons']['notselected'] . "'\" " . ' onClick="this.style.backgroundColor=\'' . $this->mThemeHandler->mColorsSet['buttons']['selected'] . '\';' . 'location.href=\'' . $events_call->getEventsCallString() . '\'" ' . "border=\"0\" bgcolor=\"" . $this->mThemeHandler->mColorsSet['buttons']['notselected'] . "\" cellspacing=\"0\" cellpadding=\"3\">\n <tr>\n <td><img src=\"" . $this->mThemeHandler->mStyle['arrowdown'] . "\" border=\"0\"></td>\n <td valign=\"middle\" align=\"center\" width=\"100%\" class=\"boldbig\"><center>" . '<font color="' . $this->mThemeHandler->mColorsSet['buttons']['text'] . '">' . $val['groupname'] . '</font>' . '</center></td> </tr> </table>' . '</center></td></tr>'; unset($events_call); } } $this->mLayout .= "</table>\n" . ($this->mComments ? "<!-- end " . $this->mName . " treemenu -->" : ""); } return true; }
function main_default($eventData) { global $gXml_def; $example_data = array(array("80", 0.0, 20, 4, 5, 6), array("81", 2.0, 30, 5, 6, 7), array("82", 3.0, 40, 5, 7, 8), array("83", 4.0, 50, 3, 6, 3), array("84", 4.4, 40, 3, 6, 5), array("85", 5.4, 40, 5, 6, 5), array("86", 5.5, 40, 7, 6, 5), array("87", 7, 35, 0.0, 0.0, ""), array("88", 7.4, 40, 14, 16, 25), array("89", 7.6, 40, 6, 6, 5), array("90", 8.199999999999999, 40, 3, 6, 5), array("91", 8.5, 40, 8, 6, 9), array("92", 9.300000000000001, 40, 5, 6, 5), array("93", 9.6, 40, 9, 6, 7), array("94", 9.9, 40, 2, 6, 5), array("95", 10.0, 40, 3, 6, 8), array("96", 10.4, 40, 3, 6, 5), array("97", 10.5, 40, 3, 6, 5), array("98", 10.8, 40, 3, 6, 5), array("99", 11.4, 40, 3, 6, 5), array("00", 12.0, 40, 3, 7, 5), array("01", 13.4, 40, 3, 5, 3), array("02", 14.0, 30, 3, 5, 6)); $legend = array('Prodotto A', 'Prodotto B', 'Prodotto C', 'Prodotto D', 'Prodotto E'); $gXml_def = '<vertgroup> <children> <label> <args> <label>Grafico</label> </args> </label> <vertframe> <children> <phplot> <args> <data type="array">' . WuiXml::encode($example_data) . '</data> <width>600</width> <height>350</height> <legend type="array">' . WuiXml::encode($legend) . '</legend> <plottype>' . $eventData['plottype'] . '</plottype> <title>Elaborazione fatturato</title> </args> </phplot> </children> </vertframe> <horizbar/> <horizgroup> <children> <button> <args> <themeimage>button_ok</themeimage> <horiz>true</horiz> <themeimagetype>mini</themeimagetype> <label>Bars</label> <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('plottype' => 'bars'))))) . '</action> </args> </button> <button> <args> <themeimage>button_ok</themeimage> <horiz>true</horiz> <themeimagetype>mini</themeimagetype> <label>Lines</label> <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('plottype' => 'lines'))))) . '</action> </args> </button> <button> <args> <themeimage>button_ok</themeimage> <horiz>true</horiz> <themeimagetype>mini</themeimagetype> <label>Linepoints</label> <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('plottype' => 'linepoints'))))) . '</action> </args> </button> <button> <args> <themeimage>button_ok</themeimage> <horiz>true</horiz> <themeimagetype>mini</themeimagetype> <label>Area</label> <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('plottype' => 'area'))))) . '</action> </args> </button> <button> <args> <themeimage>button_ok</themeimage> <horiz>true</horiz> <themeimagetype>mini</themeimagetype> <label>Points</label> <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('plottype' => 'points'))))) . '</action> </args> </button> <button> <args> <themeimage>button_ok</themeimage> <horiz>true</horiz> <themeimagetype>mini</themeimagetype> <label>Pie</label> <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('plottype' => 'pie'))))) . '</action> </args> </button> </children> </horizgroup> </children> </vertgroup>'; }
function main_default($eventData) { global $gXml_def, $innowork_core, $gLocale, $gWui, $gPage_status, $gPage_title; $summaries = $innowork_core->GetSummaries(); $types[''] = $gLocale->getStr('alltypes.label'); while (list($key, $val) = each($summaries)) { if ($val['searchable']) { $types[$key] = $val['label']; } } reset($summaries); $tab_labels[0]['label'] = $gLocale->getStr('defacls.tab'); $gXml_def = ' <vertgroup> <children> <tab> <name>settings</name> <args> <tabs type="array">' . WuiXml::encode($tab_labels) . '</tabs> <tabactionfunction>main_tab_action_handler</tabactionfunction> <activetab>' . (isset($eventData['maintab']) ? $eventData['maintab'] : '') . '</activetab> </args> <children> <!-- Default ACLs tab --> <vertgroup> <children> <label> <args> <bold>true</bold> <label type="encoded">' . urlencode($gLocale->getStr('defacls.title')) . '</label> </args> </label> <horizbar/> <horizgroup> <children> <vertgroup> <children>'; foreach ($summaries as $type => $opts) { $class_name = $opts['classname']; if (!class_exists($class_name)) { continue; } $tmp_class = new $class_name(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess(), 0); if ($type != 'defaultaclitem' and $tmp_class->mNoAcl != true and !isset($tmp_class->_mSkipAclSet) and !isset($tmp_class->_mCreationAcl)) { $gXml_def .= ' <button> <args> <label type="encoded">' . urlencode($opts['label']) . '</label> <themeimage>' . $opts['icon'] . '</themeimage> <themeimagetype>' . $opts['icontype'] . '</themeimagetype> <horiz>true</horiz> <disabled>' . ($eventData['setdefacl'] == $type ? 'true' : 'false') . '</disabled> <action type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('setdefacl' => $type))))) . '</action> </args> </button>'; } } $gXml_def .= ' </children> </vertgroup>'; if (isset($eventData['setdefacl'])) { $check_query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->Execute('SELECT * FROM innowork_core_acls_defaults WHERE ownerid=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserId() . ' AND itemtype=' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()->formatText($eventData['setdefacl'])); if ($check_query->getNumberRows()) { $id = $check_query->getFields('id'); } else { $item = new InnoworkDefaultAclItem(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentDomain()->getDataAccess()); $params['itemtype'] = $eventData['setdefacl']; $item->Create($params); $id = $item->mItemId; } $gXml_def .= ' <vertbar/> <vertgroup> <args> <align>center</align> </args> <children> <label> <args> <label type="encoded">' . urlencode($summaries[$eventData['setdefacl']]['label']) . '</label> <bold>true</bold> </args> </label> <horizbar/> <innoworkitemacl><name>itemacl</name> <args> <itemtype>defaultaclitem</itemtype> <itemid>' . $id . '</itemid> <itemownerid>' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getUserId() . '</itemownerid> <defaultaction type="encoded">' . urlencode(WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('setdefacl' => $eventData['setdefacl']))))) . '</defaultaction> </args> </innoworkitemacl> </children> </vertgroup> '; } $gXml_def .= ' </children> </horizgroup> </children> </vertgroup> </children> </tab> </children> </vertgroup>'; }
public function viewlanguage($eventData) { $actionDispatcher = new WuiDispatcher('action'); $locCountry = new LocaleCountry(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getCountry()); $countryLanguage = $locCountry->Language(); $languageLocale = new LocaleCatalog('innomatic::localization', \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage()); $selectedLanguage = $actionDispatcher->getEventData(); if (isset($selectedLanguage['language'])) { $selectedLanguage = $selectedLanguage['language']; } $wuiVGroup = new WuiVertgroup('vgroup'); $languageQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT * FROM locale_languages'); while (!$languageQuery->eof) { $languages[$languageQuery->getFields('langshort')] = $languageLocale->getStr($languageQuery->getFields('langname')); $languageQuery->moveNext(); } $wuiLocaleGrid = new WuiGrid('localegrid', array('rows' => '1', 'cols' => '3')); $wuiLocaleGrid->addChild(new WuiLabel('languagelabel', array('label' => $this->localeCatalog->getStr('language_label'))), 0, 0); $wuiLocaleGrid->addChild(new WuiComboBox('language', array('disp' => 'action', 'elements' => $languages, 'default' => $selectedLanguage ? $selectedLanguage : \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage())), 0, 1); $wuiLocaleGrid->addChild(new WuiSubmit('submit1', array('caption' => $this->localeCatalog->getStr('language_submit'))), 0, 2); $wuiVGroup->addChild($wuiLocaleGrid); $wuiVGroup->addChild(new WuiHorizBar('horizbar1')); $wuiVGroup->addChild(new WuiLabel('deflanglabel', array('label' => sprintf($this->localeCatalog->getStr('countrylanguage_label'), $languages[$countryLanguage])))); $formEventsCall = new WuiEventsCall(); $formEventsCall->addEvent(new WuiEvent('action', 'setlanguage', '')); $formEventsCall->addEvent(new WuiEvent('view', 'language', '')); $wuiForm = new WuiForm('languageform', array('action' => $formEventsCall->getEventsCallString())); $wuiForm->addChild($wuiVGroup); $this->wuiMainframe->addChild($wuiForm); $this->wuiTitlebar->mArgs['title'] .= ' - ' . $this->localeCatalog->getStr('language_title'); }