aboutsummaryrefslogtreecommitdiff
path: root/mod/logrotate
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
committerSem <sembrestels@riseup.net>2011-11-18 07:32:27 +0100
commite53d410129701ea1c9d19529afa493f11b5f5b70 (patch)
treed9963b24bf8932654b4a47e36602c75975e50dba /mod/logrotate
parent377da25d2965c64941f83baae119fc970ec60982 (diff)
parent08a962c98e2923724f8013d6eaae89101243752a (diff)
downloadelgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz
elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2
Merge github.com:Elgg/Elgg
Conflicts: engine/lib/input.php
Diffstat (limited to 'mod/logrotate')
-rw-r--r--mod/logrotate/languages/en.php2
-rw-r--r--mod/logrotate/manifest.xml7
-rw-r--r--mod/logrotate/start.php7
-rw-r--r--mod/logrotate/views/default/plugins/logrotate/settings.php (renamed from mod/logrotate/views/default/settings/logrotate/edit.php)27
4 files changed, 20 insertions, 23 deletions
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/manifest.xml b/mod/logrotate/manifest.xml
index ab6250ac0..1aa62e2e7 100644
--- a/mod/logrotate/manifest.xml
+++ b/mod/logrotate/manifest.xml
@@ -8,11 +8,10 @@
<description>Rotate the system log at specific intervals</description>
<website>http://www.elgg.org/</website>
<copyright>See COPYRIGHT.txt</copyright>
- <license>GNU Public License version 2</license>
+ <license>GNU General Public License version 2</license>
<requires>
- <type>elgg_version</type>
- <version>2009030702</version>
+ <type>elgg_release</type>
+ <version>1.8</version>
</requires>
<activate_on_install>true</activate_on_install>
- <admin_interface>advanced</admin_interface>
</plugin_manifest>
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/settings/logrotate/edit.php b/mod/logrotate/views/default/plugins/logrotate/settings.php
index 64c7bf743..bef8b308d 100644
--- a/mod/logrotate/views/default/settings/logrotate/edit.php
+++ b/mod/logrotate/views/default/plugins/logrotate/settings.php
@@ -6,19 +6,19 @@
*/
$period = $vars['entity']->period;
-$time = $vars['entity']->time;
+$delete = $vars['entity']->delete;
if (!$period) {
$period = 'monthly';
}
-if (!$time) {
- $time = 'monthly';
+if (!$delete) {
+ $delete = 'monthly';
}
?>
<div>
- <?php echo elgg_echo('logrotate:period'); ?>
-
<?php
+
+ echo elgg_echo('logrotate:period') . ' ';
echo elgg_view('input/dropdown', array(
'name' => 'params[period]',
'options_values' => array(
@@ -26,23 +26,22 @@ if (!$time) {
'monthly' => elgg_echo('logrotate:monthly'),
'yearly' => elgg_echo('logrotate:yearly'),
),
- 'value' => $period
+ 'value' => $period,
));
?>
-
- <?php echo elgg_echo('</div><div>'); ?>
-
- <?php echo elgg_echo('logrotate:date'); ?>
-
+</div>
+<div>
<?php
- echo elgg_view('input/pulldown', array(
- 'name' => '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'),
'yearly' => elgg_echo('logrotate:year'),
),
- 'value' => $time
+ 'value' => $delete,
));
?>
</div>