public function getHTML()
 {
     $locale_catalog = new \Innomatic\Locale\LocaleCatalog('innowork-core::misc', InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getCurrentUser()->getLanguage());
     $theme = \Innomatic\Wui\Wui::instance('\\Innomatic\\Wui\\Wui')->getTheme();
     $icon = $theme->mIconsBase . $theme->mIconsSet['light']['trash']['base'] . '/light/' . $theme->mIconsSet['light']['trash']['file'];
     return '<a href="' . \Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('1innoworkcore', array(array('view', 'trashcan', ''))) . '" alt="' . $locale_catalog->getStr('trashcan.menu') . '"><img width="25" height="25" align="right" src="' . $icon . '" alt="' . $locale_catalog->getStr('trashcan.menu') . '" /></a>';
 }
예제 #2
0
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');
}
예제 #3
0
function main_keyring($eventData)
{
    global $gXmlDefinition, $gLocale, $gPageTitle, $gStatus;
    $query = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->Execute('SELECT * ' . 'FROM applications_keyring_keys ' . 'ORDER BY application,version,domain');
    $gXmlDefinition .= '<vertgroup><name>vg</name><children>';
    if ($query->getNumberRows()) {
        $headers[0]['label'] = $gLocale->getStr('application.header');
        $headers[1]['label'] = $gLocale->getStr('version.header');
        $headers[2]['label'] = $gLocale->getStr('domain.header');
        $headers[3]['label'] = $gLocale->getStr('maxdomainusers.header');
        $headers[4]['label'] = $gLocale->getStr('validip.header');
        $headers[5]['label'] = $gLocale->getStr('validrange.header');
        $headers[6]['label'] = $gLocale->getStr('expirydate.header');
        $gXmlDefinition .= '<table>
  <args>
    <headers type="array">' . WuiXml::encode($headers) . '</headers>
    <rowsperpage>20</rowsperpage>
    <pagesactionfunction>keys_page_action_builder</pagesactionfunction>
    <pagenumber>' . (isset($eventData['page']) ? $eventData['page'] : '') . '</pagenumber>
  </args>
  <children>';
        $row = 0;
        while (!$query->eof) {
            $toolbars = '<button>
                    <args>
              <label>' . WuiXml::cdata($gLocale->getStr('removekey.button')) . '</label>
        <themeimage>trash</themeimage>
        <horiz>true</horiz>
                <needconfirm>true</needconfirm>
                    <confirmmessage>' . WuiXml::cdata($gLocale->getStr('remove_key.confirm')) . '</confirmmessage>
        <action>' . WuiXml::cdata(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'keyring'), array('action', 'removekey', array('id' => $query->getFields('id')))))) . '</action>
                  </args>
                </button>';
            $gXmlDefinition .= '<label row="' . $row . '" col="0">
  <args>
    <label type="encoded">' . urlencode($query->getFields('application')) . '</label>
  </args>
</label>
<label row="' . $row . '" col="1">
  <args>
    <label type="encoded">' . urlencode($query->getFields('version')) . '</label>
  </args>
</label>
<label row="' . $row . '" col="2">
  <args>
    <label type="encoded">' . urlencode($query->getFields('domain')) . '</label>
  </args>
</label>
<label row="' . $row . '" col="3">
  <args>
    <label type="encoded">' . urlencode($query->getFields('maxdomainusers')) . '</label>
  </args>
</label>
<label row="' . $row . '" col="4">
  <args>
    <label type="encoded">' . urlencode($query->getFields('validip')) . '</label>
  </args>
</label>
<label row="' . $row . '" col="5">
  <args>
    <label type="encoded">' . urlencode($query->getFields('validrange')) . '</label>
  </args>
</label>
<label row="' . $row . '" col="6">
  <args>
    <label type="encoded">' . urlencode($query->getFields('expirydate')) . '</label>
  </args>
</label>
<horizgroup row="' . $row . '" col="7">
    <children>' . $toolbars . '</children>
</horizgroup>';
            $query->moveNext();
            $row++;
        }
        $gXmlDefinition .= '  </children>
</table>

<horizbar><name>hb</name></horizbar>';
    } else {
        if (!strlen($gStatus)) {
            $gStatus = $gLocale->getStr('nokeys.status');
        }
    }
    $gXmlDefinition .= '<vertgroup>
  <children>

    <form><name>newkey</name>
      <args>
        <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'keyring'), array('action', 'newkey')))) . '</action>
      </args>
      <children>

        <grid>
          <children>

            <label row="0" col="0">
              <args>
                <label type="encoded">' . urlencode($gLocale->getStr('key.label')) . '</label>
              </args>
            </label>

            <file row="0" col="1"><name>key</name>
              <args>
                <disp>action</disp>
              </args>
            </file>

    <button row="0" col="2">
      <args>
        <horiz>true</horiz>
        <frame>false</frame>
        <themeimage>mathadd</themeimage>
        <formsubmit>newkey</formsubmit>
        <label type="encoded">' . urlencode($gLocale->getStr('newkey.submit')) . '</label>
        <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'keyring'), array('action', 'newkey')))) . '</action>
      </args>
    </button>

          </children>
        </grid>

      </children>
    </form>

  </children>
