Hi Mr. Raymundo, \\
this is an intend to implement a new action for admins that returns a list of all pages in order to check or uncheck the lock parameter, having bulk action style. \\
It works fine for me (big thanks for your snippets). \\
\\
\\
sub PrintPageLockList { \\
my ($pagename, @pagename); \\
my ($status, $altname); \\
my (@results) = @_; \\
my %hash; \\
\\
print &GetHeader('', T("'Read' Bulk"), ''); \\
print $q->start_form("post","$ScriptName",""); \\
print ""; \\
print ""; \\
print ''; \\
foreach $pagename (&AllPagesList()) { \\
next if (&PageIsHidden($pagename)); \\
@pagename = split (/\//,$pagename); \\
print '- '; \\
if (-f &GetLockedPageFile($pagename)) { \\
print " "; \\
} else { \\
print " "; \\
} \\
if (!&GetParam('checked') && -f &GetLockedPageFile($pagename)) { \\
print "" ; \\
} \\
for (1 .. $#pagename) {print ' . ',} \\
print &GetPageLink($pagename); \\
} \\
} \\
print '
'; \\
print $q->submit(T('DoIt')) if (&UserIsAdmin()); \\
print $q->endform; \\
print '
'; \\
print &GetFooterText(); \\
} \\
\\
sub DoLockCheckedFiles { \\
my (%vars, %srav, %count, @doit, @undo, @diffs); \\
my $fname; \\
my $diffs; \\
\\
print &GetHeader("", T('Lock Checked Files'), ""); \\
return if (!&UserIsAdminOrError()); \\
%srav = 0; \\
%srav = $q->Vars; \\
@undo = split(/\0/,$srav{'undo'}, -1); \\
%vars = 0; \\
%vars = $q->Vars; \\
@doit = split(/\0/,$vars{'doit'}, -1); \\
# Uncommon elements (changes for submit: check to unchek or viceversa) \\
map $count{$_}++ , @doit, @undo; \\
$, = ""; \\
push (@diffs, grep $count{$_} == 1, @doit, @undo); \\
if (@diffs) { \\
foreach (@diffs) { \\
$fname = &GetLockedPageFile($_); \\
if (-f $fname) { \\
unlink $fname; \\
print Ts('%s is unlocked successfully', $_) .'
'; \\
next; \\
} \\
if (!-f $fname) { \\
&WriteStringToFile($fname, "editing locked."); \\
print Ts('%s is locked successfully', $_) .'
'; \\
} \\
} \\
} else { \\
print T('Invalid URL or bulk does not exist --nothing done'); \\
} \\
print &GetFooterText(); \\
} \\
\\
Good weekend! :) \\
\\
--JuanmaMP
Sorry for $altname, &GetFooterText and perhaps, other oddities coming from my own hacked code. \\
Regards
Hi over there, \\
a bit polished of this matter, here: UseMod:WikiPatches/BulkLock. \\
Hope it's fun ...
: Wow, you're so active in usemod.org! Great! :-D
yep, for the being time, a really peaceful place ... :))
the next patch that I would like uploading is "this site is hidden" (visibility under password). \\
Something like this: \\
http://www.mydigitallife.info/wp-content/uploads/2008/06/forgot-wordpress-password-266x300.jpg. \\
I'll share it. \\
Good night over there.
if you prefer erased my last comment to your choice. I wanted uploading a typical login snapshot into a web but finally it returned that thing. Sorry.
: LOL, I had to guess 'what is that?' hahaha. It's okay.
----
[[위키위키분류]]