aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/updateclient/languages/en.php2
-rw-r--r--mod/updateclient/start.php22
-rw-r--r--mod/updateclient/views/default/settings/updateclient/edit.php4
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>