Beispiel #1
0
 public static function execute(ApplicationAbstract $application)
 {
     if (!isset($_GET['v']) || !CoreUpdate::packageExists($_GET['v'])) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_select_version_to_view'), 'error');
         OSCOM::redirect(OSCOM::getLink());
     }
     if (CoreUpdate::localPackageExists() && CoreUpdate::getPackageInfo('version_to') != $_GET['v']) {
         CoreUpdate::deletePackage();
     }
     if (!CoreUpdate::localPackageExists() && !CoreUpdate::downloadPackage($_GET['v'])) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_local_update_package_does_not_exist'), 'error');
         OSCOM::redirect(OSCOM::getLink());
     }
     $application->setPageContent('package_contents.php');
     $application->setPageTitle(sprintf(OSCOM::getDef('action_heading_apply'), CoreUpdate::getPackageInfo('version_from'), CoreUpdate::getPackageInfo('version_to')));
 }
 public static function execute(ApplicationAbstract $application)
 {
     if (!CoreUpdate::localPackageExists() || CoreUpdate::getPackageInfo('version_from') != OSCOM::getVersion()) {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_wrong_version_to_update_from'), 'error');
         OSCOM::redirect(OSCOM::getLink());
     }
     if (CoreUpdate::canApplyPackage()) {
         if (CoreUpdate::applyPackage()) {
             CoreUpdate::deletePackage();
             // Refresh access list for new/deleted Applications
             $_SESSION[OSCOM::getSite()]['access'] = Access::getUserLevels($_SESSION[OSCOM::getSite()]['id']);
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
         } else {
             Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
         }
     } else {
         Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_check_target_permissions'), 'error');
         OSCOM::redirect(OSCOM::getLink(null, null, 'Apply&v=' . $_GET['v']));
     }
     OSCOM::redirect(OSCOM::getLink());
 }
?>
</h1>

<?php 
if ($OSCOM_MessageStack->exists()) {
    echo $OSCOM_MessageStack->get();
}
?>

<form id="liveSearchForm">
  <?php 
echo HTML::inputField('search', null, 'id="liveSearchField" class="searchField" placeholder="' . OSCOM::getDef('placeholder_search') . '"') . HTML::button(array('type' => 'button', 'params' => 'onclick="osC_DataTable.reset();"', 'title' => OSCOM::getDef('button_reset')));
?>

  <span style="float: right;"><?php 
echo HTML::button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'triangle-1-w', 'title' => OSCOM::getDef('button_back'))) . (CoreUpdate::getPackageInfo('version_from') == OSCOM::getVersion() ? ' ' . HTML::button(array('href' => OSCOM::getLink(null, null, 'Apply&Process&v=' . $_GET['v']), 'icon' => 'disk', 'title' => OSCOM::getDef('button_apply_update'))) : '');
?>
</span>
</form>

<div style="padding: 20px 5px 5px 5px; height: 16px;">
  <span id="batchTotalPages"></span>
  <span id="batchPageLinks"></span>
</div>

<table border="0" width="100%" cellspacing="0" cellpadding="2" class="dataTable" id="coreUpdateDataTable">
  <thead>
    <tr>
      <th><?php 
echo OSCOM::getDef('table_heading_files');
?>