예제 #1
0
 function _add_update_alert(&$app)
 {
     import('events/administrator_alert_service');
     $identifier = $app->get_identifier();
     if (AdministratorAlertService::find_by_identifier($identifier, 'updates', 'kernel') === null) {
         $alert = new AdministratorAlert();
         global $LANG, $CONFIG;
         require_once PATH_TO_ROOT . '/lang/' . get_ulang() . '/admin.php';
         if ($app->get_type() == APPLICATION_TYPE__KERNEL) {
             $alert->set_entitled(sprintf($LANG['kernel_update_available'], $app->get_version()));
         } else {
             $alert->set_entitled(sprintf($LANG['update_available'], $app->get_type(), $app->get_name(), $app->get_version()));
         }
         $alert->set_fixing_url('admin/updates/detail.php?identifier=' . $identifier);
         $alert->set_priority($app->get_priority());
         $alert->set_properties(serialize($app));
         $alert->set_type('updates');
         $alert->set_identifier($identifier);
         AdministratorAlertService::save_alert($alert);
     }
 }
예제 #2
0
 /**
  * @desc Save an alert for Update Notification
  */
 private function add_update_alert($app)
 {
     $identifier = $app->get_identifier();
     // We verify that the alert is not already registered
     if (AdministratorAlertService::find_by_identifier($identifier, 'updates', 'kernel') === null) {
         $alert = new AdministratorAlert();
         require_once PATH_TO_ROOT . '/lang/' . AppContext::get_current_user()->get_locale() . '/admin.php';
         if ($app->get_type() == Application::KERNEL_TYPE) {
             $alert->set_entitled(sprintf(LangLoader::get_message('kernel_update_available', 'admin'), $app->get_version()));
         } else {
             $alert->set_entitled(sprintf(LangLoader::get_message('update_available', 'admin'), $app->get_type(), $app->get_name(), $app->get_version()));
         }
         $alert->set_fixing_url('admin/updates/detail.php?identifier=' . $identifier);
         $alert->set_priority($app->get_priority());
         $alert->set_properties(serialize($app));
         $alert->set_type('updates');
         $alert->set_identifier($identifier);
         //Save
         AdministratorAlertService::save_alert($alert);
     }
 }
예제 #3
0
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ###################################################*/
define('PATH_TO_ROOT', '../..');
require_once PATH_TO_ROOT . '/admin/admin_begin.php';
define('TITLE', $LANG['administration']);
require_once PATH_TO_ROOT . '/admin/admin_header.php';
$identifier = retrieve(GET, 'identifier', '');
$tpl = new FileTemplate('admin/updates/detail.tpl');
$tpl->put_all(array('L_WEBSITE_UPDATES' => $LANG['website_updates'], 'L_KERNEL' => $LANG['kernel'], 'L_MODULES' => $LANG['modules'], 'L_THEMES' => $LANG['themes']));
$app = null;
if (($update = AdministratorAlertService::find_by_identifier($identifier, 'updates')) !== null) {
    $app = unserialize($update->get_properties());
}
if ($app !== null && $app->check_compatibility()) {
    $authors = $app->get_authors();
    $new_features = $app->get_new_features();
    $improvments = $app->get_improvments();
    $bug_corrections = $app->get_bug_corrections();
    $security_improvments = $app->get_security_improvments();
    $nb_authors = count($authors);
    $has_new_feature = count($new_features) > 0 ? true : false;
    $has_improvments = count($improvments) > 0 ? true : false;
    $has_bug_corrections = count($bug_corrections) > 0 ? true : false;
    $has_security_improvments = count($security_improvments) > 0 ? true : false;
    switch ($update->get_priority()) {
        case AdministratorAlert::ADMIN_ALERT_VERY_HIGH_PRIORITY: