function action_uninstall($eventData)
{
    global $gLocale, $gLocale, $wuiPage, $gStatus;
    $tempApplication = new \Innomatic\Application\Application(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $eventData['appid']);
    if (!$tempApplication->uninstall()) {
        $unmetDeps = $tempApplication->getLastActionUnmetDeps();
        while (list($key, $val) = each($unmetDeps)) {
            $unmetDepsStr .= ' ' . $val;
        }
        $gStatus = $gLocale->getStr('removeunmetdeps_status') . $unmetDepsStr;
    } else {
        $gStatus = $gLocale->getStr('moduninstalled_status');
    }
}
 protected function undeployApplication(PackageInterface $package)
 {
     // Add vendor autoloads to access Innomatic Legacy Kernel bridge
     $vendorDir = $this->composer->getConfig()->get('vendor-dir');
     require $vendorDir . '/autoload.php';
     $appName = $package->getName();
     $appName = substr($appName, strpos($appName, '/') + 1);
     $legacyKernel = new Kernel();
     $result = $legacyKernel->runCallback(function () use($appName) {
         $appId = \Innomatic\Application\Application::getAppIdFromName($appName);
         $app = new \Innomatic\Application\Application(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $appId);
         return $app->uninstall();
         /*
          * Due to different handling of dependencies uninstall order
          * in Composer, we ignore applications that cannot be
          * uninstalled.
          */
     });
     if (!$result) {
         $this->io->write("<error>Application {$appName} must be manually uninstalled from Innomatic due to reversed dependencies</error>");
     }
 }
 public function executeDisableoption($eventData)
 {
     $application = new \Innomatic\Application\Application(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $eventData['applicationid']);
     $application->disableOption($eventData['option'], $eventData['domainid']);
     $this->status = $this->localeCatalog->getStr('option_disabled.status');
     $this->setChanged();
     $this->notifyObservers('status');
 }
