1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

Admin Log Administration ready

This commit is contained in:
secretr
2008-12-16 14:22:01 +00:00
parent 3cfdf05b4a
commit 3c5b71f736
5 changed files with 939 additions and 874 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -8,8 +8,8 @@
* e107 Admin Helper * e107 Admin Helper
* *
* $Source: /cvs_backup/e107_0.8/e107_files/jslib/core/admin.js,v $ * $Source: /cvs_backup/e107_0.8/e107_files/jslib/core/admin.js,v $
* $Revision: 1.4 $ * $Revision: 1.5 $
* $Date: 2008-12-15 17:03:25 $ * $Date: 2008-12-16 14:22:01 $
* $Author: secretr $ * $Author: secretr $
* *
*/ */
@@ -33,7 +33,8 @@ e107Admin.Helper = {
$$('.autocheck').invoke('observe', 'click', this.toggleCheckedHandler); $$('.autocheck').invoke('observe', 'click', this.toggleCheckedHandler);
$$('button.action[name=check_all]').invoke('observe', 'click', this.allCheckedEventHandler); $$('button.action[name=check_all]').invoke('observe', 'click', this.allCheckedEventHandler);
$$('button.action[name=uncheck_all]').invoke('observe', 'click', this.allUncheckedEventHandler); $$('button.action[name=uncheck_all]').invoke('observe', 'click', this.allUncheckedEventHandler);
$$('button.delete', 'input.delete[type=image]').invoke('observe', 'click', function(e) { $$('button.delete', 'input.delete[type=image]', 'a.delete').invoke('observe', 'click', function(e) {
if(e.element().hasClassName('no-confirm') || (e.element().readAttribute('rel') && e.element().readAttribute('rel').toLowerCase == 'no-confirm')) return;
var msg = e.element().readAttribute('title') || e107.getModLan('delete_confirm'); var msg = e.element().readAttribute('title') || e107.getModLan('delete_confirm');
if( !e107Helper.confirm(msg) ) e.stop(); if( !e107Helper.confirm(msg) ) e.stop();
}); });
@@ -84,53 +85,71 @@ e107Admin.Helper = {
/** /**
* Event listener * Event listener
* Check all checkboxes in the current form, having * Check all checkboxes in the current form, having name attribute value starting with 'multiaction'
* name attribute value starting with 'multiaction' * by default or any value set by button's value(special command 'jstarget:')
* This method is auto-attached to every button having name=check_all * This method is auto-attached to every button having name=check_all if init() method is executed
* if init() method is executed
* *
* Examples of valid inputbox markup: * Examples of valid inputbox markup:
* <input type='checkbox' class='checkbox' name='multiaction[]'> * <input type='checkbox' class='checkbox' name='multiaction[]'>
* OR * OR
* <input type='checkbox' class='checkbox' name='multiaction_something_else[]'> * <input type='checkbox' class='checkbox' name='multiaction_something_else[]'>
* OR
* <input type='checkbox' class='checkbox' name='some_checkbox_arary[]'> (see the button example below)
* OR
* <input type='checkbox' class='checkbox' name='some_checkbox_arary_some_more[]'> (see the button example below)
* *
* Example of button being auto-observed (see e107Admin.Helper#init) * Example of button being auto-observed (see e107Admin.Helper#init)
* <button class='action' type='button' name='check_all' value='Check All'><span>Check All</span></button> * <button class='action' type='button' name='check_all' value='Check All'><span>Check All</span></button> // default selector - multiaction
* OR
* <button class='action' type='button' name='check_all' value='jstarget:some_checkbox_arary'><span>Check All</span></button> // checkboxes names starting with - some_checkbox_arary
* *
* Demo: e107_admin/image.php * Demo: e107_admin/image.php, admin_log.php
* *
*/ */
allChecked: function(event) { allChecked: function(event) {
event.stop(); event.stop();
var form = event.element().up('form'); var form = event.element().up('form'), selector = 'multiaction';
if(event.element().readAttribute('value').startsWith('jstarget:')) {
selector = event.element().readAttribute('value').replace(/jstarget:/, '').strip();
}
if(form) { if(form) {
form.toggleChecked(true, 'name^=multiaction'); form.toggleChecked(true, 'name^=' + selector);
} }
}, },
/** /**
* Event listener * Event listener
* Uncheck all checkboxes in the current form, having * Uncheck all checkboxes in the current form, having name attribute value starting with 'multiaction'
* name attribute value starting with 'multiaction' * by default or any value set by button's value(special command 'jstarget:')
* This method is auto-attached to every button having name=uncheck_all * This method is auto-attached to every button having name=uncheck_all if init() method is executed
* if init() method is executed
* *
* Examples of valid inputbox markup: * Examples of valid inputbox markup:
* <input type='checkbox' class='checkbox' name='multiaction[]'> * <input type='checkbox' class='checkbox' name='multiaction[]'>
* OR * OR
* <input type='checkbox' class='checkbox' name='multiaction_something_else[]'> * <input type='checkbox' class='checkbox' name='multiaction_something_else[]'>
* OR
* <input type='checkbox' class='checkbox' name='some_checkbox_arary[]'> (see the button example below)
* OR
* <input type='checkbox' class='checkbox' name='some_checkbox_arary_some_more[]'> (see the button example below)
* *
* Example of button being auto-observed (see e107Admin.Helper#init) * Example of button being auto-observed (see e107Admin.Helper#init)
* <button class='action' type='button' name='uncheck_all' value='Uncheck All'><span>Uncheck All</span></button> * <button class='action' type='button' name='uncheck_all' value='Uncheck All'><span>Uncheck All</span></button> // default selector - multiaction
* OR
* <button class='action' type='button' name='uncheck_all' value='jstarget:some_checkbox_arary'><span>Uncheck All</span></button> // checkboxes names starting with - some_checkbox_arary
* *
* Demo: e107_admin/image.php * Demo: e107_admin/image.php, admin_log.php
* *
*/ */
allUnchecked: function(event) { allUnchecked: function(event) {
event.stop(); event.stop();
var form = event.element().up('form'); var form = event.element().up('form'), selector = 'multiaction';
if(event.element().readAttribute('value').startsWith('jstarget:')) {
selector = event.element().readAttribute('value').replace(/jstarget:/, '').strip();
}
if(form) { if(form) {
form.toggleChecked(false, 'name^=multiaction'); form.toggleChecked(false, 'name^=' + selector);
} }
} }
} }

