|
From: <ir...@us...> - 2013-04-06 06:50:28
|
Revision: 11350
http://sourceforge.net/p/xoops/svn/11350
Author: irmtfan
Date: 2013-04-06 06:50:24 +0000 (Sat, 06 Apr 2013)
Log Message:
-----------
- fix: hide filename element when delete is selected in admin/file.php(2013/04/06)
- improve: show the name of action in confirm box in admin/file.php(2013/04/06)
Modified Paths:
--------------
XoopsModules/userlog/trunk/userlog/admin/addon/perm.php
XoopsModules/userlog/trunk/userlog/admin/file.php
XoopsModules/userlog/trunk/userlog/docs/changelog.txt
XoopsModules/userlog/trunk/userlog/docs/readme.txt
XoopsModules/userlog/trunk/userlog/docs/readme_devs.txt
Modified: XoopsModules/userlog/trunk/userlog/admin/addon/perm.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/admin/addon/perm.php 2013-04-06 00:06:06 UTC (rev 11349)
+++ XoopsModules/userlog/trunk/userlog/admin/addon/perm.php 2013-04-06 06:50:24 UTC (rev 11350)
@@ -21,7 +21,7 @@
* @version $Id: perm.php 1 2013-02-26 16:25:04Z irmtfan $
*/
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
-// Here you can set ADDITIONAL permission in file for webmasters in your website, ONLY if you want to limit the access to userlog module to some of them.
+// Here you can set ADDITIONAL permission in file for webmasters in your website, ONLY if you want to limit the access to userlog module for some of them.
// Webmasters that dont have access cannot:
// 1- go to the userlog > admin
Modified: XoopsModules/userlog/trunk/userlog/admin/file.php
===================================================================
--- XoopsModules/userlog/trunk/userlog/admin/file.php 2013-04-06 00:06:06 UTC (rev 11349)
+++ XoopsModules/userlog/trunk/userlog/admin/file.php 2013-04-06 06:50:24 UTC (rev 11350)
@@ -97,23 +97,23 @@
$fileEl = $loglogObj->buildFileSelectEle($file, true, 10);// multiselect = true, size=10
$form->addElement($fileEl);
$actionEl = new XoopsFormSelect(_AM_USERLOG_FILE_ACTION,"op", $opentry);
-$actionEl->addOptionArray(array("del"=>_DELETE,
- "rename"=>_AM_USERLOG_FILE_RENAME,
- "copy"=>_AM_USERLOG_FILE_COPY,
- "merge"=>_AM_USERLOG_FILE_MERGE,
- "zip" =>_AM_USERLOG_FILE_ZIP,
- "export-csv"=>_AM_USERLOG_FILE_EXPORT_CSV
- ));
-$actionEl->setExtra("onchange=\"document.forms.filemanager.filename.className = ''; if(this.value == 'del') { document.forms.filemanager.filename.className = 'hidden';}\"");
+$actions = array( "zip" =>_AM_USERLOG_FILE_ZIP,
+ "del"=>_DELETE,
+ "rename"=>_AM_USERLOG_FILE_RENAME,
+ "copy"=>_AM_USERLOG_FILE_COPY,
+ "merge"=>_AM_USERLOG_FILE_MERGE,
+ "export-csv"=>_AM_USERLOG_FILE_EXPORT_CSV
+ );
+$actionEl->addOptionArray($actions);
+$actionEl->setExtra("onchange=\"var el = document.forms.filemanager.filename.parentElement.parentElement; el.className = ''; if(this.value == 'del') { el.className = 'hidden'}\"");
$form->addElement($actionEl);
$filenameEl = new XoopsFormText(_AM_USERLOG_FILE_FILENAME, "filename", 50, 255, '');
-$filenameEl->setExtra("Class='hidden'");
$filenameEl->setDescription(_AM_USERLOG_FILE_FILENAME_DSC);
$form->addElement($filenameEl);
$submitEl = new XoopsFormButton(_SUBMIT, 'submitfilemanager', _SUBMIT, 'submit');
$form->addElement($submitEl);
$confirmEl = new XoopsFormHidden("confirm",0);
-$confirmEl->customValidationCode[]="if(confirm('" . _AM_USERLOG_FILE_CONFIRM . "' + ' action=' + myform.op.value + ' ' + myform.file.value)) {myform.confirm.value = 1;} else {return false;};";
+$confirmEl->customValidationCode[]="if(confirm('" . _AM_USERLOG_FILE_CONFIRM . " ' + myform.op.options[myform.op.selectedIndex].innerHTML + '\\n " . _AM_USERLOG_FILE . ": ' + myform.file.value)) {myform.confirm.value = 1;} else {return false;};";
$form->addElement($confirmEl);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
$GLOBALS['xoopsTpl']->assign('logo',$indexAdmin->addNavigation('file.php'));
Modified: XoopsModules/userlog/trunk/userlog/docs/changelog.txt
===================================================================
--- XoopsModules/userlog/trunk/userlog/docs/changelog.txt 2013-04-06 00:06:06 UTC (rev 11349)
+++ XoopsModules/userlog/trunk/userlog/docs/changelog.txt 2013-04-06 06:50:24 UTC (rev 11350)
@@ -1,5 +1,7 @@
Userlog
Changelog:
+- fix: hide filename element when delete is selected in admin/file.php(2013/04/06)
+- improve: show the name of action in confirm box in admin/file.php(2013/04/06)
- change version to BETA 1(2013/04/01)
- fix some parts in templates, definitions, help.html(2013/04/01)
- bug fix: item_id is int not text. add greater than and lower than for item_id in logs form(2013/04/01)
Modified: XoopsModules/userlog/trunk/userlog/docs/readme.txt
===================================================================
--- XoopsModules/userlog/trunk/userlog/docs/readme.txt 2013-04-06 00:06:06 UTC (rev 11349)
+++ XoopsModules/userlog/trunk/userlog/docs/readme.txt 2013-04-06 06:50:24 UTC (rev 11350)
@@ -13,6 +13,7 @@
Important notice: There is a new "ADDITIONAL permission in file for webmasters" addon introduced in userlog module.
if you want other webmasters dont have access to userlog module this addon is for you.
for more information go to userlog/admin/addon/perm.php
+If you dont need this addon you just need to remove addon/perm.php
known bugs/malfunctioning in userlog module:
1- userlog will not work in XOOPS255/index.php (homepage) when no module is set for start page.
Modified: XoopsModules/userlog/trunk/userlog/docs/readme_devs.txt
===================================================================
--- XoopsModules/userlog/trunk/userlog/docs/readme_devs.txt 2013-04-06 00:06:06 UTC (rev 11349)
+++ XoopsModules/userlog/trunk/userlog/docs/readme_devs.txt 2013-04-06 06:50:24 UTC (rev 11350)
@@ -2,7 +2,7 @@
1- log user activities structure.
I assume we need to gather below information from user. If you have any idea about them please let me know.
-i dont sanitize them because i want to log them as ther are. what is your idea. Im a very basic programmer. please help me.
+i dont sanitize them because i want to log them as they are. what is your idea. Im a very basic programmer. please help me.
in userlog/class/setting.php
@@ -77,15 +77,23 @@
"title" => _AM_USERLOG_PAGETITLE,
"value" => isset($GLOBALS['xoopsTpl']) ? $GLOBALS['xoopsTpl']->get_template_vars("xoops_pagetitle") : ""
),
+ "pageadmin" => array( "type" => "bool",
+ "title" => _AM_USERLOG_PAGEADMIN,
+ "value" => (isset($GLOBALS['xoopsOption']['pagetype']) && $GLOBALS['xoopsOption']['pagetype'] == "admin") ? 1 : 0
+ ),
"module" => array( "type" => "text",
"title" => _AM_USERLOG_MODULE,
"value" => $this->userlog->getLogModule()->getVar("dirname")
),
+ "module_name" => array( "type" => "text",
+ "title" => _AM_USERLOG_MODULE_NAME,
+ "value" => $this->userlog->getLogModule()->getVar("name")
+ ),
"item_name" => array( "type" => "text",
"title" => _AM_USERLOG_ITEM_NAME,
"value" => null
),
- "item_id" => array( "type" => "text",
+ "item_id" => array( "type" => "int",
"title" => _AM_USERLOG_ITEM_ID,
"value" => null
),
@@ -156,7 +164,7 @@
[/code]
2- setting structure.
-i think we just need to log users based on "uid" or "gid" or "ip" and it will cover all possibilities. please let me know your idea.
+I think we just need to log users by getting "uid" or "gid" or "ip" and it will cover all possibilities. please let me know your idea.
the table structure is:
in userlog/sql/mysql.sql
@@ -173,7 +181,7 @@
) ENGINE=MyISAM;
[/code]
-The above is clear. more information in module help.
+The above is clear. more information in userlog > help.
3- performance.
it checks every hit to see if the visitor have a setting or not. for the best performance i wrote a getSet function like this.
@@ -238,8 +246,8 @@
return false;
}
[/code]
-as you can see it create cache files for each settings. IMO it will help to reduce queries for users have a setting.
-for getting settings from db i firstly used criteria but then i decide to get all settings at once and then find if the user have setting or not. IMO it has the better performance. please let me know your opinion. what is the best performance? this function is important for your review.
+as you can see it create cache files for each setting. IMO it will help to reduce queries for users have a setting.
+for getting settings from db at first I used criteria but then i decide to get all settings at once and then find if the user have setting or not. IMO it has the better performance. please let me know your opinion. what is the best performance? this function is important for your review.
Also i add a probability check to access to database in random.
4- views
@@ -247,10 +255,10 @@
but this counter is useless. we dont need forever views. we need views in a specific time period.
in every news agency the first and top block is "today hot news" and it means news that had been most viewed today.
-for a long time that was an unsolved issue for me and i think in the whole xoops we have this problem in all modules.
+for a long time that was an unsolved issue for me and I think in the whole xoops we have this problem in all modules.
after starting userlog for a different purpose I suddenly reach to an innovative idea for gathering all views in all modules.
-i used module "notification" because every module item that should have views have a notification too.
-there we have all needed information about items. so i wrote this nice and tricky function:
+I used "notification" functionality because every module item that should have views have a notification too.
+There we have all needed information about items. so i wrote this nice and tricky function:
[code]
public function setItem()
{
@@ -276,5 +284,5 @@
as you can see i just need to store item_name and item_id because i have the module dirname and script name!!!
-IMO we should stick to this idea to have a overall item views in the XOOPS and drop all counters in all modules.
-i need your idea about this.
\ No newline at end of file
+IMO we should stick to this idea to have an "overall item views" in the XOOPS and drop all counters in all modules.
+I need your idea about this.
\ No newline at end of file
|