Esempio n. 4
0
 public static function initializeComponents($eventData = '', $log = '')
 {
     $result = false;
     $container = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer');
     if (isset($eventData['dbname']) and strlen($eventData['dbname'])) {
         $args = $eventData;
     } else {
         $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()) {
         // Components initialization
         //
         $innomaticmod = new \Innomatic\Application\Application($tmpdb);
         if ($innomaticmod->setup($container->getHome() . 'core/temp/innomatic/')) {
             $modreg = new \Innomatic\Application\ApplicationComponentRegister($tmpdb);
             $modreg->registerComponent('innomatic', 'configurationfile', 'innomatic.ini', '', \Innomatic\Application\ApplicationComponent::OVERRIDE_NONE);
             $modreg->registerComponent('innomatic', 'configurationfile', 'dataaccessdrivers.ini', '', \Innomatic\Application\ApplicationComponent::OVERRIDE_NONE);
             $result = true;
             @touch($container->getHome() . 'core/temp/setup_componentsinitialized', time());
             if (file_exists($container->getHome() . 'core/temp/setup_initializingcomponents')) {
                 @unlink($container->getHome() . 'core/temp/setup_initializingcomponents');
             }
         } else {
             $log->logevent('innomatic.root.main_php', 'Unable to setup Innomatic during initialization', \Innomatic\Logging\Logger::ERROR);
         }
     } else {
         $log->logevent('innomatic.root.main_php', 'Unable to connect to root database during initialization', \Innomatic\Logging\Logger::ERROR);
     }
     return $result;
 }
 /**
  * Bootstraps the Innomatic container.
  *
  * @param string $home Complete path of the directory containing the
  * Innomatic webapp.
  * @param string $configuration Complete path of the Innomatic
  * configuration file.
  */
 public function bootstrap($home, $configuration)
 {
     if ($this->bootstrapped) {
         return;
     }
     $this->home = $home;
     // Reads the configuration
     $this->configurationFile = $configuration;
     $this->config = new InnomaticSettings($configuration);
     // *********************************************************************
     // PHP environment
     // *********************************************************************
     // PHP
     $timelimit = $this->config->value('PHPExecutionTimeLimit');
     if (!strlen($timelimit)) {
         $timelimit = 0;
     }
     set_time_limit($timelimit);
     ignore_user_abort(true);
     // Adds global override classes folder to the include path.
     set_include_path($this->home . 'core/overrides/classes/' . PATH_SEPARATOR . get_include_path());
     // *********************************************************************
     // Innomatic state, environment, mode, interface and edition
     // *********************************************************************
     // Waits until system is in upgrade phase
     if ($this->lockOverride == false) {
         while (file_exists($this->home . 'core/temp/upgrading_system_lock')) {
             $this->state = \Innomatic\Core\InnomaticContainer::STATE_UPGRADE;
             clearstatcache();
             sleep(1);
         }
     }
     // Checks if system is in setup phase and sets the state
     if (file_exists($this->home . 'core/temp/setup_lock')) {
         $this->state = \Innomatic\Core\InnomaticContainer::STATE_SETUP;
         if (extension_loaded('APD')) {
             apd_set_session_trace(35);
         }
     } else {
         switch ($this->config->value('PlatformState')) {
             case 'debug':
                 $this->state = \Innomatic\Core\InnomaticContainer::STATE_DEBUG;
                 if (extension_loaded('APD')) {
                     apd_set_session_trace(35);
                 }
                 break;
             case 'production':
                 $this->state = \Innomatic\Core\InnomaticContainer::STATE_PRODUCTION;
                 break;
             default:
                 $this->state = \Innomatic\Core\InnomaticContainer::STATE_PRODUCTION;
         }
     }
     // Environment
     switch ($this->config->value('PlatformEnvironment')) {
         case 'development':
             $this->environment = \Innomatic\Core\InnomaticContainer::ENVIRONMENT_DEVELOPMENT;
             break;
         case 'integration':
             $this->environment = \Innomatic\Core\InnomaticContainer::ENVIRONMENT_INTEGRATION;
             break;
         case 'staging':
             $this->environment = \Innomatic\Core\InnomaticContainer::ENVIRONMENT_STAGING;
             break;
         case 'production':
             $this->environment = \Innomatic\Core\InnomaticContainer::ENVIRONMENT_PRODUCTION;
             break;
         default:
             $this->environment = \Innomatic\Core\InnomaticContainer::ENVIRONMENT_PRODUCTION;
     }
     // Interface
     //$this->interface = \Innomatic\Core\InnomaticContainer::INTERFACE_UNKNOWN;
     // Mode
     //$this->mode = \Innomatic\Core\InnomaticContainer::MODE_ROOT;
     // Edition
     if ($this->config->value('PlatformEdition') == 'enterprise' or $this->config->value('PlatformEdition') == 'singletenant') {
         $this->edition = \Innomatic\Core\InnomaticContainer::EDITION_SINGLETENANT;
     }
     // *********************************************************************
     // Pid and shutdown function
     // *********************************************************************
     if ($this->state != \Innomatic\Core\InnomaticContainer::STATE_SETUP) {
         $this->pid = md5(microtime());
         if (!file_exists($this->home . 'core/temp/pids/')) {
             @mkdir($this->home . 'core/temp/pids/');
         }
         touch($this->home . 'core/temp/pids/' . $this->pid, time());
         register_shutdown_function(array($this, 'shutdown'));
     }
     // *********************************************************************
     // Innomatic platform name
     // *********************************************************************
     $this->platformName = $this->config->value('PlatformName');
     $this->platformGroup = $this->config->value('PlatformGroup');
     // *********************************************************************
     // Innomatic error handler
     // *********************************************************************
     //set_error_handler(array($this, 'errorHandler'));
     // *********************************************************************
     // Innomatic root
     // *********************************************************************
     $this->country = $this->config->value('RootCountry');
     $this->language = $this->config->value('RootLanguage');
     if ($this->state != \Innomatic\Core\InnomaticContainer::STATE_SETUP) {
         // Innomatic central database
         //
         $dasnString = $this->config->value('RootDatabaseType') . '://' . $this->config->value('RootDatabaseUser') . ':' . $this->config->value('RootDatabasePassword') . '@' . $this->config->value('RootDatabaseHost') . ':' . $this->config->value('RootDatabasePort') . '/' . $this->config->value('RootDatabaseName') . '?' . 'logfile=' . $this->getHome() . 'core/log/innomatic_root_db.log';
         $this->rootDb = \Innomatic\Dataaccess\DataAccessFactory::getDataAccess(new \Innomatic\Dataaccess\DataAccessSourceName($dasnString));
         if (!$this->rootDb->connect()) {
             $this->abort('Database not connected');
         }
     }
     // *********************************************************************
     // Run time state and interface defined data
     // *********************************************************************
     // Debugger
     if ($this->state == \Innomatic\Core\InnomaticContainer::STATE_DEBUG) {
         $this->loadTimer = new \Innomatic\Debug\LoadTime(LoadTime::LOADTIME_MODE_CONTINUOUS);
         $this->loadTimer->Mark('start');
         $this->dbLoadTimer = new \Innomatic\Debug\LoadTime(LoadTime::LOADTIME_MODE_STARTSTOP);
     }
     // Security
     $securityReportsInterval = $this->config->value('SecurityReportsInterval');
     if ($securityReportsInterval > 0) {
         $lastSecurityReport = $this->config->value('SecurityLastReportTime');
         if (!$lastSecurityReport or $lastSecurityReport < time() - $securityReportsInterval * 3600 * 24) {
             $innomaticSecurity = new \Innomatic\Security\SecurityManager();
             $innomaticSecurity->sendReport();
             unset($innomaticSecurity);
         }
     }
     unset($securityReportsInterval);
     // Maintenance
     $maintenanceHandler = new \Innomatic\Maintenance\MaintenanceHandler();
     $maintenanceInterval = $maintenanceHandler->getMaintenanceInterval();
     if ($this->state != \Innomatic\Core\InnomaticContainer::STATE_MAINTENANCE and $maintenanceInterval > 0) {
         $lastMaintenance = $maintenanceHandler->getLastMaintenanceTime();
         if (!$lastMaintenance or $lastMaintenance < time() - $maintenanceInterval * 3600 * 24) {
             $innomaticMaintenance = new \Innomatic\Maintenance\MaintenanceHandler();
             $innomaticMaintenance->doMaintenance();
             $innomaticMaintenance->sendReport();
             unset($innomaticMaintenance);
         }
     }
     unset($maintenanceInterval);
     // *********************************************************************
     // Auto exec routines
     // *********************************************************************
     // Application reupdate check
     if (file_exists($this->home . 'core/temp/appinst/reupdate')) {
         $tmpmod = new \Innomatic\Application\Application($this->rootDb, '');
         $tmpmod->install($this->home . 'core/temp/appinst/reupdate');
         clearstatcache();
         if (file_exists($this->home . 'core/temp/appinst/reupdate')) {
             unlink($this->home . 'core/temp/appinst/reupdate');
         }
     }
     // Startup hook
     if ($this->state != \Innomatic\Core\InnomaticContainer::STATE_SETUP) {
         $hook = new \Innomatic\Process\Hook($this->rootDb, 'innomatic', 'instance');
         $null = '';
         switch ($hook->callHooks('startup', $null, '')) {
             case \Innomatic\Process\Hook::RESULT_ABORT:
                 $this->abort('Bootstrap aborted');
                 break;
         }
     }
     // Bootstrap end
     $this->bootstrapped = true;
 }
 /**
  * Retrieves an application archive from the AppCentral server and installs it.
  *
  * @param int $repId Repository id
  * @param int $applicationId Application id.
  * @param string $applicationVersion Required application version.
  * @access public
  * @return void
  */
 public function retrieveApplication($repId, $applicationId, $applicationVersion = '')
 {
     $xmlrpcMessage = new \Innomatic\Webservices\Xmlrpc\XmlRpcMsg('appcentral-server.retrieve_application', array(new \Innomatic\Webservices\Xmlrpc\XmlRpcVal($repId, 'int'), new \Innomatic\Webservices\Xmlrpc\XmlRpcVal($applicationId, 'int'), new \Innomatic\Webservices\Xmlrpc\XmlRpcVal($applicationVersion, 'string')));
     $xmlrpcResp = $this->client->send($xmlrpcMessage);
     if ($xmlrpcResp) {
         if (!$xmlrpcResp->faultCode()) {
             $xv = $xmlrpcResp->value();
             $tmpFilename = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getHome() . 'core/temp/appcentral-client/' . md5(uniqid(rand())) . '.tgz';
             $fh = fopen($tmpFilename, 'wb');
             if ($fh) {
                 fputs($fh, $xv->scalarVal());
                 fclose($fh);
                 unset($xv);
                 unset($xmlrpcResp);
                 // Install the application.
                 $tmpApplication = new \Innomatic\Application\Application($this->dataAccess, '');
                 if ($tmpApplication->install($tmpFilename)) {
                     return true;
                 }
             }
         } else {
             $this->log->logEvent(['root' => ''], 'innomatic.appcentralremoteserver.retrieveapplication', 'Error in response from server: ' . $xmlrpcResp->faultString(), \Innomatic\Logging\Logger::ERROR);
         }
     } else {
         $this->log->logEvent(['root' => ''], 'innomatic.appcentralremoteserver.retrieveapplication', 'Invalid response from server', \Innomatic\Logging\Logger::ERROR);
     }
     return false;
 }
