From 65158f8d0796108ef5534a91b6ee34bf55d29223 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 17 Sep 2011 11:27:12 -0400 Subject: Fixes #2990 updated the bundled plugins to use the new plugin/user settings structure --- .../views/default/plugins/logrotate/settings.php | 48 ++++++++++++++++++++++ .../views/default/settings/logrotate/edit.php | 48 ---------------------- 2 files changed, 48 insertions(+), 48 deletions(-) create mode 100644 mod/logrotate/views/default/plugins/logrotate/settings.php delete mode 100644 mod/logrotate/views/default/settings/logrotate/edit.php (limited to 'mod/logrotate/views/default') diff --git a/mod/logrotate/views/default/plugins/logrotate/settings.php b/mod/logrotate/views/default/plugins/logrotate/settings.php new file mode 100644 index 000000000..64c7bf743 --- /dev/null +++ b/mod/logrotate/views/default/plugins/logrotate/settings.php @@ -0,0 +1,48 @@ +period; +$time = $vars['entity']->time; +if (!$period) { + $period = 'monthly'; +} + +if (!$time) { + $time = 'monthly'; +} +?> +
+ + + 'params[period]', + 'options_values' => array( + 'weekly' => elgg_echo('logrotate:weekly'), + 'monthly' => elgg_echo('logrotate:monthly'), + 'yearly' => elgg_echo('logrotate:yearly'), + ), + 'value' => $period + )); + ?> + +
'); ?> + + + + 'params[time]', + 'options_values' => array( + 'weekly' => elgg_echo('logrotate:week'), + 'monthly' => elgg_echo('logrotate:month'), + 'yearly' => elgg_echo('logrotate:year'), + ), + 'value' => $time + )); + ?> +
diff --git a/mod/logrotate/views/default/settings/logrotate/edit.php b/mod/logrotate/views/default/settings/logrotate/edit.php deleted file mode 100644 index 64c7bf743..000000000 --- a/mod/logrotate/views/default/settings/logrotate/edit.php +++ /dev/null @@ -1,48 +0,0 @@ -period; -$time = $vars['entity']->time; -if (!$period) { - $period = 'monthly'; -} - -if (!$time) { - $time = 'monthly'; -} -?> -
- - - 'params[period]', - 'options_values' => array( - 'weekly' => elgg_echo('logrotate:weekly'), - 'monthly' => elgg_echo('logrotate:monthly'), - 'yearly' => elgg_echo('logrotate:yearly'), - ), - 'value' => $period - )); - ?> - -
'); ?> - - - - 'params[time]', - 'options_values' => array( - 'weekly' => elgg_echo('logrotate:week'), - 'monthly' => elgg_echo('logrotate:month'), - 'yearly' => elgg_echo('logrotate:year'), - ), - 'value' => $time - )); - ?> -
-- cgit v1.2.3 From 2fb0c67f7a90f7f6d3f6f4e628225f85452f6191 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 17 Sep 2011 11:43:08 -0400 Subject: Fixes #3824 fixed deprecation warnings for plugin settings and usersettings --- mod/logrotate/languages/en.php | 2 +- mod/logrotate/start.php | 7 +++---- .../views/default/plugins/logrotate/settings.php | 17 ++++++++--------- .../views/default/plugins/twitter_api/usersettings.php | 8 ++++---- 4 files changed, 16 insertions(+), 18 deletions(-) (limited to 'mod/logrotate/views/default') diff --git a/mod/logrotate/languages/en.php b/mod/logrotate/languages/en.php index c3cf2d8ad..27731d732 100644 --- a/mod/logrotate/languages/en.php +++ b/mod/logrotate/languages/en.php @@ -15,7 +15,7 @@ $english = array( 'logrotate:logrotated' => "Log rotated\n", 'logrotate:lognotrotated' => "Error rotating log\n", - 'logrotate:date' => 'Delete archived logs older than a', + 'logrotate:delete' => 'Delete archived logs older than a', 'logrotate:week' => 'week', 'logrotate:month' => 'month', diff --git a/mod/logrotate/start.php b/mod/logrotate/start.php index c05506d83..28f14ad14 100644 --- a/mod/logrotate/start.php +++ b/mod/logrotate/start.php @@ -9,7 +9,7 @@ elgg_register_event_handler('init', 'system', 'logrotate_init'); function logrotate_init() { $period = elgg_get_plugin_setting('period', 'logrotate'); - $time = elgg_get_plugin_setting('time', 'logrotate'); + $delete = elgg_get_plugin_setting('delete', 'logrotate'); switch ($period) { case 'weekly': case 'monthly' : @@ -22,7 +22,7 @@ function logrotate_init() { // Register cron hook for archival of logs elgg_register_plugin_hook_handler('cron', $period, 'logrotate_archive_cron'); // Register cron hook for deletion of selected archived logs - elgg_register_plugin_hook_handler('cron', $time, 'logrotate_delete_cron'); + elgg_register_plugin_hook_handler('cron', $delete, 'logrotate_delete_cron'); } /** @@ -64,7 +64,7 @@ function logrotate_delete_cron($hook, $entity_type, $returnvalue, $params) { $day = 86400; $offset = 0; - $period = elgg_get_plugin_setting('time', 'logrotate'); + $period = elgg_get_plugin_setting('delete', 'logrotate'); switch ($period) { case 'weekly': $offset = $day * 7; @@ -90,7 +90,6 @@ function logrotate_delete_cron($hook, $entity_type, $returnvalue, $params) { * * @param int $time_of_delete An offset in seconds from now to delete (useful for log deletion) */ - function log_browser_delete_log($time_of_delete) { global $CONFIG; diff --git a/mod/logrotate/views/default/plugins/logrotate/settings.php b/mod/logrotate/views/default/plugins/logrotate/settings.php index 64c7bf743..d9c4032fe 100644 --- a/mod/logrotate/views/default/plugins/logrotate/settings.php +++ b/mod/logrotate/views/default/plugins/logrotate/settings.php @@ -16,9 +16,9 @@ if (!$time) { } ?>
- - 'params[period]', 'options_values' => array( @@ -29,14 +29,13 @@ if (!$time) { 'value' => $period )); ?> - -
'); ?> - - - +
+
'params[time]', + + echo elgg_echo('logrotate:delete') . ' '; + echo elgg_view('input/dropdown', array( + 'name' => 'params[delete]', 'options_values' => array( 'weekly' => elgg_echo('logrotate:week'), 'monthly' => elgg_echo('logrotate:month'), diff --git a/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php b/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php index acb8d9af5..65d04b883 100644 --- a/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php +++ b/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php @@ -5,9 +5,9 @@ $user = elgg_get_logged_in_user_entity(); $user_guid = $user->getGUID(); -$twitter_name = get_plugin_usersetting('twitter_name', $user_guid, 'twitter_api'); -$access_key = get_plugin_usersetting('access_key', $user_guid, 'twitter_api'); -$access_secret = get_plugin_usersetting('access_secret', $user_guid, 'twitter_api'); +$twitter_name = elgg_get_plugin_user_setting('twitter_name', $user_guid, 'twitter_api'); +$access_key = elgg_get_plugin_user_setting('access_key', $user_guid, 'twitter_api'); +$access_secret = elgg_get_plugin_user_setting('access_secret', $user_guid, 'twitter_api'); $site_name = elgg_get_site_entity()->name; echo '
' . elgg_echo('twitter_api:usersettings:description', array($site_name)) . '
'; @@ -21,7 +21,7 @@ if (!$access_key || !$access_secret) { // let them disassociate their account. if ($user->email) { $url = elgg_get_site_url() . "twitter_api/revoke"; - echo ''; + echo '
' . elgg_echo('twitter_api:usersettings:authorized', array($site_name, $twitter_name)) . '
'; echo '
' . sprintf(elgg_echo('twitter_api:usersettings:revoke'), $url) . '
'; } else { echo elgg_echo('twitter_api:usersettings:cannot_revoke', array(elgg_normalize_url('twitter_api/interstitial'))); -- cgit v1.2.3