diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-29 14:27:24 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-29 14:27:24 +0000 |
commit | c942e6441b0b69ba3793f9668c1ae8bf8393cba5 (patch) | |
tree | 510295d1f2baec0b37eb2a07520c2230dd94b538 /mod/updateclient | |
parent | ba1ceb336c2ec35816342c38017e8f3700308155 (diff) | |
download | elgg-c942e6441b0b69ba3793f9668c1ae8bf8393cba5.tar.gz elgg-c942e6441b0b69ba3793f9668c1ae8bf8393cba5.tar.bz2 |
Update client gets updates
git-svn-id: https://code.elgg.org/elgg/trunk@1569 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/updateclient')
-rw-r--r-- | mod/updateclient/languages/en.php | 2 | ||||
-rw-r--r-- | mod/updateclient/start.php | 22 | ||||
-rw-r--r-- | mod/updateclient/views/default/settings/updateclient/edit.php | 4 |
3 files changed, 17 insertions, 11 deletions
diff --git a/mod/updateclient/languages/en.php b/mod/updateclient/languages/en.php index 734e5400e..3142aa863 100644 --- a/mod/updateclient/languages/en.php +++ b/mod/updateclient/languages/en.php @@ -21,7 +21,7 @@ 'updateclient:settings:server' => 'Update server', 'updateclient:message:title' => 'New version of Elgg released!', - 'updateclient:message:body' => 'A new version of Elgg (%s %s) codenamed %s has been released! + 'updateclient:message:body' => 'A new version of Elgg (%s %s) codenamed "%s" has been released! Go here to download: %s diff --git a/mod/updateclient/start.php b/mod/updateclient/start.php index 8e5a5a4f7..25f7ffe98 100644 --- a/mod/updateclient/start.php +++ b/mod/updateclient/start.php @@ -9,11 +9,16 @@ * @link http://elgg.com/ */ + $DEFAULT_UPDATE_SERVER; + /** * Client update initialisation. */ function updateclient_init() { + global $DEFAULT_UPDATE_SERVER; + + $DEFAULT_UPDATE_SERVER = 'http://updates.elgg.org/services/api/rest.php'; // Register a page handler, so we can have nice URLs register_page_handler('updateclient','updateclient_page_handler'); @@ -68,7 +73,7 @@ */ function updateclient_notify_message($subject, $message) { - notify_user(2,1,$subject,$message); + return send_admin_message($subject, $message); } /** @@ -78,17 +83,18 @@ */ function updateclient_check_core() { - global $CONFIG; + global $CONFIG, $DEFAULT_UPDATE_SERVER; // Phone home and check core $url = get_plugin_setting('updateserver', 'updateclient'); + if (!$url) $url = $DEFAULT_UPDATE_SERVER; $result = send_api_get_call($url, array('method' => 'elgg.system.getlatestversion'), array()); if (($result) && ($result->status == 0)) { $result = $result->result; - + include_once($CONFIG->url . "version.php"); if ( @@ -100,11 +106,11 @@ updateclient_notify_message( elgg_echo('updateclient:message:title'), sprintf(elgg_echo('updateclient:message:body'), - $release['release'], - $release['version'], - $release['codename'], - $release['url'], - $release['notes'] + $result['release'], + $result['version'], + $result['codename'], + $result['url'], + $result['notes'] ) ); diff --git a/mod/updateclient/views/default/settings/updateclient/edit.php b/mod/updateclient/views/default/settings/updateclient/edit.php index 3cd64b448..584311c5a 100644 --- a/mod/updateclient/views/default/settings/updateclient/edit.php +++ b/mod/updateclient/views/default/settings/updateclient/edit.php @@ -9,13 +9,13 @@ * @link http://elgg.com/ */ - + global $DEFAULT_UPDATE_SERVER; ?> <p> <h3><?php echo elgg_echo('updateclient:settings:server'); ?>: </h3> <?php - $server = ($vars['entity']->updateserver ? $vars['entity']->updateserver : 'http://updates.elgg.org/services/api/rest.php'); + $server = ($vars['entity']->updateserver ? $vars['entity']->updateserver : $DEFAULT_UPDATE_SERVER); echo elgg_view('input/text', array('internalname' => 'params[updateserver]', 'value' => $server)); ?> </p> |