root/trunk/gui/admin/ispcp_updates.php

Revision 1359, 3.0 kB (checked in by scitech, 2 months ago)

Fixed #1544: Add SQL user has only one option -> useless. Fixed #1545: HTML bug with hint for updates. Fixed #1546: Tiny english typo

Line 
1 <?php
2 /**
3  * ispCP ω (OMEGA) a Virtual Hosting Control System
4  *
5  * @copyright     2001-2006 by moleSoftware GmbH
6  * @copyright     2006-2008 by ispCP | http://isp-control.net
7  * @version     SVN: $Id$
8  * @link         http://isp-control.net
9  * @author         ispCP Team
10  *
11  * @license
12  *   This program is free software; you can redistribute it and/or modify it under
13  *   the terms of the MPL General Public License as published by the Free Software
14  *   Foundation; either version 1.1 of the License, or (at your option) any later
15  *   version.
16  *   You should have received a copy of the MPL Mozilla Public License along with
17  *   this program; if not, write to the Open Source Initiative (OSI)
18  *   http://opensource.org | osi@opensource.org
19  */
20
21 require '../include/ispcp-lib.php';
22
23 check_login(__FILE__);
24
25 $theme_color = Config::get('USER_INITIAL_THEME');
26
27 $tpl = new pTemplate();
28 $tpl->define_dynamic('page', Config::get('ADMIN_TEMPLATE_PATH') . '/ispcp_updates.tpl');
29 $tpl->define_dynamic('page_message', 'page');
30 $tpl->define_dynamic('hosting_plans', 'page');
31 $tpl->define_dynamic('update_message', 'page');
32 $tpl->define_dynamic('update_infos', 'page');
33
34 $tpl->assign(
35     array(
36         'TR_ADMIN_ISPCP_UPDATES_PAGE_TITLE' => tr('ispCP - Virtual Hosting Control System'),
37         'THEME_COLOR_PATH' => "../themes/$theme_color",
38         'THEME_CHARSET' => tr('encoding'),
39         'ISP_LOGO' => get_logo($_SESSION['user_id'])
40         )
41     );
42
43 /* BEGIN common functions */
44 function get_update_infos(&$tpl) {
45
46     if (!Config::get('CHECK_FOR_UPDATES')) {
47         $tpl->assign(
48                 array(
49                     'UPDATE_MESSAGE'    => '',
50                     'UPDATE'        => tr('Update checking is disabled!'),
51                     'INFOS'         => tr('Enable update at') . " <a href=\"settings.php\">" . tr('Settings') . "</a>"
52                     )
53                 );
54         $tpl->parse('UPDATE_INFOS', 'update_infos');
55         return false;
56     }
57
58     if (versionUpdate::getInstance()->checkUpdateExists()) {
59         $tpl->assign(
60             array(
61                 'UPDATE_MESSAGE' => '',
62                 'UPDATE' => tr('New ispCP update is now available'),
63                 'INFOS' => tr('Get it at') . " <a href=\"http://www.isp-control.net/download.html\" class=\"link\" target=\"ispcp\">http://www.isp-control.net/download.html</a>"
64                 )
65             );
66
67         $tpl->parse('UPDATE_INFOS', 'update_infos');
68     } else {
69         if( versionUpdate::getInstance()->getErrorMessage() != "" ) {
70             $tpl->assign(array('TR_MESSAGE' => versionUpdate::getInstance()->getErrorMessage()));
71         }
72         $tpl->assign('UPDATE_INFOS', '');
73     }
74 }
75 /* END system functions */
76
77 /*
78  *
79  * static page messages.
80  *
81  */
82 gen_admin_mainmenu($tpl, Config::get('ADMIN_TEMPLATE_PATH') . '/main_menu_system_tools.tpl');
83 gen_admin_menu($tpl, Config::get('ADMIN_TEMPLATE_PATH') . '/menu_system_tools.tpl');
84
85 $tpl->assign(
86     array(
87         'TR_UPDATES_TITLE' => tr('ispCP updates'),
88         'TR_AVAILABLE_UPDATES' => tr('Available ispCP updates'),
89         'TR_MESSAGE' => tr('No new ispCP updates available'),
90         'TR_UPDATE' => tr('Update'),
91         'TR_INFOS' => tr('Update details')
92         )
93     );
94
95 gen_page_message($tpl);
96
97 get_update_infos($tpl);
98
99 $tpl->parse('PAGE', 'page');
100 $tpl->prnt();
101
102 if (Config::get('DUMP_GUI_DEBUG')) dump_gui_debug();
103
104 unset_messages();
105
106 ?>
Note: See TracBrowser for help on using the browser.