View File

@@ -9,8 +9,8 @@
* Form Handler * Form Handler
* *
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $ * $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
* $Revision: 1.7 $ * $Revision: 1.8 $
* $Date: 2008-12-15 21:16:32 $ * $Date: 2008-12-16 14:22:01 $
* $Author: secretr $ * $Author: secretr $
* *
*/ */
@@ -38,16 +38,16 @@ if (!defined('e107_INIT')) { exit; }
* *
* - size => (int) size attribute value (used when needed) * - size => (int) size attribute value (used when needed)
* default: 40 * default: 40
* *
* - title (string) title attribute * - title (string) title attribute
* default: empty string (omitted) * default: empty string (omitted)
* *
* - readonly => (bool) readonly attribute * - readonly => (bool) readonly attribute
* default: false * default: false
* *
* - selected => (bool) selected attribute (used when needed) * - selected => (bool) selected attribute (used when needed)
* default: false * default: false
* *
* checked => (bool) checked attribute (used when needed) * checked => (bool) checked attribute (used when needed)
* default: false * default: false
* - disabled => (bool) disabled attribute * - disabled => (bool) disabled attribute
@@ -77,12 +77,12 @@ class e_form
return "<input type='text' name='{$name}' value='{$value}' maxlength='{$maxlength}'".$this->get_attributes($options, $name, $value)." />"; return "<input type='text' name='{$name}' value='{$value}' maxlength='{$maxlength}'".$this->get_attributes($options, $name, $value)." />";
} }
function file($name, $options = array()) function file($name, $options = array())
{ {
$options = $this->format_options('text', $name, $options); $options = $this->format_options('text', $name, $options);
return "<input type='text' name='{$name}'".$this->get_attributes($options, $name, $value)." />"; return "<input type='text' name='{$name}'".$this->get_attributes($options, $name, $value)." />";
} }
function password($name, $maxlength = 50, $options = array()) function password($name, $maxlength = 50, $options = array())
{ {
@@ -95,41 +95,41 @@ class e_form
$options = $this->format_options('textarea', $name, $options); $options = $this->format_options('textarea', $name, $options);
return "<textarea name='{$name}' rows='{$rows}' cols='{$cols}'".$this->get_attributes($options, $name, $value).">{$value}</textarea>"; return "<textarea name='{$name}' rows='{$rows}' cols='{$cols}'".$this->get_attributes($options, $name, $value).">{$value}</textarea>";
} }
function checkbox($name, $value, $checked = false, $options = array()) function checkbox($name, $value, $checked = false, $options = array())
{ {
$options['checked'] = $checked; //comes as separate argument just for convenience $options['checked'] = $checked; //comes as separate argument just for convenience
$options = $this->format_options('checkbox', $name, $options); $options = $this->format_options('checkbox', $name, $options);
return "<input type='checkbox' name='{$name}' value='{$value}'".$this->get_attributes($options, $name, $value)." />"; return "<input type='checkbox' name='{$name}' value='{$value}'".$this->get_attributes($options, $name, $value)." />";
} }
function radio($name, $value, $checked = false, $options = array()) function radio($name, $value, $checked = false, $options = array())
{ {
$options['checked'] = $checked; //comes as separate argument just for convenience $options['checked'] = $checked; //comes as separate argument just for convenience
$options = $this->format_options('radio', $name, $options); $options = $this->format_options('radio', $name, $options);
return "<input type='radio' name='{$name}' value='".$value."'".$this->get_attributes($options, $name, $value)." />"; return "<input type='radio' name='{$name}' value='".$value."'".$this->get_attributes($options, $name, $value)." />";
} }
function label($text, $name = '', $value = '') function label($text, $name = '', $value = '')
{ {
$for_id = $this->_format_id('', $name, $value, 'for'); $for_id = $this->_format_id('', $name, $value, 'for');
return "<label$for_id>{$text}</label>"; return "<label$for_id>{$text}</label>";
} }
function select_open($name, $options = array()) function select_open($name, $options = array())
{ {
$options = $this->format_options('select', $name, $options); $options = $this->format_options('select', $name, $options);
return "<select name='{$name}'".$this->get_attributes($options, $name).">"; return "<select name='{$name}'".$this->get_attributes($options, $name).">";
} }
function optgroup_open($label, $disabled) function optgroup_open($label, $disabled)
{ {
return "<optgroup class='optgroup' label='{$label}'".($disabled ? " disabled='disabled'" : '').">"; return "<optgroup class='optgroup' label='{$label}'".($disabled ? " disabled='disabled'" : '').">";
} }
function option($option_name, $value, $selected = false, $options = array()) function option($option_name, $value, $selected = false, $options = array())
{ {
if(false === $value) $value = ''; if(false === $value) $value = '';
$options['selected'] = $selected; //comes as separate argument just for convenience $options['selected'] = $selected; //comes as separate argument just for convenience
@@ -137,34 +137,34 @@ class e_form
return "<option value='{$value}'".$this->get_attributes($options).">{$option_name}</option>"; return "<option value='{$value}'".$this->get_attributes($options).">{$option_name}</option>";
} }
function optgroup_close() function optgroup_close()
{ {
return "</optgroup>"; return "</optgroup>";
} }
function select_close() function select_close()
{ {
return "</select>"; return "</select>";
} }
function hidden($name, $value, $options = array()) function hidden($name, $value, $options = array())
{ {
$options = $this->format_options('hidden', $name, $options); $options = $this->format_options('hidden', $name, $options);
return "<input type='hidden' name='{$name}' value='{$value}'".$this->get_attributes($options, $name, $value)." />"; return "<input type='hidden' name='{$name}' value='{$value}'".$this->get_attributes($options, $name, $value)." />";
} }
function submit($name, $value, $options = array()) function submit($name, $value, $options = array())
{ {
$options = $this->format_options('submit', $name, $options); $options = $this->format_options('submit', $name, $options);
return "<input class='button' type='submit' name='{$name}' value='{$value}'".$this->get_attributes($options, $name, $value)." />"; return "<input class='button' type='submit' name='{$name}' value='{$value}'".$this->get_attributes($options, $name, $value)." />";
} }
function submit_image($name, $value, $image, $options = array()) function submit_image($name, $value, $image, $options = array())
{ {
$options = $this->format_options('submit', $name, $options); $options = $this->format_options('submit', $name, $options);
return "<input class='image' type='image' src='{$image}' name='{$name}' value='{$value}'".$this->get_attributes($options, $name, $value)." />"; return "<input class='image' type='image' src='{$image}' name='{$name}' value='{$value}'".$this->get_attributes($options, $name, $value)." />";
} }
function admin_button($name, $value, $action = 'submit', $label = '', $options = array()) function admin_button($name, $value, $action = 'submit', $label = '', $options = array())
{ {
$options['class'] = $action; //additional classes in options not allowed $options['class'] = $action; //additional classes in options not allowed
@@ -172,14 +172,12 @@ class e_form
if($action == 'action') $btype = 'button'; if($action == 'action') $btype = 'button';
$options = $this->format_options('admin_button', $name, $options); $options = $this->format_options('admin_button', $name, $options);
if(empty($label)) $label = $value; if(empty($label)) $label = $value;
return " return "
<button type='{$btype}' name='{$name}' value='{$value}'".$this->get_attributes($options, $name)."> <button type='{$btype}' name='{$name}' value='{$value}'".$this->get_attributes($options, $name)."><span>{$label}</span></button>
<span>{$label}</span>
</button>
"; ";
} }
function get_attributes($options, $name = '', $value = '') function get_attributes($options, $name = '', $value = '')
{ {
$ret = ''; $ret = '';
@@ -199,7 +197,7 @@ class e_form
case 'size': case 'size':
if($optval) $ret .= " size='{$optval}'"; if($optval) $ret .= " size='{$optval}'";
break; break;
case 'title': case 'title':
if($optval) $ret .= " title='{$optval}'"; if($optval) $ret .= " title='{$optval}'";
break; break;
@@ -217,7 +215,7 @@ class e_form
case 'selected': case 'selected':
if($optval) $ret .= " selected='selected'"; if($optval) $ret .= " selected='selected'";
break; break;
case 'checked': case 'checked':
if($optval) $ret .= " checked='checked'"; if($optval) $ret .= " checked='checked'";
break; break;
@@ -249,7 +247,7 @@ class e_form
//format the name first //format the name first
$name = str_replace(array('[]', '[', ']', '_'), array('', '-', '', '-'), $name); $name = str_replace(array('[]', '[', ']', '_'), array('', '-', '', '-'), $name);
if(empty($id_value) ) return " {$return_attribute}='{$name}".($value ? "-{$value}" : '')."'";// also useful when name is e.g. name='my_name[some_id]' if(empty($id_value) ) return " {$return_attribute}='{$name}".($value ? "-{$value}" : '')."'";// also useful when name is e.g. name='my_name[some_id]'
elseif(is_numeric($id_value) && $name) return " {$return_attribute}='{$name}-{$id_value}'";// also useful when name is e.g. name='my_name[]' elseif(is_numeric($id_value) && $name) return " {$return_attribute}='{$name}-{$id_value}'";// also useful when name is e.g. name='my_name[]'
else return " {$return_attribute}='{$id_value}'"; else return " {$return_attribute}='{$id_value}'";

View File

@@ -1,7 +1,7 @@
<?php <?php
// e107 Language File. // e107 Language File.
// $Id: lan_admin_log.php,v 1.7 2008-12-06 15:48:26 e107steved Exp $ // $Id: lan_admin_log.php,v 1.8 2008-12-16 14:22:01 secretr Exp $
define('RL_LAN_001', 'System Logs'); define('RL_LAN_001', 'System Logs');
define('RL_LAN_002', "Rolling Log"); define('RL_LAN_002', "Rolling Log");
define('RL_LAN_003', 'User Audit Trail Maintenance'); define('RL_LAN_003', 'User Audit Trail Maintenance');
@@ -107,4 +107,11 @@ define('RL_LAN_119', 'Active');
define('RL_LAN_120', 'Users on-line'); define('RL_LAN_120', 'Users on-line');
define('RL_LAN_121', 'System Logs Options');
define('RL_LAN_122', 'System Logs Configuration');
define('RL_LAN_123', 'User audit trail class');
define('RL_LAN_124', 'User audit trail actions');
define('RL_LAN_125', 'System Logs Maintenance');
define('RL_LAN_126', 'Total <strong>%d</strong> entries matching search condition');
define('RL_LAN_JS_CONFIRM', 'Are you sure?');
?> ?>

View File

@@ -89,6 +89,9 @@ ul,ol { list-style:none; }
.adminlist { width:100%; border:1px solid #ddd;} .adminlist { width:100%; border:1px solid #ddd;}
.adminlist th { padding: 5px; border-bottom:1px solid #ddd; border-right: 1px solid #ddd; font-weight: bold; white-space:nowrap; } .adminlist th { padding: 5px; border-bottom:1px solid #ddd; border-right: 1px solid #ddd; font-weight: bold; white-space:nowrap; }
.adminlist td { padding: 5px; border-bottom:1px solid #ddd; border-right: 1px solid #ddd; } .adminlist td { padding: 5px; border-bottom:1px solid #ddd; border-right: 1px solid #ddd; }
.adminlist td div.field-spacer { clear: both; margin-bottom: 3px; } /* multi-fields per row separator */
.adminlist th.last, .adminlist th.last,
.adminlist td.last { border-right: 0px solid;} .adminlist td.last { border-right: 0px solid;}
.adminlist tr.last td{ border-bottom: 0px solid;} .adminlist tr.last td{ border-bottom: 0px solid;}
@@ -113,7 +116,7 @@ select, .tbox, .helpbox {
} }
option { padding-right: 10px;} option { padding-right: 10px;}
input.input-text, textarea, .tbox, .helpbox { padding:2px; } input.input-text, textarea, .tbox, .helpbox { padding:2px; }
select.tbox { min-height:17px; padding: 0px; /* to set the height for empty selects */ } select.tbox { min-height:17px; padding: 0px; /* setting the height of empty selects */ }
.select.order { width: 40px !important; } .select.order { width: 40px !important; }
.select.time-offset { width: 60px !important; } .select.time-offset { width: 60px !important; }
input.radio { margin-right: 3px; } input.radio { margin-right: 3px; }
@@ -129,6 +132,7 @@ label { cursor: pointer; }
.adminform { width:100%; border:1px solid #ddd;} .adminform { width:100%; border:1px solid #ddd;}
.adminform td { padding: 5px; text-align: left} .adminform td { padding: 5px; text-align: left}
.adminform td div.field-spacer { clear: both; margin-bottom: 3px; } /* multi-fields per row separator */
.adminform .select { width: 280px;} .adminform .select { width: 280px;}
.adminform .input-text { width: 274px;} .adminform .input-text { width: 274px;}
@@ -143,6 +147,7 @@ label { cursor: pointer; }
/* form used for content edit */ /* form used for content edit */
.adminedit { width:100%; border:1px solid #ddd;} .adminedit { width:100%; border:1px solid #ddd;}
.adminedit td { padding: 5px; text-align: left} .adminedit td { padding: 5px; text-align: left}
.adminedit td div.field-spacer { clear: both; margin-bottom: 3px; } /* multi-fields per row separator */
.adminedit .select { width: 280px; } .adminedit .select { width: 280px; }
.adminedit .input-text { width: 274px;} .adminedit .input-text { width: 274px;}
@@ -298,6 +303,7 @@ input.action.edit {}
/********** Misc */ /********** Misc */
.e-pointer { cursor: pointer; } /* Pointer Hand */ .e-pointer { cursor: pointer; } /* Pointer Hand */
.expand-container { padding: 10px; } /* Block with expandable items */ .expand-container { padding: 10px; } /* Block with expandable items */
.nextprev-bar { clear: both; padding: 5px; font-size: 14px; margin: 5px; border:1px solid #ddd; } /* Page NextPrev nabigation block */
/*******************************************************************************************************************/ /*******************************************************************************************************************/
@@ -309,7 +315,7 @@ input.action.edit {}
.admin-header-content { border: 1px solid #DDDDDD; } .admin-header-content { border: 1px solid #DDDDDD; }
.admin-page-body { padding: 20px 15px 0; } .admin-page-body { padding: 20px 15px 0; }
.admin-footer {} .admin-footer {}
legend { font-size: 16px; font-weight: bold; padding: 5px; } legend { font-size: 14px; font-weight: bold; padding: 5px; }
/******** Layout */ /******** Layout */
.main-table { width: 100%; border: 0 none; } .main-table { width: 100%; border: 0 none; }