</vertgroup>';
    $gXmlDefinition .= '</children></vertgroup>';
    $gPageTitle .= ' - ' . $gLocale->getStr('keys.title');
}
예제 #4
0
 /**
  * Return a WUI event call for viewing the given item type / item id.
  *
  * @param string $itemType Internal item type
  * @param string $itemId Item id
  * @static
  * @access public
  * @return string WUI event call url string
  */
 public static function getShowItemAction($itemType, $itemId)
 {
     $container = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer');
     // Get the items list
     $core = self::instance('\\Innowork\\Core\\InnoworkCore', $container->getDataAccess(), $container->getCurrentDomain()->getDataAccess());
     $summaries = $core->getSummaries();
     // Check if the type exists
     if (!isset($summaries[$itemType]['classname'])) {
         return '';
     }
     // Build the WUI event URL string
     $action = \Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString($summaries[$itemType]['domainpanel'], array(array($summaries[$itemType]['showdispatcher'], $summaries[$itemType]['showevent'], array('id' => $itemId))));
     return $action;
 }
예제 #5
0
function webservicesprofiles_list_action_builder($pageNumber)
{
    return \Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'default', array('webservicesprofilespage' => $pageNumber))));
}
예제 #6
0
function main_default($eventData)
{
    global $wuiMainFrame, $wuiTitleBar, $innomaticLocale, $actionDispatcher, $wuiMainStatus, $wuiComments, $compressedOb;
    $appCfg = new \Innomatic\Application\ApplicationSettings('innomatic');
    $themesQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT name,catalog FROM wui_themes ');
    while (!$themesQuery->eof) {
        $tmpLocale = new \Innomatic\Locale\LocaleCatalog($themesQuery->getFields('catalog'), \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getLanguage());
        $elements[$themesQuery->getFields('name')] = $tmpLocale->getStr($themesQuery->getFields('name'));
        $themesQuery->moveNext();
    }
    asort($elements);
    $themesXmlDef = '<vertgroup><name>vgroup</name><args><halign>center</halign></args><children>
        <form><name>theme</name><args><action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'default', ''), array('action', 'settheme', '')))) . '</action></args><children>
        <grid><name>themegrid</name><children>
            <label row="0" col="0"><name>themelabel</name><args><label type="encoded">' . urlencode($innomaticLocale->getStr('themes_label')) . '</label><bold>true</bold></args></label>
            <listbox row="1" col="0"><name>theme</name><args><elements type="array">' . WuiXml::encode($elements) . '</elements><default>' . \Innomatic\Wui\Wui::instance('\\Innomatic\\Wui\\Wui')->getThemeName() . '</default><disp>action</disp><size>10</size></args></listbox>
        </children></grid>
        <submit><name>submit</name><args><caption type="encoded">' . urlencode($innomaticLocale->getStr('settheme_submit')) . '</caption></args></submit>
      </children></form>
    </children></vertgroup>';
    // Service provider settings
    // Service Provider
    //
    $serviceProviderFrame = new WuiVertframe('serviceproviderframe');
    $serviceProviderVGroup = new WuiVertgroup('serviceprovidervgroup', array('width' => '100%'));
    $serviceProviderVGroup->addChild(new WuiLabel('serviceproviderlabel', array('label' => $innomaticLocale->getStr('serviceproviderframe_label'), 'bold' => 'true')));
    $serviceProviderGrid = new WuiGrid('serviceprovidergrid', array('rows' => '4', 'cols' => '2'));
    // Service Provider name
    //
    $serviceProviderGrid->addChild(new WuiLabel('serviceprovidername_label', array('label' => $innomaticLocale->getStr('serviceprovidername_label'))), 0, 0);
    $serviceProviderGrid->addChild(new WuiString('serviceprovidername', array('disp' => 'action', 'size' => '30', 'value' => $appCfg->getKey('serviceprovider-name'))), 0, 1);
    // Service Provider url
    //
    $serviceProviderGrid->addChild(new WuiLabel('serviceproviderurl_label', array('label' => $innomaticLocale->getStr('serviceproviderurl_label'))), 1, 0);
    $serviceProviderGrid->addChild(new WuiString('serviceproviderurl', array('disp' => 'action', 'size' => '30', 'value' => $appCfg->getKey('serviceprovider-url'))), 1, 1);
    // Service Provider big logo
    //
    $serviceProviderGrid->addChild(new WuiLabel('serviceproviderbiglogo_label', array('label' => $innomaticLocale->getStr('serviceproviderbiglogo_label'))), 2, 0);
    $serviceProviderGrid->addChild(new WuiFile('serviceproviderbiglogo', array('disp' => 'action')), 2, 1);
    // Service Provider link logo
    //
    $serviceProviderGrid->addChild(new WuiLabel('serviceproviderlogo_label', array('label' => $innomaticLocale->getStr('serviceproviderlogo_label'))), 3, 0);
    $serviceProviderGrid->addChild(new WuiFile('serviceproviderlinklogo', array('disp' => 'action')), 3, 1);
    $serviceProviderVGroup->addChild($serviceProviderGrid);
    $serviceProviderVGroup->addChild(new WuiSubmit('serviceprovidersubmit', array('caption' => $innomaticLocale->getStr('serviceprovider_submit'))));
    $formEventsCall = new \Innomatic\Wui\Dispatch\WuiEventsCall();
    $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'setserviceprovider', ''));
    $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'default', ''));
    $serviceProviderForm = new WuiForm('setserviceproviderform', array('action' => $formEventsCall->getEventsCallString()));
    $serviceProviderForm->addChild($serviceProviderVGroup);
    // Enabled icons
    //
    $enableVGroup = new WuiVertgroup('enablevgroup', array('width' => '100%'));
    $enableVGroup->addChild(new WuiLabel('enablelabel', array('label' => $innomaticLocale->getStr('enabled_icons_label'), 'bold' => 'true')));
    $enableGrid = new WuiGrid('enablegrid', array('rows' => '5', 'cols' => '2'));
    // Innomatic site link
    //
    $enableGrid->addChild(new WuiLabel('innomaticlabel', array('label' => $innomaticLocale->getStr('innomatic_link_enabled_label'))), 0, 1);
    $enableGrid->addChild(new WuiCheckBox('innomaticicon', array('disp' => 'action', 'checked' => $appCfg->getKey('innomatic-link-disabled') ? 'false' : 'true')), 0, 0);
    // Service Provider link
    //
    $enableGrid->addChild(new WuiLabel('serviceprovidericonlabel', array('label' => $innomaticLocale->getStr('serviceprovider_link_enabled_label'))), 1, 1);
    $enableGrid->addChild(new WuiCheckBox('serviceprovidericon', array('disp' => 'action', 'checked' => $appCfg->getKey('serviceprovider-link-disabled') ? 'false' : 'true')), 1, 0);
    // Innomatic big logo
    //
    $enableGrid->addChild(new WuiLabel('innomaticbigiconlabel', array('label' => $innomaticLocale->getStr('innomatic_biglogo_enabled_label'))), 2, 1);
    $enableGrid->addChild(new WuiCheckBox('innomaticbigicon', array('disp' => 'action', 'checked' => $appCfg->getKey('innomatic-biglogo-disabled') ? 'false' : 'true')), 2, 0);
    // Service Provider logo
    //
    $enableGrid->addChild(new WuiLabel('serviceprovidericonlabel', array('label' => $innomaticLocale->getStr('serviceprovider_biglogo_enabled_label'))), 3, 1);
    $enableGrid->addChild(new WuiCheckBox('serviceproviderbigicon', array('disp' => 'action', 'checked' => $appCfg->getKey('serviceprovider-biglogo-disabled') ? 'false' : 'true')), 3, 0);
    $enableVGroup->addChild($enableGrid);
    $enableVGroup->addChild(new WuiSubmit('enablesubmit', array('caption' => $innomaticLocale->getStr('enable_submit'))));
    $formEventsCall = new \Innomatic\Wui\Dispatch\WuiEventsCall();
    $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'setenabledicons', ''));
    $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'default', ''));
    $enableForm = new WuiForm('setenableform', array('action' => $formEventsCall->getEventsCallString()));
    $enableForm->addChild($enableVGroup);
    // Advanced settings
    //
    $advancedVGroup = new WuiVertgroup('enablevgroup', array('width' => '100%'));
    $advancedVGroup->addChild(new WuiLabel('enablelabel', array('label' => $innomaticLocale->getStr('advancedsettings_label'), 'bold' => 'true')));
    $advancedGrid = new WuiGrid('enablegrid', array('rows' => '2', 'cols' => '2'));
    // Compressed output buffering
    //
    $advancedGrid->addChild(new WuiLabel('compressed-ob-label', array('label' => $innomaticLocale->getStr('compressed-ob_label'))), 0, 1);
    if (!strlen($compressedOb)) {
        if (\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getConfig()->value('CompressedOutputBuffering') == '1') {
            $compressedOb = 'true';
        } else {
            $compressedOb = 'false';
        }
    }
    $advancedGrid->addChild(new WuiCheckBox('compressed-ob', array('disp' => 'action', 'checked' => $compressedOb)), 0, 0);
    // WUI code comments
    //
    $advancedGrid->addChild(new WuiLabel('wui-comments-label', array('label' => $innomaticLocale->getStr('wui-comments_label'))), 1, 1);
    if (!strlen($wuiComments)) {
        if (\Innomatic\Wui\Wui::showSourceComments()) {
            $wuiComments = 'true';
        } else {
            $wuiComments = 'false';
        }
    }
    $advancedGrid->addChild(new WuiCheckBox('wui-comments', array('disp' => 'action', 'checked' => $wuiComments)), 1, 0);
    $advancedVGroup->addChild($advancedGrid);
    $advancedVGroup->addChild(new WuiSubmit('enablesubmit', array('caption' => $innomaticLocale->getStr('advanced_submit'))));
    $formEventsCall = new \Innomatic\Wui\Dispatch\WuiEventsCall();
    $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'setadvanced', ''));
    $formEventsCall->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'default', ''));
    $advancedForm = new WuiForm('setenableform', array('action' => $formEventsCall->getEventsCallString()));
    $advancedForm->addChild($advancedVGroup);
    $tabHeaders[0]['label'] = $innomaticLocale->getStr('themes_title');
    $tabHeaders[1]['label'] = $innomaticLocale->getStr('serviceproviderframe_label');
    $tabHeaders[2]['label'] = $innomaticLocale->getStr('enabled_icons_label');
    $tabHeaders[3]['label'] = $innomaticLocale->getStr('advancedsettings_label');
    $tab = new WuiTab('interface', array('tabactionfunction' => 'interface_tab_action_builder', 'activetab' => isset($eventData['activetab']) ? $eventData['activetab'] : '', 'tabs' => $tabHeaders));
    $tab->addChild(new WuiXml('page', array('definition' => $themesXmlDef)));
    $tab->addChild($serviceProviderForm);
    $tab->addChild($enableForm);
    $tab->addChild($advancedForm);
    $wuiMainFrame->addChild($tab);
    $wuiTitleBar->mTitle .= ' - ' . $innomaticLocale->getStr('default_title');
}
예제 #7
0
function main_change_password($eventData)
{
    global $gXmlDefinition, $gLocale, $gPageTitle;
    global $wuiMainFrame;
    $gXmlDefinition = '            <table><name>alerts</name>
              <args>
                <headers type="array">' . WuiXml::encode(array(0 => array('label' => $gLocale->getStr('password_title')))) . '</headers>
              </args>
              <children>
    <form row="0" col="0">
    <name>password</name>
                  <args>
                    <method>post</method>
                    <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'change_password', ''), array('action', 'change_password', '')))) . '</action>
                  </args>
    <children>
    <grid>
        <name></name>
        <args>
            <rows>3</rows>
            <cols>2</cols>
        </args>
        <children>
            <label row="0" col="0">
                  <name />
                  <args>
                      <label type="encoded">' . urlencode($gLocale->getStr('rootpasswordold_label')) . '</label>
                  </args>
            </label>
            <string row="0" col="1">
                <name>oldpassword</name>
                <args>
                    <disp>action</disp>
                    <password>true</password>
                </args>
            </string>
            <label row="1" col="0">
                  <name />
                  <args>
                      <label type="encoded">' . urlencode($gLocale->getStr('rootpasswordold_label')) . '</label>
                  </args>
            </label>
            <string row="1" col="1">
                <name>newpassworda</name>
                <args>
                    <disp>action</disp>
                    <password>true</password>
                </args>
            </string>
            <label row="2" col="0">
                  <name />
                  <args>
                      <label type="encoded">' . urlencode($gLocale->getStr('rootpasswordold_label')) . '</label>
                  </args>
            </label>
            <string row="2" col="1">
                <name>newpasswordb</name>
                <args>
                    <disp>action</disp>
                    <password>true</password>
                </args>
            </string>
            </children>
    </grid>
    </children>
    </form>
                    <button row="1" col="0"><name>apply</name>
                  <args>
                    <horiz>true</horiz>
                    <frame>false</frame>
                    <label type="encoded">' . urlencode($gLocale->getStr('apply.submit')) . '</label>
                    <themeimage>buttonok</themeimage>
                    <formsubmit>password</formsubmit>
                    <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'change_password', ''), array('action', 'change_password', '')))) . '</action>
                  </args>
                </button>
    </children>
    </table>';
    $gPageTitle .= ' - ' . $gLocale->getStr('password_title');
}
 public function viewNewrole($eventData)
 {
     $xml = '<vertgroup><children>
         <form><name>newrole</name>
           <args><action>' . WuiXml::cdata(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'roles', array()), array('action', 'addrole', array())))) . '</action></args>
           <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><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><cols>40</cols><rows>5</rows></args></text>
               </children></grid>
         </children></form>
         <horizbar/>
         <horizgroup><children>
           <button><name>save</name>
             <args>
               <themeimage>buttonok</themeimage>
               <label>' . WuiXml::cdata($this->localeCatalog->getStr('newrole_button')) . '</label>
               <action>' . WuiXml::cdata(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'roles', array()), array('action', 'addrole', array())))) . '</action>
               <formsubmit>newrole</formsubmit>
               <horiz>true</horiz>
               <frame>false</frame>
             </args>
           </button>
         </children></horizgroup>
         </children></vertgroup>';
     $this->wuiMainframe->addChild(new WuiXml('newrole', array('definition' => $xml)));
 }
    public function viewdomainapplications($eventData)
    {
        $domainQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT * FROM domains WHERE id=' . $eventData['domainid']);
        $domainData = $domainQuery->getFields();
        $applicationsQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT * FROM applications WHERE onlyextension <> ' . \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->formatText(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->fmttrue) . ' ORDER BY appid');
        if ($applicationsQuery) {
            if ($applicationsQuery->getNumberRows()) {
                $headers[0]['label'] = $this->_localeCatalog->getStr('status_header');
                $headers[1]['label'] = $this->_localeCatalog->getStr('applicationid_header');
                $headers[2]['label'] = $this->_localeCatalog->getStr('modactivationdate_header');
                $headers[4]['label'] = $this->_localeCatalog->getStr('appdeps_header');
                $row = 0;
                $wuiDomainApplicationsTable = new WuiTable('domainapplicationstable', array('headers' => $headers));
                while (!$applicationsQuery->eof) {
                    $applicationsData = $applicationsQuery->getFields();
                    if ($applicationsData['appid'] != 'innomatic') {
                        $actQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT * FROM applications_enabled WHERE domainid = ' . $eventData['domainid'] . ' AND applicationid = ' . $applicationsData['id']);
                        $wuiEnGroup[$row] = new WuiVertgroup('enable');
                        $wuiDomainApplicationsToolbar[$row] = new WuiHorizgroup('domainapplicationstoolbar' . $row);
                        $appDep = new \Innomatic\Application\ApplicationDependencies();
                        if ($actQuery->getNumberRows()) {
                            // Application is enabled
                            //
                            $actData = $actQuery->getFields();
                            $wuiDomainApplicationsTable->addChild(new WuiImage('status' . $row, array('imageurl' => $this->wuiMainframe->mThemeHandler->mStyle['greenball'])), $row, 0);
                            $wuiDomainApplicationsTable->addChild(new WuiLabel('appid' . $row, array('label' => $applicationsData['appid'], 'compact' => 'true')), $row, 1);
                            $wuiDomainApplicationsTable->addChild(new WuiLabel('actdate' . $row, array('label' => $actData['activationdate'], 'compact' => 'true')), $row, 2);
                            $domainDependingApplications = $appDep->checkDomainDependingApplications($applicationsData['appid'], $domainData['domainid']);
                            $application = new \Innomatic\Application\Application(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $applicationsData['id']);
                            $options = $application->getOptions();
                            if (!$domainDependingApplications) {
                                // No applications depends on this one
                                //
                                $disableAction[$row] = new \Innomatic\Wui\Dispatch\WuiEventsCall();
                                $disableAction[$row]->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'domainapplications', array('domainid' => $eventData['domainid'])));
                                $disableAction[$row]->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'deactivateapplication', array('domainid' => $eventData['domainid'], 'appid' => $applicationsData['id'])));
                                $wuiSisableButton[$row] = new WuiButton('disablebutton' . $row, array('label' => $this->_localeCatalog->getStr('deactivateapplication_label'), 'horiz' => 'true', 'themeimage' => 'buttoncancel', 'action' => $disableAction[$row]->getEventsCallString()));
                                $wuiDomainApplicationsToolbar[$row]->addChild($wuiSisableButton[$row]);
                                $wuiEnGroup[$row]->addChild($wuiDomainApplicationsToolbar[$row]);
                            } else {
                                // At least one application depends on this one
                                //
                                $appDepListStr = '';
                                while (list(, $dep) = each($domainDependingApplications)) {
                                    $appDepListStr .= $dep . '<br>';
                                }
                                $wuiDomainApplicationsTable->addChild(new WuiLabel('appdeps' . $row, array('label' => $appDepListStr)), $row, 4);
                            }
                            if (count($options)) {
                                $toolbar = array();
                                while (list(, $name) = each($options)) {
                                    $enabled = $application->checkIfOptionEnabled($name, $eventData['domainid']);
                                    $toolbar['view']['enable'] = array('label' => sprintf($this->_localeCatalog->getStr(($enabled ? 'disable' : 'enable') . '_option.button'), ucfirst($name)), 'themeimage' => $enabled ? 'buttoncancel' : 'buttonok', 'compact' => 'true', 'themeimagetype' => 'mini', 'horiz' => 'true', 'action' => \Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'domainapplications', array('domainid' => $eventData['domainid'])), array('action', $enabled ? 'disableoption' : 'enableoption', array('applicationid' => $applicationsData['id'], 'domainid' => $eventData['domainid'], 'option' => $name)))));
                                    $wuiEnGroup[$row]->addChild(new WuiInnomaticToolBar('view', array('frame' => 'false', 'toolbars' => $toolbar)));
                                }
                            }
                            $wuiDomainApplicationsTable->addChild($wuiEnGroup[$row], $row, 3);
                        } else {
                            // Application is not enabled
                            //
                            $wuiDomainApplicationsTable->addChild(new WuiImage('status' . $row, array('imageurl' => $this->wuiMainframe->mThemeHandler->mStyle['redball'])), $row, 0);
                            $wuiDomainApplicationsTable->addChild(new WuiLabel('appid' . $row, array('label' => $applicationsData['appid'])), $row, 1);
                            $domainApplicationDeps = $appDep->checkDomainApplicationDependencies($applicationsData['appid'], $domainData['domainid'], \Innomatic\Application\ApplicationDependencies::TYPE_DEPENDENCY);
                            if (!is_array($domainApplicationDeps)) {
                                // All application dependecies are met
                                //
                                $enableAction[$row] = new \Innomatic\Wui\Dispatch\WuiEventsCall();
                                $enableAction[$row]->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('view', 'domainapplications', array('domainid' => $eventData['domainid'])));
                                $enableAction[$row]->addEvent(new \Innomatic\Wui\Dispatch\WuiEvent('action', 'activateapplication', array('domainid' => $eventData['domainid'], 'appid' => $applicationsData['id'])));
                                $wuiEnableButton[$row] = new WuiButton('enablebutton' . $row, array('label' => $this->_localeCatalog->getStr('activateapplication_label'), 'horiz' => 'true', 'themeimage' => 'buttonok', 'action' => $enableAction[$row]->getEventsCallString()));
                                $wuiDomainApplicationsToolbar[$row]->addChild($wuiEnableButton[$row]);
                            } else {
                                // At least one application dependency is not met
                                //
                                $appDepListStr = '';
                                while (list(, $dep) = each($domainApplicationDeps)) {
                                    $appDepListStr .= $dep . '<br>';
                                }
                                $wuiDomainApplicationsTable->addChild(new WuiLabel('appdeps' . $row, array('label' => $appDepListStr)), $row, 4);
                            }
                            $wuiDomainApplicationsTable->addChild($wuiDomainApplicationsToolbar[$row], $row, 3);
                        }
                        $row++;
                    }
                    $applicationsQuery->moveNext();
                }
                $xmlDef = '<horizgroup>
              <children>

                <button>
                  <args>
                    <themeimage>buttonok</themeimage>
                    <label type="encoded">' . urlencode($this->_localeCatalog->getStr('enable_all_applications.button')) . '</label>
                    <horiz>true</horiz>
                    <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'domainapplications', array('domainid' => $eventData['domainid'])), array('action', 'activateallapplications', array('domainid' => $eventData['domainid']))))) . '</action>
                  </args>
                </button>

                <button>
                  <args>
                    <themeimage>buttoncancel</themeimage>
                    <label type="encoded">' . urlencode($this->_localeCatalog->getStr('disable_all_applications.button')) . '</label>
                    <horiz>true</horiz>
                    <needconfirm>true</needconfirm>
                    <confirmmessage type="encoded">' . urlencode($this->_localeCatalog->getStr('disable_all_applications.confirm')) . '</confirmmessage>
                    <action type="encoded">' . urlencode(\Innomatic\Wui\Dispatch\WuiEventsCall::buildEventsCallString('', array(array('view', 'domainapplications', array('domainid' => $eventData['domainid'])), array('action', 'deactivateallapplications', array('domainid' => $eventData['domainid']))))) . '</action>
                  </args>
                </button>

              </children>
            </horizgroup>';
                $wuiMainVGroup = new WuiVertgroup('');
                $wuiMainVGroup->addChild($wuiDomainApplicationsTable);
                $wuiMainVGroup->addChild(new WuiHorizBar(''));
                $wuiMainVGroup->addChild(new WuiXml('', array('definition' => $xmlDef)));
                $this->wuiMainframe->addChild($wuiMainVGroup);
            }
        }
        $this->wuiTitlebar->mArgs['title'] .= ' - ' . $domainData['domainid'] . ' (' . $domainData['domainname'] . ') - ' . $this->_localeCatalog->getStr('domainapplications_title');
    }