1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

Log plugin - Code clean-up and $frm enhancements

This commit is contained in:
Tijn Kuyper
2013-02-11 16:44:35 +01:00
parent 0137a8d9a4
commit 8d2cdddf4e
2 changed files with 36 additions and 68 deletions

View File

@@ -22,7 +22,6 @@ if (!getperms('P') || !e107::isInstalled('log'))
require_once(e_ADMIN.'auth.php'); require_once(e_ADMIN.'auth.php');
require_once(e_HANDLER.'userclass_class.php'); require_once(e_HANDLER.'userclass_class.php');
$frm = e107::getForm(); $frm = e107::getForm();
$mes = e107::getMessage(); $mes = e107::getMessage();
@@ -241,16 +240,8 @@ if (isset($_POST['updatesettings']))
save_prefs(); save_prefs();
file_put_contents(e_LOG.LogFlagFile, "<?php\n\$logEnable={$pref['statActivate']};\n?>\n"); // Logging task uses to see if logging enabled file_put_contents(e_LOG.LogFlagFile, "<?php\n\$logEnable={$pref['statActivate']};\n?>\n"); // Logging task uses to see if logging enabled
$admin_log->log_event('STAT_02',ADSTAT_L82.$logStr,''); $admin_log->log_event('STAT_02',ADSTAT_L82.$logStr,'');
//$message = ADSTAT_L17;
//$mes->addSuccess(LAN_SETSAVED); // replaced by save_prefs();
} }
/*
if (isset($message))
{
$ns->tablerender('', "<div style='text-align:center'><b>".$message."</b></div>");
}
*/
$ns->tablerender($caption, $mes->render() . $text); $ns->tablerender($caption, $mes->render() . $text);
function gen_select($prompt,$name,$value) function gen_select($prompt,$name,$value)
@@ -291,32 +282,20 @@ switch ($action)
<tr> <tr>
<td>".ADSTAT_L4."</td> <td>".ADSTAT_L4."</td>
<td> <td>".$frm->radio_switch('statActivate', $pref['statActivate'])."</td>
<input type='radio' name='statActivate' value='1'".($pref['statActivate'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
<input type='radio' name='statActivate' value='0'".(!$pref['statActivate'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."
</td>
</tr> </tr>
<tr> <tr>
<td>".ADSTAT_L18."</td> <td>".ADSTAT_L18."</td>
<td>".r_userclass("statUserclass", $pref['statUserclass'],'off','public, member, admin, classes')."</td> <td>".r_userclass("statUserclass", $pref['statUserclass'],'off','public, member, admin, classes')."</td>
</tr> </tr>
<tr> <tr>
<td>".ADSTAT_L20."</td> <td>".ADSTAT_L20."</td>
<td> <td>".$frm->radio_switch('statCountAdmin', $pref['statCountAdmin'])."</td>
<input type='radio' name='statCountAdmin' value='1'".($pref['statCountAdmin'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
<input type='radio' name='statCountAdmin' value='0'".(!$pref['statCountAdmin'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."
</td>
</tr> </tr>
<tr> <tr>
<td>".ADSTAT_L21."</td> <td>".ADSTAT_L21."</td>
<td> <td><input class='tbox' type='text' name='statDisplayNumber' size='8' value='".$pref['statDisplayNumber']."' maxlength='3' /></td>
<input class='tbox' type='text' name='statDisplayNumber' size='8' value='".$pref['statDisplayNumber']."' maxlength='3' />
</td>
</tr> </tr>
<tr> <tr>
<td>".ADSTAT_L5."</td> <td>".ADSTAT_L5."</td>
<td> <td>
@@ -327,19 +306,14 @@ switch ($action)
.gen_select(ADSTAT_L10, 'statRefer',$pref['statRefer']) .gen_select(ADSTAT_L10, 'statRefer',$pref['statRefer'])
.gen_select(ADSTAT_L11, 'statQuery',$pref['statQuery']) .gen_select(ADSTAT_L11, 'statQuery',$pref['statQuery'])
.ADSTAT_L19."&nbsp;&nbsp; .ADSTAT_L19."&nbsp;&nbsp;
<input type='radio' name='statRecent' value='1'".($pref['statRecent'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp; ".$frm->radio_switch('statRecent', $pref['statRecent'])."
<input type='radio' name='statRecent' value='0'".(!$pref['statRecent'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."<br />
</td> </td>
</tr> </tr>
<tr> <tr>
<td>".ADSTAT_L78."</td> <td>".ADSTAT_L78."</td>
<td> <td>".$frm->checkbox('statPrevMonth', 1, varset($pref['statPrevMonth'],0))."<span class='field-help'>".ADSTAT_L79."</span></td>
".$frm->checkbox('statPrevMonth', 1, varset($pref['statPrevMonth'],0))."<span class='field-help'>".ADSTAT_L79."</span>
</td>
</tr> </tr>
<tr> <tr>
<td>".ADSTAT_L12."</td> <td>".ADSTAT_L12."</td>
<td> <td>
@@ -354,15 +328,9 @@ switch ($action)
".$frm->admin_button('wipeSubmit', LAN_RESET, 'delete')."<span class='field-help'>".ADSTAT_L13."</span> ".$frm->admin_button('wipeSubmit', LAN_RESET, 'delete')."<span class='field-help'>".ADSTAT_L13."</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>".ADSTAT_L26."</td> <td>".ADSTAT_L26."</td>
<td><input class='button' type='submit' name='openRemPageD' value='".ADSTAT_L28."' /><span class='field-help'>".ADSTAT_L27."</span> <td>".$frm->admin_button('openRemPageD', ADSTAT_L28, 'other')."<span class='field-help'>".ADSTAT_L27."</span> </td>
</td>
</tr>
";
$text .= "
</tr> </tr>
</table> </table>
<div class='buttons-bar center'> <div class='buttons-bar center'>

View File

@@ -10,8 +10,8 @@
* $Id$ * $Id$
*/ */
define("ADSTAT_ON", "On"); //define("ADSTAT_ON", "On");
define("ADSTAT_OFF", "Off"); //define("ADSTAT_OFF", "Off");
define("ADSTAT_L1", "This plugin will log all visits to your site, and build detailed statistic screens based on the information gathered."); define("ADSTAT_L1", "This plugin will log all visits to your site, and build detailed statistic screens based on the information gathered.");
define("ADSTAT_L2", "The statistics logger has been successfully installed. To activate, please go to the config screen and click Activate.<br /><b>You must set the permissions of the e107_plugins/log/logs folder to 777 (chmod 777)</b>"); define("ADSTAT_L2", "The statistics logger has been successfully installed. To activate, please go to the config screen and click Activate.<br /><b>You must set the permissions of the e107_plugins/log/logs folder to 777 (chmod 777)</b>");
define("ADSTAT_L3", "Statistic Logging"); define("ADSTAT_L3", "Statistic Logging");