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; }
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 main_debug($eventData) { global $gEnv, $gLocale, $gPage_content; $amp = Ampoliros::instance('Ampoliros'); if ($amp->getState == Ampoliros::STATE_DEBUG) { $amp->setState(Ampoliros::STATE_DEVELOPMENT); } $debugger = new Debugger($eventData['pid']); if ($debugger->CheckPidFile()) { $debugger->ReadPidFile(); $moddata = $debugger->GuessModule(); $country = new LocaleCountry($gEnv['root']['locale']['country']); $rowa = 0; $rowb = 0; $rowc = 0; $rowd = 0; $rowe = 0; $rowf = 0; $log_events = ''; while (list(, $log_event) = each($debugger->mLogEvents)) { $log_events .= $log_event . "\n"; } $hui_events = array(); while (list($dispatcher, $event) = each($debugger->mHuiEvents)) { $hui_events[] = $dispatcher . '::' . $event['eventname']; if (is_array($event['eventdata'])) { while (list($eventdata_name, $eventdata_value) = each($event['eventdata'])) { $hui_events[] = '- ' . $eventdata_name . ' -> ' . $eventdata_value; } } } $tabs[0]['label'] = $gLocale->GetStr('instance.label'); $tabs[1]['label'] = $gLocale->GetStr('environment.label'); $tabs[2]['label'] = $gLocale->GetStr('runtime.label'); $tabs[3]['label'] = $gLocale->GetStr('source.label'); $tabs[4]['label'] = $gLocale->GetStr('profiler.label'); $tabs[5]['label'] = $gLocale->GetStr('bugreport.label'); arsort($debugger->mDbProfiler); $xml_def = '<tab><name>debugger</name><args>' . (isset($eventData['activetab']) ? '<activetab>' . $eventData['activetab'] . '</activetab>' : '') . '<tabactionfunction>debugger_tab_action_builder</tabactionfunction><tabs type="array">' . huixml_encode($tabs) . '</tabs></args><children> <grid><name>debugger</name><children> <label row="' . $rowa++ . '" col="0"><name>instance</name><args><label type="encoded">' . urlencode($gLocale->GetStr('instance.label')) . '</label><bold>true</bold></args></label> <label row="' . $rowa . '" col="0"><name>pid</name><args><label type="encoded">' . urlencode($gLocale->GetStr('pid.label')) . '</label></args></label> <string row="' . $rowa++ . '" col="1"><name>pid</name><args><readonly>true</readonly><value>' . $eventData['pid'] . '</value><size>32</size></args></string> <label row="' . $rowa . '" col="0"><name>sessionid</name><args><label type="encoded">' . urlencode($gLocale->GetStr('sessionid.label')) . '</label></args></label> <string row="' . $rowa++ . '" col="1"><name>sessionid</name><args><readonly>true</readonly><value>' . $debugger->mSessionId . '</value><size>32</size></args></string> <label row="' . $rowa . '" col="0"><name>state</name><args><label type="encoded">' . urlencode($gLocale->GetStr('state.label')) . '</label></args></label> <string row="' . $rowa++ . '" col="1"><name>state</name><args><readonly>true</readonly><value>' . $debugger->mState . '</value><size>15</size></args></string> <label row="' . $rowa . '" col="0"><name>interface</name><args><label type="encoded">' . urlencode($gLocale->GetStr('interface.label')) . '</label></args></label> <string row="' . $rowa++ . '" col="1"><name>interface</name><args><readonly>true</readonly><value>' . $debugger->mInterface . '</value><size>15</size></args></string> <label row="' . $rowa . '" col="0"><name>mode</name><args><label type="encoded">' . urlencode($gLocale->GetStr('mode.label')) . '</label></args></label> <string row="' . $rowa++ . '" col="1"><name>mode</name><args><readonly>true</readonly><value>' . $debugger->mMode . '</value><size>15</size></args></string> <label row="' . $rowa . '" col="0"><name>pagename</name><args><label type="encoded">' . urlencode($gLocale->GetStr('pagename.label')) . '</label></args></label> <string row="' . $rowa++ . '" col="1"><name>pagename</name><args><readonly>true</readonly><value>' . $debugger->mPidStructure['gEnv']['runtime']['pagename'] . '</value><size>20</size></args></string> <label row="' . $rowa . '" col="0"><name>siteid</name><args><label type="encoded">' . urlencode($gLocale->GetStr('siteid.label')) . '</label></args></label> <string row="' . $rowa++ . '" col="1"><name>siteid</name><args><readonly>true</readonly><value>' . $debugger->mPidStructure['gEnv']['site']['id'] . '</value><size>20</size></args></string> <label row="' . $rowa . '" col="0"><name>userid</name><args><label type="encoded">' . urlencode($gLocale->GetStr('userid.label')) . '</label></args></label> <string row="' . $rowa++ . '" col="1"><name>userid</name><args><readonly>true</readonly><value>' . $debugger->mPidStructure['gEnv']['user']['id'] . '</value><size>20</size></args></string> </children></grid> <grid><name>environment</name><children> <label row="' . $rowb++ . '" col="0"><name>environment</name><args><label type="encoded">' . urlencode($gLocale->GetStr('environment.label')) . '</label><bold>true</bold></args></label> <label row="' . $rowb . '" col="0"><name>memory</name><args><label type="encoded">' . urlencode($gLocale->GetStr('memorylimit.label')) . '</label></args></label> <string row="' . $rowb++ . '" col="1"><name>memory</name><args><readonly>true</readonly><value>' . $debugger->mPidStructure['gEnv']['core']['php']['memorylimit'] . '</value><size>15</size></args></string> <label row="' . $rowb . '" col="0"><name>timelimit</name><args><label type="encoded">' . urlencode($gLocale->GetStr('timelimit.label')) . '</label></args></label> <string row="' . $rowb++ . '" col="1"><name>timelimit</name><args><readonly>true</readonly><value>' . $debugger->mPidStructure['gEnv']['core']['php']['timelimit'] . '</value><size>15</size></args></string> <label row="' . $rowb . '" col="0"><name>sessionlifetime</name><args><label type="encoded">' . urlencode($gLocale->GetStr('sessionlifetime.label')) . '</label></args></label> <string row="' . $rowb++ . '" col="1"><name>sessionlifetime</name><args><readonly>true</readonly><value>' . $debugger->mPidStructure['gEnv']['core']['session']['lifetime'] . '</value><size>15</size></args></string> <label row="' . $rowb . '" col="0"><name>extensions</name><args><label type="encoded">' . urlencode($gLocale->GetStr('extensions.label')) . '</label></args></label> <listbox row="' . $rowb++ . '" col="1"><name>extensions</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mLoadedExtensions) . '</elements><size>10</size></args></listbox> </children></grid> <grid><name>runtime</name><children> <label row="' . $rowc++ . '" col="0"><name>runtime</name><args><label type="encoded">' . urlencode($gLocale->GetStr('runtime.label')) . '</label><bold>true</bold></args></label> <label row="' . $rowc . '" col="0"><name>libraries</name><args><label type="encoded">' . urlencode($gLocale->GetStr('libraries.label')) . '</label></args></label> <listbox row="' . $rowc++ . '" col="1"><name>libraries</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mLibraries) . '</elements><size>10</size></args></listbox> <label row="' . $rowc . '" col="0"><name>logevents</name><args><label type="encoded">' . urlencode($gLocale->GetStr('logevents.label')) . '</label></args></label> <text row="' . $rowc++ . '" col="1"><name>logevents</name><args><readonly>true</readonly><value type="encoded">' . urlencode($log_events) . '</value><rows>15</rows><cols>100</cols></args></text> <label row="' . $rowc . '" col="0"><name>calledhooks</name><args><label type="encoded">' . urlencode($gLocale->GetStr('calledhooks.label')) . '</label></args></label> <listbox row="' . $rowc++ . '" col="1"><name>calledhooks</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mCalledHooks) . '</elements><size>5</size></args></listbox> <label row="' . $rowc . '" col="0"><name>huievents</name><args><label type="encoded">' . urlencode($gLocale->GetStr('huievents.label')) . '</label></args></label> <listbox row="' . $rowc++ . '" col="1"><name>huievents</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($hui_events) . '</elements><size>5</size></args></listbox> <label row="' . $rowc . '" col="0"><name>queries</name><args><label type="encoded">' . urlencode($gLocale->GetStr('queries.label')) . '</label></args></label> <listbox row="' . $rowc++ . '" col="1"><name>queries</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mExecutedQueries) . '</elements><size>10</size></args></listbox> <label row="' . $rowc . '" col="0"><name>includedfiles</name><args><label type="encoded">' . urlencode($gLocale->GetStr('includedfiles.label')) . '</label></args></label> <listbox row="' . $rowc++ . '" col="1"><name>includedfiles</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mIncludedFiles) . '</elements><size>5</size></args></listbox> '; if (function_exists('memory_get_usage')) { $xml_def .= ' <label row="' . $rowc . '" col="0"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('memoryusage.label')) . '</label> </args> </label>'; } $xml_def .= ' <string row="' . $rowc++ . '" col="1"> <args> <value type="encoded">' . urlencode($country->FormatNumber($debugger->mMemoryUsage)) . '</value> <readonly>true</readonly> <size>15</size> </args> </string> </children></grid> <grid><name>source</name><children> <label row="' . $rowe++ . '" col="0"><name>source</name><args><label type="encoded">' . urlencode($gLocale->GetStr('source.label')) . '</label><bold>true</bold></args></label> <label row="' . $rowe . '" col="0"><name>classes</name><args><label type="encoded">' . urlencode($gLocale->GetStr('classes.label')) . '</label></args></label> <listbox row="' . $rowe++ . '" col="1"><name>classes</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mDefinedClasses) . '</elements><size>10</size></args></listbox> <label row="' . $rowe . '" col="0"><name>functions</name><args><label type="encoded">' . urlencode($gLocale->GetStr('functions.label')) . '</label></args></label> <listbox row="' . $rowe++ . '" col="1"><name>functions</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mDefinedFunctions) . '</elements><size>5</size></args></listbox> </children></grid> <grid><name>profiler</name><children> <label row="' . $rowd++ . '" col="0"><name>profiler</name><args><label type="encoded">' . urlencode($gLocale->GetStr('profiler.label')) . '</label><bold>true</bold></args></label> <label row="' . $rowd . '" col="0"><name>markers</name><args><label type="encoded">' . urlencode($gLocale->GetStr('markers.label')) . '</label></args></label> <listbox row="' . $rowd++ . '" col="1"><name>markers</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mProfiler) . '</elements><size>20</size></args></listbox> <label row="' . $rowd . '" col="0"><name>markers</name><args><label type="encoded">' . urlencode($gLocale->GetStr('dbmarkers.label')) . '</label></args></label> <listbox row="' . $rowd++ . '" col="1"><name>markers</name><args><readonly>true</readonly><elements type="array">' . huixml_encode($debugger->mDbProfiler) . '</elements><size>20</size></args></listbox> <label row="' . $rowd . '" col="0"><name>dbload</name><args><label type="encoded">' . urlencode($gLocale->GetStr('dbload.label')) . '</label></args></label> <string row="' . $rowd++ . '" col="1"><name>dbload</name><args><readonly>true</readonly><value>' . $debugger->mDbTotalLoad . '</value><size>20</size></args></string> <label row="' . $rowd . '" col="0"><args><label type="encoded">' . urlencode($gLocale->GetStr('executedqueries.label')) . '</label></args></label> <string row="' . $rowd++ . '" col="1"><name>executedqueries</name><args><readonly>true</readonly><value>' . count($debugger->mDbProfiler) . '</value><size>6</size></args></string> </children></grid> <form><name>bugreport</name><args><method>post</method><action type="encoded"></action></args><children> <vertgroup><name>bugreport</name><children> <grid><name>bugreport</name><children> <label row="' . $rowf++ . '" col="0"><name>bugreport</name><args><label type="encoded">' . urlencode($gLocale->GetStr('bugreport.label')) . '</label><bold>true</bold></args></label> <label row="' . $rowf . '" col="0"><name>module</name><args><label type="encoded">' . urlencode($gLocale->GetStr('module.label')) . '</label></args></label> <label row="' . $rowf++ . '" col="1"><name>module</name><args><label type="encoded">' . urlencode($moddata['module']) . '</label></args></label> <label row="' . $rowf . '" col="0"><name>bugsemail</name><args><label type="encoded">' . urlencode($gLocale->GetStr('bugsemail.label')) . '</label></args></label> <label row="' . $rowf++ . '" col="1"><name>to</name><args><label type="encoded">' . urlencode($moddata['email']) . '</label></args></label>'; if ($moddata['ampolirosemail'] != $moddata['email']) { $xml_def .= ' <label row="' . $rowf . '" col="0"><name>notify</name><args><label type="encoded">' . urlencode($gLocale->GetStr('sendnotify.label')) . '</label></args></label> <checkbox row="' . $rowf++ . '" col="1"><name>notify</name><args><disp>pass</disp></args></checkbox>'; } $xml_def .= ' <label row="' . $rowf . '" col="0"><name>email</name><args><label type="encoded">' . urlencode($gLocale->GetStr('submitteremail.label')) . '</label></args></label> <string row="' . $rowf++ . '" col="1"><name>email</name><args><size>25</size><disp>pass</disp></args></string> <label row="' . $rowf . '" col="0"><name>message</name><args><label type="encoded">' . urlencode($gLocale->GetStr('message.label')) . '</label></args></label> <text row="' . $rowf++ . '" col="1"><name>message</name><args><cols>80</cols><rows>10</rows><disp>pass</disp></args></text> </children></grid> <horizbar><name>hb</name></horizbar> <button><name>submit</name> <args> <formsubmit>bugreport</formsubmit> <themeimage>button_ok</themeimage> <frame>false</frame> <horiz>true</horiz> <label type="encoded">' . urlencode($gLocale->GetStr('bugreport.submit')) . '</label> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'debug', array('pid' => $eventData['pid'])), array('pass', 'submitbugreport', array('pid' => $eventData['pid']))))) . '</action> </args> </button> </children></vertgroup> </children></form> </children></tab>'; } $gPage_content = new HuiXml('page', array('definition' => $xml_def)); }
function main_ampoliros($eventData) { global $gEnv, $gXml_def, $gLocale, $gPage_title; OpenLibrary('ampoliros_cache.maintenance', HANDLER_PATH); OpenLibrary('ampoliros_logs.maintenance', HANDLER_PATH); $country = new LocaleCountry($GLOBALS['gEnv']['root']['locale']['country']); $tabs[0]['label'] = $gLocale->GetStr('ampoliros_status.tab'); $tabs[1]['label'] = $gLocale->GetStr('ampoliros_settings.tab'); $logs_main = new AmpolirosLogsMaintenance(); $cache_main = new AmpolirosCacheMaintenance(); $gXml_def = '<tab><name>ampoliros</name> <args> <tabs type="array">' . huixml_encode($tabs) . '</tabs> <tabactionfunction>ampoliros_tab_builder</tabactionfunction> <activetab>' . (isset($eventData['tab']) ? $eventData['tab'] : '') . '</activetab> </args> <children> <vertgroup><name></name> <children> <label><name>tabtitle</name> <args> <label type="encoded">' . urlencode($gLocale->GetStr('ampoliros_status.label')) . '</label> <bold>true</bold> </args> </label> <grid> <children> <label row="0" col="0"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('systemlogs_size.label')) . '</label> </args> </label> <string row="0" col="1"> <args> <size>15</size> <readonly>true</readonly> <value type="encoded">' . urlencode($country->FormatNumber($logs_main->GetSystemLogsSize())) . '</value> </args> </string> <button row="0" col="2"> <args> <themeimage>editdelete</themeimage> <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_systemlogs')))) . '</action> </args> </button> <label row="1" col="0"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('siteslogs_size.label')) . '</label> </args> </label> <string row="1" col="1"> <args> <size>15</size> <readonly>true</readonly> <value type="encoded">' . urlencode($country->FormatNumber($logs_main->GetSitesLogsSize())) . '</value> </args> </string> <button row="1" col="2"> <args> <themeimage>editdelete</themeimage> <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_siteslogs')))) . '</action> </args> </button> <label row="2" col="0"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('cache_size.label')) . '</label> </args> </label> <string row="2" col="1"> <args> <size>15</size> <readonly>true</readonly> <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetCacheSize())) . '</value> </args> </string> <button row="2" col="2"> <args> <themeimage>editdelete</themeimage> <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_cache')))) . '</action> </args> </button> <label row="3" col="0"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('sessions_size.label')) . '</label> </args> </label> <string row="3" col="1"> <args> <size>15</size> <readonly>true</readonly> <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetSessionsSize())) . '</value> </args> </string> <button row="3" col="2"> <args> <themeimage>editdelete</themeimage> <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_sessions')))) . '</action> </args> </button> <label row="4" col="0"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('pidfiles_size.label')) . '</label> </args> </label> <string row="4" col="1"> <args> <size>15</size> <readonly>true</readonly> <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetPidFilesSize())) . '</value> </args> </string> <button row="4" col="2"> <args> <themeimage>editdelete</themeimage> <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_pidfiles')))) . '</action> </args> </button> <label row="5" col="0"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('tempdirs_size.label')) . '</label> </args> </label> <string row="5" col="1"> <args> <size>15</size> <readonly>true</readonly> <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetAmpTempDirsSize())) . '</value> </args> </string> <button row="5" col="2"> <args> <themeimage>editdelete</themeimage> <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_tempdirs')))) . '</action> </args> </button> <label row="6" col="0"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('clipboard_size.label')) . '</label> </args> </label> <string row="6" col="1"> <args> <size>15</size> <readonly>true</readonly> <value type="encoded">' . urlencode($country->FormatNumber($cache_main->GetClipboardSize())) . '</value> </args> </string> <button row="6" col="2"> <args> <themeimage>editdelete</themeimage> <label type="encoded">' . urlencode($gLocale->GetStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_clipboard')))) . '</action> </args> </button> <label row="7" col="0"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('cleanable_size.label')) . '</label> </args> </label> <string row="7" col="1"> <args> <size>15</size> <readonly>true</readonly> <value type="encoded">' . urlencode($country->FormatNumber($logs_main->GetCleanableDiskSize() + $cache_main->GetCleanableDiskSize())) . '</value> </args> </string> <button row="7" col="2"> <args> <themeimage>editdelete</themeimage> <label type="encoded">' . urlencode($gLocale->GetStr('clearall.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'clear_all')))) . '</action> </args> </button> </children> </grid> </children> </vertgroup> <vertgroup><name></name> <children> <label><name>tabtitle</name> <args> <label type="encoded">' . urlencode($gLocale->GetStr('ampoliros_settings.label')) . '</label> <bold>true</bold> </args> </label> <form><name>settings</name> <args> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'set_ampoliros')))) . '</action> </args> <children> <vertgroup> <children> <grid> <children> <label row="0" col="0"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('action_clean.label')) . '</label> <bold>true</bold> </args> </label> <label row="0" col="1"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('action_rotate.label')) . '</label> <bold>true</bold> </args> </label> <label row="0" col="2"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('action_none.label')) . '</label> <bold>true</bold> </args> </label> <radio row="1" col="0" halign="center"><name>amplog</name> <args> <disp>action</disp> <checked>' . ($logs_main->GetCleanAmpLog() ? 'true' : 'false') . '</checked> <value>clean</value> </args> </radio> <radio row="1" col="1" halign="center"><name>amplog</name> <args> <disp>action</disp> <checked>' . ($logs_main->GetRotateAmpLog() ? 'true' : 'false') . '</checked> <value>rotate</value> </args> </radio> <radio row="1" col="2" halign="center"><name>amplog</name> <args> <disp>action</disp> <checked>' . (($logs_main->GetCleanAmpLog() or $logs_main->GetRotateAmpLog()) ? 'false' : 'true') . '</checked> <value>leave</value> </args> </radio> <label row="1" col="3"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('amplog_size.label')) . '</label> </args> </label> <radio row="2" col="0" halign="center"><name>ampdblog</name> <args> <disp>action</disp> <checked>' . ($logs_main->GetCleanAmpDbLog() ? 'true' : 'false') . '</checked> <value>clean</value> </args> </radio> <radio row="2" col="1" halign="center"><name>ampdblog</name> <args> <disp>action</disp> <checked>' . ($logs_main->GetRotateAmpDbLog() ? 'true' : 'false') . '</checked> <value>rotate</value> </args> </radio> <radio row="2" col="2" halign="center"><name>ampdblog</name> <args> <disp>action</disp> <checked>' . (($logs_main->GetCleanAmpDbLog() or $logs_main->GetRotateAmpDbLog()) ? 'false' : 'true') . '</checked> <value>leave</value> </args> </radio> <label row="2" col="3"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('ampdblog_size.label')) . '</label> </args> </label> <radio row="3" col="0" halign="center"><name>accesslog</name> <args> <disp>action</disp> <checked>' . ($logs_main->GetCleanAccessLog() ? 'true' : 'false') . '</checked> <value>clean</value> </args> </radio> <radio row="3" col="1" halign="center"><name>accesslog</name> <args> <disp>action</disp> <checked>' . ($logs_main->GetRotateAccessLog() ? 'true' : 'false') . '</checked> <value>rotate</value> </args> </radio> <radio row="3" col="2" halign="center"><name>accesslog</name> <args> <disp>action</disp> <checked>' . (($logs_main->GetCleanAccessLog() or $logs_main->GetRotateAccessLog()) ? 'false' : 'true') . '</checked> <value>leave</value> </args> </radio> <label row="3" col="3"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('accesslog_size.label')) . '</label> </args> </label> <radio row="4" col="0" halign="center"><name>remotelog</name> <args> <disp>action</disp> <checked>' . ($logs_main->GetCleanRemoteLog() ? 'true' : 'false') . '</checked> <value>clean</value> </args> </radio> <radio row="4" col="1" halign="center"><name>remotelog</name> <args> <disp>action</disp> <checked>' . ($logs_main->GetRotateRemoteLog() ? 'true' : 'false') . '</checked> <value>rotate</value> </args> </radio> <radio row="4" col="2" halign="center"><name>remotelog</name> <args> <disp>action</disp> <checked>' . (($logs_main->GetCleanRemoteLog() or $logs_main->GetRotateRemoteLog()) ? 'false' : 'true') . '</checked> <value>leave</value> </args> </radio> <label row="4" col="3"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('remotelog_size.label')) . '</label> </args> </label> <radio row="5" col="0" halign="center"><name>phplog</name> <args> <disp>action</disp> <checked>' . ($logs_main->GetCleanPhpLog() ? 'true' : 'false') . '</checked> <value>clean</value> </args> </radio> <radio row="5" col="1" halign="center"><name>phplog</name> <args> <disp>action</disp> <checked>' . ($logs_main->GetRotatePhpLog() ? 'true' : 'false') . '</checked> <value>rotate</value> </args> </radio> <radio row="5" col="2" halign="center"><name>phplog</name> <args> <disp>action</disp> <checked>' . (($logs_main->GetCleanPhpLog() or $logs_main->GetRotatePhpLog()) ? 'false' : 'true') . '</checked> <value>leave</value> </args> </radio> <label row="5" col="3"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('phplog_size.label')) . '</label> </args> </label> <radio row="6" col="0" halign="center"><name>siteslogs</name> <args> <disp>action</disp> <checked>' . ($logs_main->GetCleanSitesLogs() ? 'true' : 'false') . '</checked> <value>clean</value> </args> </radio> <radio row="6" col="1" halign="center"><name>siteslogs</name> <args> <disp>action</disp> <checked>' . ($logs_main->GetRotateSitesLogs() ? 'true' : 'false') . '</checked> <value>rotate</value> </args> </radio> <radio row="6" col="2" halign="center"><name>siteslogs</name> <args> <disp>action</disp> <checked>' . (($logs_main->GetCleanSitesLogs() or $logs_main->GetRotateSitesLogs()) ? 'false' : 'true') . '</checked> <value>leave</value> </args> </radio> <label row="6" col="3"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('siteslogs_size.label')) . '</label> </args> </label> </children> </grid> <horizbar/> <grid> <children> <checkbox row="0" col="0"><name>cache</name> <args> <disp>action</disp> <checked>' . ($cache_main->GetCleanCache() ? 'true' : 'false') . '</checked> </args> </checkbox> <label row="0" col="1"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('cache_size.label')) . '</label> </args> </label> <checkbox row="1" col="0"><name>sessions</name> <args> <disp>action</disp> <checked>' . ($cache_main->GetCleanSessions() ? 'true' : 'false') . '</checked> </args> </checkbox> <label row="1" col="1"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('sessions_size.label')) . '</label> </args> </label> <checkbox row="2" col="0"><name>pidfiles</name> <args> <disp>action</disp> <checked>' . ($cache_main->GetCleanPidFiles() ? 'true' : 'false') . '</checked> </args> </checkbox> <label row="2" col="1"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('pidfiles_size.label')) . '</label> </args> </label> <checkbox row="3" col="0"><name>amptempdirs</name> <args> <disp>action</disp> <checked>' . ($cache_main->GetCleanAmpTempDirs() ? 'true' : 'false') . '</checked> </args> </checkbox> <label row="3" col="1"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('tempdirs_size.label')) . '</label> </args> </label> <checkbox row="4" col="0"><name>clipboard</name> <args> <disp>action</disp> <checked>' . ($cache_main->GetCleanClipboard() ? 'true' : 'false') . '</checked> </args> </checkbox> <label row="4" col="1"> <args> <label type="encoded">' . urlencode($gLocale->GetStr('clipboard_size.label')) . '</label> </args> </label> </children> </grid> </children> </vertgroup> </children> </form> <horizbar/> <button> <args> <themeimage>button_ok</themeimage> <label type="encoded">' . urlencode($gLocale->GetStr('apply.button')) . '</label> <horiz>true</horiz> <frame>false</frame> <formsubmit>settings</formsubmit> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'ampoliros'), array('action', 'set_ampoliros')))) . '</action> </args> </button> </children> </vertgroup> </children> </tab>'; $gPage_title .= ' - ' . $gLocale->GetStr('ampoliros.title'); }
$pass_data = $pass_disp->GetEventData(); $country = $pass_data['country']; if (!strlen($country)) { $country = AMP_COUNTRY; } $args['dbname'] = AMP_DBNAME; $args['dbhost'] = AMP_DBHOST; $args['dbport'] = AMP_DBPORT; $args['dbuser'] = AMP_DBUSER; $args['dbpass'] = AMP_DBPASS; $args['dbtype'] = AMP_DBTYPE; $args['dblog'] = AMP_DBLOG; $layer = new DBLayerFactory(); $tmpdb = $layer->NewDBLayer($args); if ($tmpdb->Connect($args)) { $loc_country = new LocaleCountry($country); $country_language = $loc_country->Language(); $language_locale = new Locale('amp_misc_locale', AMP_LANG); $selected_language = $pass_disp->GetEventData(); $selected_language = $selected_language['language']; $hui_vgroup = new HuiVertGroup('vgroup'); $language_query =& $tmpdb->Execute('SELECT * ' . 'FROM languages'); while (!$language_query->eof) { $languages[$language_query->Fields('langshort')] = $language_locale->GetStr($language_query->Fields('langname')); $language_query->MoveNext(); } $hui_locale_grid = new HuiGrid('localegrid'); $hui_locale_grid->AddChild(new HuiLabel('languagelabel', array('label' => $amp_locale->GetStr('language_label'))), 0, 0); $hui_locale_grid->AddChild(new HuiComboBox('language', array('disp' => 'pass', 'elements' => $languages, 'default' => $selected_language ? $selected_language : $country_language)), 0, 1); $hui_vgroup->AddChild($hui_locale_grid); $hui_vgroup->AddChild(new HuiHorizBar('horizbar1'));
function main_language($eventData) { global $env, $hui_mainframe, $hui_titlebar, $amp_locale, $pass_disp, $hui_mainstatus; $loc_country = new LocaleCountry($env[$env['currentuser'] . '-country']); $country_language = $loc_country->Language(); $language_locale = new Locale('amp_misc_locale', $env[$env['currentuser'] . '-language']); $selected_language = $pass_disp->GetEventData(); $selected_language = $selected_language['language']; $hui_vgroup = new HuiVertGroup('vgroup'); $language_query =& $env['ampdb']->Execute('SELECT * ' . 'FROM languages'); while (!$language_query->eof) { $languages[$language_query->Fields('langshort')] = $language_locale->GetStr($language_query->Fields('langname')); $language_query->MoveNext(); } $hui_locale_grid = new HuiGrid('localegrid', array('rows' => '1', 'cols' => '3')); $hui_locale_grid->AddChild(new HuiLabel('languagelabel', array('label' => $amp_locale->GetStr('language_label'))), 0, 0); $hui_locale_grid->AddChild(new HuiComboBox('language', array('disp' => 'pass', 'elements' => $languages, 'default' => $selected_language ? $selected_language : $env[$env['currentuser'] . '-language'])), 0, 1); $hui_locale_grid->AddChild(new HuiSubmit('submit1', array('caption' => $amp_locale->GetStr('language_submit'))), 0, 2); $hui_vgroup->AddChild($hui_locale_grid); $hui_vgroup->AddChild(new HuiHorizBar('horizbar1')); $hui_vgroup->AddChild(new HuiLabel('deflanglabel', array('label' => sprintf($amp_locale->GetStr('countrylanguage_label'), $languages[$country_language])))); $form_events_call = new HuiEventsCall(); $form_events_call->AddEvent(new HuiEvent('pass', 'setlanguage', '')); $form_events_call->AddEvent(new HuiEvent('main', 'language', '')); $hui_form = new HuiForm('languageform', array('action' => $form_events_call->GetEventsCallString())); $hui_form->AddChild($hui_vgroup); $hui_mainframe->AddChild($hui_form); $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('language_title'); }
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'); }