function main_innomatic($eventData) { global $gXmlDefinition, $gLocale, $gPageTitle; $country = new \Innomatic\Locale\LocaleCountry(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCountry()); $tabs[0]['label'] = $gLocale->getStr('innomatic_status.tab'); $tabs[1]['label'] = $gLocale->getStr('innomatic_requirements.tab'); $tabs[2]['label'] = $gLocale->getStr('innomatic_settings.tab'); $logsMain = new \Shared\Maintenance\InnomaticLogsMaintenance(); $cacheMain = new \Shared\Maintenance\InnomaticCacheMaintenance(); $gXmlDefinition = '<tab><name>innomatic</name> <args> <tabs type="array">' . WuiXml::encode($tabs) . '</tabs> <tabactionfunction>innomatic_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('innomatic_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($logsMain->getSystemLogsSize())) . '</value> </args> </string> <button row="0" col="2"> <args> <themeimage>documentdelete</themeimage> <label type="encoded">' . urlencode($gLocale->getStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'innomatic'), array('action', 'clear_systemlogs')))) . '</action> </args> </button> <label row="1" col="0"> <args> <label type="encoded">' . urlencode($gLocale->getStr('domainslogs_size.label')) . '</label> </args> </label> <string row="1" col="1"> <args> <size>15</size> <readonly>true</readonly> <value type="encoded">' . urlencode($country->FormatNumber($logsMain->getDomainsLogsSize())) . '</value> </args> </string> <button row="1" col="2"> <args> <themeimage>documentdelete</themeimage> <label type="encoded">' . urlencode($gLocale->getStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'innomatic'), array('action', 'clear_domainslogs')))) . '</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($cacheMain->getCacheSize())) . '</value> </args> </string> <button row="2" col="2"> <args> <themeimage>documentdelete</themeimage> <label type="encoded">' . urlencode($gLocale->getStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'innomatic'), 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($cacheMain->getSessionsSize())) . '</value> </args> </string> <button row="3" col="2"> <args> <themeimage>documentdelete</themeimage> <label type="encoded">' . urlencode($gLocale->getStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'innomatic'), 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($cacheMain->getPidFilesSize())) . '</value> </args> </string> <button row="4" col="2"> <args> <themeimage>documentdelete</themeimage> <label type="encoded">' . urlencode($gLocale->getStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'innomatic'), 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($cacheMain->getRootTempDirsSize())) . '</value> </args> </string> <button row="5" col="2"> <args> <themeimage>documentdelete</themeimage> <label type="encoded">' . urlencode($gLocale->getStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'innomatic'), 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($cacheMain->getClipboardSize())) . '</value> </args> </string> <button row="6" col="2"> <args> <themeimage>documentdelete</themeimage> <label type="encoded">' . urlencode($gLocale->getStr('clear.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'innomatic'), 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($logsMain->getCleanableDiskSize() + $cacheMain->getCleanableDiskSize())) . '</value> </args> </string> <button row="7" col="2"> <args> <themeimage>documentdelete</themeimage> <label type="encoded">' . urlencode($gLocale->getStr('clearall.label')) . '</label> <horiz>true</horiz> <frame>false</frame> <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'innomatic'), 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('innomatic_requirements.label')) . '</label> <bold>true</bold> </args> </label> <table><name>sysinfotable</name> <children> '; $wuiWidget = new WuiXml('dummy'); // Required features // PHP version check // $row = 0; //if ( ereg( '[4-9]\.[0-9]\.[5-9].*', phpversion() ) or ereg( '[4-9]\.[1-9]\.[0-9].*', phpversion() ) ) if (ereg("[5-9]\\.[0-9]\\.[0-9].*", phpversion())) { $ball = $wuiWidget->mThemeHandler->mStyle['greenball']; $checkResult = sprintf($gLocale->getStr('php_available_label'), phpversion()); } else { $ball = $wuiWidget->mThemeHandler->mStyle['redball']; $checkResult = sprintf($gLocale->getStr('php_not_available_label'), phpversion()); } $gXmlDefinition .= '<label row="' . $row . '" col="0"><name>required' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('required_label')) . '</label></args></label> <image row="' . $row . '" col="1"><name>status' . $row . '</name><args><imageurl type="encoded">' . urlencode($ball) . '</imageurl></args></image> <label row="' . $row . '" col="2"><name>shared' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('php_test_label')) . '</label></args></label> <label row="' . $row . '" col="3"><name>checkresult' . $row . '</name><args><label type="encoded">' . urlencode($checkResult) . '</label></args></label>'; // File upload support // $row++; if (ini_get('file_uploads') == '1') { $ball = $wuiWidget->mThemeHandler->mStyle['greenball']; $checkResult = $gLocale->getStr('fileupload_available_label'); } else { $ball = $wuiWidget->mThemeHandler->mStyle['redball']; $checkResult = $gLocale->getStr('fileupload_not_available_label'); $systemok = false; } $gXmlDefinition .= '<label row="' . $row . '" col="0"><name>required' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('required_label')) . '</label></args></label> <image row="' . $row . '" col="1"><name>status' . $row . '</name><args><imageurl type="encoded">' . urlencode($ball) . '</imageurl></args></image> <label row="' . $row . '" col="2"><name>shared' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('fileupload_test_label')) . '</label></args></label> <label row="' . $row . '" col="3"><name>checkresult' . $row . '</name><args><label type="encoded">' . urlencode($checkResult) . '</label></args></label>'; // XML support // $row++; if (function_exists('xml_set_object')) { $ball = $wuiWidget->mThemeHandler->mStyle['greenball']; $checkResult = $gLocale->getStr('xml_available_label'); } else { $ball = $wuiWidget->mThemeHandler->mStyle['redball']; $checkResult = $gLocale->getStr('xml_not_available_label'); } $gXmlDefinition .= '<label row="' . $row . '" col="0"><name>required' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('required_label')) . '</label></args></label> <image row="' . $row . '" col="1"><name>status' . $row . '</name><args><imageurl type="encoded">' . urlencode($ball) . '</imageurl></args></image> <label row="' . $row . '" col="2"><name>shared' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('xml_test_label')) . '</label></args></label> <label row="' . $row . '" col="3"><name>checkresult' . $row . '</name><args><label type="encoded">' . urlencode($checkResult) . '</label></args></label>'; // Zlib support // $row++; if (function_exists('gzinflate')) { $ball = $wuiWidget->mThemeHandler->mStyle['greenball']; $checkResult = $gLocale->getStr('zlib_available_label'); } else { $ball = $wuiWidget->mThemeHandler->mStyle['redball']; $checkResult = $gLocale->getStr('zlib_not_available_label'); } $gXmlDefinition .= '<label row="' . $row . '" col="0"><name>required' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('required_label')) . '</label></args></label> <image row="' . $row . '" col="1"><name>status' . $row . '</name><args><imageurl type="encoded">' . urlencode($ball) . '</imageurl></args></image> <label row="' . $row . '" col="2"><name>shared' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('zlib_test_label')) . '</label></args></label> <label row="' . $row . '" col="3"><name>checkresult' . $row . '</name><args><label type="encoded">' . urlencode($checkResult) . '</label></args></label>'; // Database support // $row++; if (function_exists('mysqli_connect') or function_exists('pg_connect')) { $ball = $wuiWidget->mThemeHandler->mStyle['greenball']; $checkResult = $gLocale->getStr('db_available_label'); } else { $ball = $wuiWidget->mThemeHandler->mStyle['redball']; $checkResult = $gLocale->getStr('db_not_available_label'); } $gXmlDefinition .= '<label row="' . $row . '" col="0"><name>required' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('required_label')) . '</label></args></label> <image row="' . $row . '" col="1"><name>status' . $row . '</name><args><imageurl type="encoded">' . urlencode($ball) . '</imageurl></args></image> <label row="' . $row . '" col="2"><name>shared' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('db_test_label')) . '</label></args></label> <label row="' . $row . '" col="3"><name>checkresult' . $row . '</name><args><label type="encoded">' . urlencode($checkResult) . '</label></args></label>'; // Optional features /* // Crontab // $row ++; if (strlen(\Innomatic\Core\InnomaticContainer::instance('\Innomatic\Core\InnomaticContainer')->getConfig()->value('RootCrontab'))) { $ball = $wuiWidget->mThemeHandler->mStyle['greenball']; $checkResult = $gLocale->getStr('crontab_available_label'); } else { $ball = $wuiWidget->mThemeHandler->mStyle['goldball']; $checkResult = $gLocale->getStr('crontab_not_available_label'); } $gXml_def .= '<label row="'.$row.'" col="0"><name>optional'.$row.'</name><args><label type="encoded">' .urlencode($gLocale->getStr('optional_label')).'</label></args></label> <image row="'.$row.'" col="1"><name>status'.$row.'</name><args><imageurl type="encoded">' .urlencode($ball).'</imageurl></args></image> <label row="'.$row.'" col="2"><name>shared'.$row.'</name><args><label type="encoded">' .urlencode($gLocale->getStr('crontab_test_label')).'</label></args></label> <label row="'.$row.'" col="3"><name>checkresult'.$row.'</name><args><label type="encoded">' .urlencode($checkResult).'</label></args></label>'; */ // XMLRPC auth // $row++; if (php_sapi_name() != 'cgi') { $ball = $wuiWidget->mThemeHandler->mStyle['greenball']; $checkResult = $gLocale->getStr('xmlrpc_available_label'); } else { $ball = $wuiWidget->mThemeHandler->mStyle['goldball']; $checkResult = $gLocale->getStr('xmlrpc_not_available_label'); } $gXmlDefinition .= '<label row="' . $row . '" col="0"><name>optional' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('optional_label')) . '</label></args></label> <image row="' . $row . '" col="1"><name>status' . $row . '</name><args><imageurl type="encoded">' . urlencode($ball) . '</imageurl></args></image> <label row="' . $row . '" col="2"><name>shared' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('xmlrpc_test_label')) . '</label></args></label> <label row="' . $row . '" col="3"><name>checkresult' . $row . '</name><args><label type="encoded">' . urlencode($checkResult) . '</label></args></label>'; // XMLRPC curl // $row++; if (function_exists('curl_init')) { $ball = $wuiWidget->mThemeHandler->mStyle['greenball']; $checkResult = $gLocale->getStr('xmlrpc_ssl_available_label'); } else { $ball = $wuiWidget->mThemeHandler->mStyle['goldball']; $checkResult = $gLocale->getStr('xmlrpc_ssl_not_available_label'); } $gXmlDefinition .= '<label row="' . $row . '" col="0"><name>optional' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('optional_label')) . '</label></args></label> <image row="' . $row . '" col="1"><name>status' . $row . '</name><args><imageurl type="encoded">' . urlencode($ball) . '</imageurl></args></image> <label row="' . $row . '" col="2"><name>shared' . $row . '</name><args><label type="encoded">' . urlencode($gLocale->getStr('xmlrpc_ssl_test_label')) . '</label></args></label> <label row="' . $row . '" col="3"><name>checkresult' . $row . '</name><args><label type="encoded">' . urlencode($checkResult) . '</label></args></label>'; $gXmlDefinition .= ' </children> </table> </children> </vertgroup> <vertgroup><name></name> <children> <label><name>tabtitle</name> <args> <label type="encoded">' . urlencode($gLocale->getStr('innomatic_settings.label')) . '</label> <bold>true</bold> </args> </label> <form><name>settings</name> <args> <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'innomatic'), array('action', 'set_innomatic')))) . '</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>rootlog</name> <args> <disp>action</disp> <checked>' . ($logsMain->getCleanRootLog() ? 'true' : 'false') . '</checked> <value>clean</value> </args> </radio> <radio row="1" col="1" halign="center"><name>rootlog</name> <args> <disp>action</disp> <checked>' . ($logsMain->getRotateRootLog() ? 'true' : 'false') . '</checked> <value>rotate</value> </args> </radio> <radio row="1" col="2" halign="center"><name>rootlog</name> <args> <disp>action</disp> <checked>' . (($logsMain->getCleanRootLog() or $logsMain->getRotateRootLog()) ? 'false' : 'true') . '</checked> <value>leave</value> </args> </radio> <label row="1" col="3"> <args> <label type="encoded">' . urlencode($gLocale->getStr('rootlog_size.label')) . '</label> </args> </label> <radio row="2" col="0" halign="center"><name>rootdalog</name> <args> <disp>action</disp> <checked>' . ($logsMain->getCleanRootDbLog() ? 'true' : 'false') . '</checked> <value>clean</value> </args> </radio> <radio row="2" col="1" halign="center"><name>rootdalog</name> <args> <disp>action</disp> <checked>' . ($logsMain->getRotateRootDbLog() ? 'true' : 'false') . '</checked> <value>rotate</value> </args> </radio> <radio row="2" col="2" halign="center"><name>rootdalog</name> <args> <disp>action</disp> <checked>' . (($logsMain->getCleanRootDbLog() or $logsMain->getRotateRootDbLog()) ? 'false' : 'true') . '</checked> <value>leave</value> </args> </radio> <label row="2" col="3"> <args> <label type="encoded">' . urlencode($gLocale->getStr('rootdalog_size.label')) . '</label> </args> </label> <radio row="3" col="0" halign="center"><name>accesslog</name> <args> <disp>action</disp> <checked>' . ($logsMain->getCleanAccessLog() ? 'true' : 'false') . '</checked> <value>clean</value> </args> </radio> <radio row="3" col="1" halign="center"><name>accesslog</name> <args> <disp>action</disp> <checked>' . ($logsMain->getRotateAccessLog() ? 'true' : 'false') . '</checked> <value>rotate</value> </args> </radio> <radio row="3" col="2" halign="center"><name>accesslog</name> <args> <disp>action</disp> <checked>' . (($logsMain->getCleanAccessLog() or $logsMain->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>webserviceslog</name> <args> <disp>action</disp> <checked>' . ($logsMain->getCleanWebServicesLog() ? 'true' : 'false') . '</checked> <value>clean</value> </args> </radio> <radio row="4" col="1" halign="center"><name>webserviceslog</name> <args> <disp>action</disp> <checked>' . ($logsMain->getRotateWebServicesLog() ? 'true' : 'false') . '</checked> <value>rotate</value> </args> </radio> <radio row="4" col="2" halign="center"><name>webserviceslog</name> <args> <disp>action</disp> <checked>' . (($logsMain->getCleanWebServicesLog() or $logsMain->getRotateWebServicesLog()) ? 'false' : 'true') . '</checked> <value>leave</value> </args> </radio> <label row="4" col="3"> <args> <label type="encoded">' . urlencode($gLocale->getStr('webserviceslog_size.label')) . '</label> </args> </label> <radio row="5" col="0" halign="center"><name>phplog</name> <args> <disp>action</disp> <checked>' . ($logsMain->getCleanPhpLog() ? 'true' : 'false') . '</checked> <value>clean</value> </args> </radio> <radio row="5" col="1" halign="center"><name>phplog</name> <args> <disp>action</disp> <checked>' . ($logsMain->getRotatePhpLog() ? 'true' : 'false') . '</checked> <value>rotate</value> </args> </radio> <radio row="5" col="2" halign="center"><name>phplog</name> <args> <disp>action</disp> <checked>' . (($logsMain->getCleanPhpLog() or $logsMain->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>domainslogs</name> <args> <disp>action</disp> <checked>' . ($logsMain->getCleanDomainsLogs() ? 'true' : 'false') . '</checked> <value>clean</value> </args> </radio> <radio row="6" col="1" halign="center"><name>domainslogs</name> <args> <disp>action</disp> <checked>' . ($logsMain->getRotateDomainsLogs() ? 'true' : 'false') . '</checked> <value>rotate</value> </args> </radio> <radio row="6" col="2" halign="center"><name>domainslogs</name> <args> <disp>action</disp> <checked>' . (($logsMain->getCleanDomainsLogs() or $logsMain->getRotateDomainsLogs()) ? 'false' : 'true') . '</checked> <value>leave</value> </args> </radio> <label row="6" col="3"> <args> <label type="encoded">' . urlencode($gLocale->getStr('domainslogs_size.label')) . '</label> </args> </label> </children> </grid> <horizbar/> <grid> <children> <checkbox row="0" col="0"><name>cache</name> <args> <disp>action</disp> <checked>' . ($cacheMain->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>' . ($cacheMain->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>' . ($cacheMain->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>roottempdirs</name> <args> <disp>action</disp> <checked>' . ($cacheMain->getCleanRootTempDirs() ? '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>' . ($cacheMain->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>buttonok</themeimage> <label type="encoded">' . urlencode($gLocale->getStr('apply.button')) . '</label> <horiz>true</horiz> <frame>false</frame> <formsubmit>settings</formsubmit> <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'innomatic'), array('action', 'set_innomatic')))) . '</action> </args> </button> </children> </vertgroup> </children> </tab>'; $gPageTitle .= ' - ' . $gLocale->getStr('innomatic.title'); }
function main_localization($eventData) { global $wuiMainFrame, $wuiTitleBar, $innomaticLocale, $actionDispatcher, $wuiMainStatus; $eventData = $actionDispatcher->getEventData(); $countryLocale = new \Innomatic\Locale\LocaleCatalog('innomatic::localization', \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getLanguage()); $selectedCountry = ''; if (isset($eventData['country'])) { $selectedCountry = $eventData['country']; } $wuiVGroup = new WuiVertgroup('vgroup'); $countryQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT * FROM locale_countries'); while (!$countryQuery->eof) { $countries[$countryQuery->getFields('countryname')] = $countryLocale->getStr($countryQuery->getFields('countryname')); $countryQuery->moveNext(); } $wuiLocaleGrid = new WuiGrid('localegrid', array('rows' => '1', 'cols' => '3')); $wuiLocaleGrid->addChild(new WuiLabel('countrylabel', array('label' => $innomaticLocale->getStr('country_label'))), 0, 0); $wuiLocaleGrid->addChild(new WuiComboBox('country', array('disp' => 'action', 'elements' => $countries, 'default' => $selectedCountry ? $selectedCountry : \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCountry())), 0, 1); $wuiLocaleGrid->addChild(new WuiSubmit('submit1', array('caption' => $innomaticLocale->getStr('country_submit'))), 0, 2); $wuiVGroup->addChild($wuiLocaleGrid); $formEventsCall = new \Innomatic\Wui\Dispatch\WuiEventsCall(); $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'setcountry', '')); $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'localization', '')); $wuiForm = new WuiForm('countryform', array('action' => $formEventsCall->getEventsCallString())); $wuiForm->addChild($wuiVGroup); $wuiMainFrame->addChild($wuiForm); $locCountry = new \Innomatic\Locale\LocaleCountry(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCountry()); $countryLanguage = $locCountry->Language(); $languageLocale = new \Innomatic\Locale\LocaleCatalog('innomatic::localization', \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getLanguage()); $selectedLanguage = ''; if (isset($eventData['language'])) { $selectedLanguage = $eventData['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' => $innomaticLocale->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')->getLanguage())), 0, 1); $wuiLocaleGrid->addChild(new WuiSubmit('submit1', array('caption' => $innomaticLocale->getStr('language_submit'))), 0, 2); $wuiVGroup->addChild($wuiLocaleGrid); $wuiVGroup->addChild(new WuiHorizBar('horizbar1')); $wuiVGroup->addChild(new WuiLabel('deflanglabel', array('label' => sprintf($innomaticLocale->getStr('countrylanguage_label'), $languages[$countryLanguage])))); $formEventsCall = new \Innomatic\Wui\Dispatch\WuiEventsCall(); $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'setlanguage', '')); $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'localization', '')); $wuiForm = new WuiForm('languageform', array('action' => $formEventsCall->getEventsCallString())); $wuiForm->addChild($wuiVGroup); $wuiMainFrame->addChild($wuiForm); $wuiTitleBar->mTitle .= ' - ' . $innomaticLocale->getStr('country_title'); }
/** * Gets the whole log of the current Innowork item. * * @access public * @return array */ public function getLog() { $result = array(); $dataAccess = $this->container->getCurrentDomain()->getDataAccess(); $log_query = $dataAccess->execute('SELECT username,eventtime' . ' FROM innowork_core_itemslog' . ' WHERE itemtype=' . $dataAccess->formatText($this->itemType) . ' AND itemid=' . $this->itemId); while (!$log_query->eof) { $country = new \Innomatic\Locale\LocaleCountry($this->container->getCurrentUser()->getCountry()); $date_array = $country->getDateArrayFromSafeTimestamp($log_query->getFields('eventtime')); $result[] = $country->formatShortArrayDate($date_array) . ' ' . $country->FormatArrayTime($date_array) . ' ' . $log_query->getFields('username'); $log_query->moveNext(); } $log_query->free(); return $result; }
$pass_data = $actionDispatcher->getEventData(); $country = isset($pass_data['country']) ? $pass_data['country'] : ''; if (!strlen($country)) { $country = $container->getCountry(); } $args['dbname'] = $container->getConfig()->value('RootDatabaseName'); $args['dbhost'] = $container->getConfig()->value('RootDatabaseHost'); $args['dbport'] = $container->getConfig()->value('RootDatabasePort'); $args['dbuser'] = $container->getConfig()->value('RootDatabaseUser'); $args['dbpass'] = $container->getConfig()->value('RootDatabasePassword'); $args['dbtype'] = $container->getConfig()->value('RootDatabaseType'); $args['dblog'] = $container->getHome() . 'core/log/innomatic_root_db.log'; $dasn_string = $args['dbtype'] . '://' . $args['dbuser'] . ':' . $args['dbpass'] . '@' . $args['dbhost'] . ':' . $args['dbport'] . '/' . $args['dbname'] . '?' . 'logfile=' . $args['dblog']; $tmpdb = \Innomatic\Dataaccess\DataAccessFactory::getDataAccess(new \Innomatic\Dataaccess\DataAccessSourceName($dasn_string)); if ($tmpdb->Connect()) { $loc_country = new \Innomatic\Locale\LocaleCountry($country); $country_language = $loc_country->Language(); $language_locale = new \Innomatic\Locale\LocaleCatalog('innomatic::localization', $container->getLanguage()); $selected_language = $actionDispatcher->getEventData(); if (isset($selected_language['language'])) { $selected_language = $selected_language['language']; } else { $selected_language = false; } $wui_vgroup = new WuiVertgroup('vgroup'); $language_query = $tmpdb->execute('SELECT * FROM locale_languages'); while (!$language_query->eof) { $languages[$language_query->getFields('langshort')] = $language_locale->getStr($language_query->getFields('langname')); $language_query->moveNext(); } $wui_locale_grid = new WuiGrid('localegrid');