Skip to content

Commit

Permalink
Removed some deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTrueBumba committed Jan 24, 2012
1 parent 63e6398 commit b1bdc19
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion manifest.xml
Expand Up @@ -2,7 +2,7 @@
<plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8">
<name>ELGG Update Services</name>
<author>Ray J</author>
<version>1.8.0</version>
<version>1.8.1</version>
<description>Check for plugin´s updates in ELGG community</description>
<website>http://www.elgg.org/</website>
<copyright>(C) Ray J - 2011</copyright>
Expand Down
18 changes: 7 additions & 11 deletions start.php
Expand Up @@ -22,18 +22,14 @@ function elgg_update_services_pagesetup() {
}

function elgg_update_services_get_updates() {
$installed_plugins = get_installed_plugins();

foreach ($installed_plugins as $plugin => $data) {
$installed_plugins = elgg_get_plugins('active');

if (is_plugin_enabled($plugin)) {
$manifest = load_plugin_manifest($plugin);
if (strpos(strtolower($manifest['author']),'core developers') === false) {
$plugin_hash_list[] = md5($plugin . $manifest['version'] . $manifest['author']);
}
foreach ($installed_plugins as $id => $plugin) {
if (strpos(strtolower($plugin->getManifest()->getAuthor()),'core developers') === false) {
$plugin_hash_list[] = md5($plugin->getID() . $plugin->getManifest()->getVersion() . $plugin->getManifest()->getAuthor());
}
}

$url = "http://community.elgg.org/services/api/rest/json/?method=plugins.update.check&version=" . get_version(true);

foreach ($plugin_hash_list as $plugin_hash) {
Expand All @@ -49,7 +45,7 @@ function elgg_update_services_cron($hook, $entity_type, $returnvalue, $params){
//Retrieve the next execution date
//set_plugin_setting('execution_date', time(), 'elgg_update_services'); // Uncomment this line to test the plugin

$execution_date = get_plugin_setting('execution_date', 'elgg_update_services');
$execution_date = elgg_get_plugin_setting('execution_date', 'elgg_update_services');

if ($execution_date) {
if ($execution_date <= time()) {
Expand Down Expand Up @@ -100,7 +96,7 @@ function elgg_update_services_notify_admin($message){
$mailfrom = 'noreply@' . get_site_domain($CONFIG->site_guid);
}

$mailto = get_plugin_setting("notify_mail_address");
$mailto = elgg_get_plugin_setting("notify_mail_address");

if($mailto){
elgg_send_email($mailfrom, $mailto, elgg_echo('elgg_update_services:subject'), $message);
Expand Down
11 changes: 3 additions & 8 deletions views/default/admin/administer_utilities/manageupdate.php
Expand Up @@ -4,18 +4,13 @@
if (count($update_result["result"]) > 0) {
foreach($update_result["result"] as $result) {
$plugin_detail = elgg_view('elgg_update_services/update_detail', array('elgg_update_services_update_detail' => $result));
$content .= elgg_view("page/elements/wrapper", array('body' => $plugin_detail));
$body .= $plugin_detail . '<br>';
}
}
else {
echo elgg_view('page/elements/wrapper', array(
'body' => elgg_echo('elgg_update_services:no_updates')
));
return;
$body = '<p class="mtm">' . elgg_echo('elgg_update_services:no_updates') . '</p>';
}

$body = elgg_view("page/elements/wrapper", array('body' => $content));

$body = elgg_echo('elgg_update_services:next_check') . ' ' . date('Y/m/d H:i', get_plugin_setting('execution_date', 'elgg_update_services')) . '<br><br>' . $body;
$body = elgg_echo('elgg_update_services:next_check') . ' ' . date('Y/m/d H:i', elgg_get_plugin_setting('execution_date', 'elgg_update_services')) . '<br><br>' . $body;

echo $body;

0 comments on commit b1bdc19

Please sign in to comment.