Esempio n. 7
0
     print '    update                          Updates the AppCentral applications list' . "\n";
     $script->cleanExit();
     break;
 case 'deploy':
     $app = new \Innomatic\Application\Application(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess());
     if ((is_dir($argv[2]) or file_exists($argv[2])) and $app->install($argv[2])) {
         print "Application {$app->appname} deployed\n";
         $script->cleanExit();
     } else {
         print "Application not deployed\n";
         $script->cleanExit(1);
     }
     break;
 case 'undeploy':
     $appid = \Innomatic\Application\Application::getAppIdFromName($argv[2]);
     $app = new \Innomatic\Application\Application(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $appid);
     if ($app->uninstall()) {
         print "Application {$argv['2']} undeployed\n";
         $script->cleanExit();
     } else {
         print "Application {$argv['2']} not undeployed\n";
         $script->cleanExit(1);
     }
     break;
 case 'update':
     $appCentral = new \Innomatic\Application\AppCentralHelper();
     $appCentral->updateApplicationsList(function ($serverId, $serverName, $repoId, $repoData) {
         print 'Server ' . $serverName . ' - Repository ' . $repoData['name'] . '... ';
     }, function ($result) {
         print 'done' . PHP_EOL;
     });
Esempio n. 8
0
 public function disableAllApplications($innomaticToo = true)
 {
     $result = false;
     if ($this->rootda) {
         // Checks the enabled applications
         //
         $modsquery = $this->rootda->execute('SELECT id FROM applications_enabled,applications WHERE applications_enabled.domainid=' . (int) $this->domainserial . ' AND applications_enabled.applicationid=applications.id');
         $applications = array();
         while (!$modsquery->eof) {
             $applications[$modsquery->getFields('id')] = $modsquery->getFields('id');
             $modsquery->moveNext();
         }
         $numapplications = $modsquery->getNumberRows();
         $innomaticquery = $this->rootda->execute('SELECT id FROM applications WHERE appid=' . $this->rootda->formatText('innomatic'));
         if (!$innomaticToo) {
             unset($applications[$innomaticquery->getFields('id')]);
             $numapplications--;
         }
         // Tries to disable every application since all applications are disabled, following dependencies
         //
         while (count($applications) > 0) {
             $appid = current($applications);
             if (count($applications) == 1 and $appid == $innomaticquery->getFields('id') or count($applications) > 1 and $appid != $innomaticquery->getFields('id') or !$innomaticToo) {
                 $tmpmod = new \Innomatic\Application\Application($this->rootda, $appid);
                 if ($tmpmod->Disable($this->domainserial)) {
                     $log = $this->container->getLogger();
                     $log->logEvent($this->domainid, 'Disabled application ' . $tmpmod->appname, \Innomatic\Logging\Logger::NOTICE);
                     $this->domainlog->logEvent($this->domainid, 'Disabled application ' . $tmpmod->appname, \Innomatic\Logging\Logger::NOTICE);
                     unset($applications[$appid]);
                 }
             }
             if (!next($applications)) {
                 reset($applications);
             }
         }
         $result = true;
     }
     return $result;
 }
    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');
    }