-----Original Message----- From: Jim Hu [mailto:jimhu@tamu.edu] Sent: Tuesday, April 17, 2007 10:53 AM To: 'MediaWiki announcements and site admin list' Subject: [Mediawiki-l] ProtectSection.php extension
I meant to do this months ago but just got around to it today. I put a page for ProtectSection.php up on mediawiki.org
http://www.mediawiki.org/wiki/Extension:ProtectSection
it links to the svn version and has the code for my modified version on the page. Originally written by ThomasV... I just tweaked it.
For those who don't already know, ProtectSection.php allows you to block editing of text between <protect></protect> tags from editing by anyone who is not a sysop or a bureaucrat (these group permissions can be modified in the code). My modification suppresses the section edit link for subsections inside protect tags - it may not work properly with caching, but I don't have squid running for my wikis so I can't test that. ===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
It installed all right (after I got my typos fixed). It did not allow editing when I was not logged in. It does not respect the <nowiki> tag, or perhaps the nowiki tag does not recognize it.
"==Protect section== I have added an extension to the /extensions folder ProtectSection.php see http://www.mediawiki.org/wiki/Extension:ProtectSection Supposedly it will by use of the tags <nowiki><protect>(section protected)</protect></nowiki> protect the section between the beginning and ending tags. This should be useful for signed articles, copyright notices, and links back to Wikipedia. Please test and comment. [[User:FJB|FJB]] 16:49, 17 April 2007 (EDT) :It works when I am not logged in, but gives no warning that the section is protected until after the edit is attempted. Of course, one can see the tag, if one is looking for it. [[User:Fred Bauder|Fred]] 16:52, 17 April 2007 (EDT)"
Shows as:
"Protect section
I have added an extension to the /extensions folder ProtectSection.php see http://www.mediawiki.org/wiki/Extension:ProtectSection Supposedly it will by use of the tags (section protected) protect the section between the beginning and ending tags. This should be useful for signed articles, copyright notices, and links back to Wikipedia. Please test and comment. FJB 16:49, 17 April 2007 (EDT) "
I guess it must be this way, otherwise it could be defeated by the simple addition of nowiki tags inclosing the protected section. However it does present a problem in explaining the tag.
This was tried on a system which has a robust, and troublesome, caching system, ibiblio. Seemed to take effect immediately.
Fred
On Apr 17, 2007, at 5:03 PM, Fred Bauder wrote: <snip>
It installed all right (after I got my typos fixed). It did not allow editing when I was not logged in. It does not respect the <nowiki> tag, or perhaps the nowiki tag does not recognize it.
I have broken the respect for nowiki by the kludgy way I hooked it to ParserAfterTidy instead of earlier as in the SVN version. I did this to look for and squash the section edit tags. But clearly that has to get put back in.
Jim
"==Protect section== I have added an extension to the /extensions folder ProtectSection.php see http://www.mediawiki.org/wiki/ Extension:ProtectSection Supposedly it will by use of the tags <nowiki><protect>(section protected)</protect></nowiki> protect the section between the beginning and ending tags. This should be useful for signed articles, copyright notices, and links back to Wikipedia. Please test and comment. [[User:FJB|FJB]] 16:49, 17 April 2007 (EDT) :It works when I am not logged in, but gives no warning that the section is protected until after the edit is attempted. Of course, one can see the tag, if one is looking for it. [[User:Fred Bauder| Fred]] 16:52, 17 April 2007 (EDT)"
Yes, the warning happening only on save is annoying. That's a major reason I suppressed the section edit tags since someone wouldn't even see the protect tags in some situations. I'm not sure how one would implement a less annoying warning system, esp. when the user clicks the top edit tag. At least not easily. I can imagine doing something to replace the text in the textbox with a big comment <!-- noneditable content here id=some unique id--> and then put it back upon saving. But that would be a lot more complex.
Shows as:
"Protect section
I have added an extension to the /extensions folder ProtectSection.php see http://www.mediawiki.org/wiki/ Extension:ProtectSection Supposedly it will by use of the tags (section protected) protect the section between the beginning and ending tags. This should be useful for signed articles, copyright notices, and links back to Wikipedia. Please test and comment. FJB 16:49, 17 April 2007 (EDT) "
I guess it must be this way, otherwise it could be defeated by the simple addition of nowiki tags inclosing the protected section. However it does present a problem in explaining the tag.
This was tried on a system which has a robust, and troublesome, caching system, ibiblio. Seemed to take effect immediately.
Fred
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
Should be
"I probably broke..." or "I may have broken..."
Don't want to suggest that it was deliberate!!
Jim
On Apr 17, 2007, at 7:37 PM, Jim Hu wrote:
On Apr 17, 2007, at 5:03 PM, Fred Bauder wrote:
<snip> > It installed all right (after I got my typos fixed). It did not > allow editing when I was not logged in. It does not respect the > <nowiki> tag, or perhaps the nowiki tag does not recognize it.
I have broken the respect for nowiki by the kludgy way I hooked it to ParserAfterTidy instead of earlier as in the SVN version. I did this to look for and squash the section edit tags. But clearly that has to get put back in.
Jim
"==Protect section== I have added an extension to the /extensions folder ProtectSection.php see http://www.mediawiki.org/wiki/ Extension:ProtectSection Supposedly it will by use of the tags <nowiki><protect>(section protected)</protect></nowiki> protect the section between the beginning and ending tags. This should be useful for signed articles, copyright notices, and links back to Wikipedia. Please test and comment. [[User:FJB|FJB]] 16:49, 17 April 2007 (EDT) :It works when I am not logged in, but gives no warning that the section is protected until after the edit is attempted. Of course, one can see the tag, if one is looking for it. [[User:Fred Bauder| Fred]] 16:52, 17 April 2007 (EDT)"
Yes, the warning happening only on save is annoying. That's a major reason I suppressed the section edit tags since someone wouldn't even see the protect tags in some situations. I'm not sure how one would implement a less annoying warning system, esp. when the user clicks the top edit tag. At least not easily. I can imagine doing something to replace the text in the textbox with a big comment <!-- noneditable content here id=some unique id--> and then put it back upon saving. But that would be a lot more complex.
Shows as:
"Protect section
I have added an extension to the /extensions folder ProtectSection.php see http://www.mediawiki.org/wiki/ Extension:ProtectSection Supposedly it will by use of the tags (section protected) protect the section between the beginning and ending tags. This should be useful for signed articles, copyright notices, and links back to Wikipedia. Please test and comment. FJB 16:49, 17 April 2007 (EDT) "
I guess it must be this way, otherwise it could be defeated by the simple addition of nowiki tags inclosing the protected section. However it does present a problem in explaining the tag.
This was tried on a system which has a robust, and troublesome, caching system, ibiblio. Seemed to take effect immediately.
Fred
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
Thinking about this, I'm not sure how protect should interact with nowiki, since you wouldn't want someone to be able to unprotect something by wrapping it in nowiki. But you do want to be able to document the protect tag in the wiki.
Jim
On Apr 17, 2007, at 7:39 PM, Jim Hu wrote:
Should be
"I probably broke..." or "I may have broken..."
Don't want to suggest that it was deliberate!!
Jim
On Apr 17, 2007, at 7:37 PM, Jim Hu wrote:
On Apr 17, 2007, at 5:03 PM, Fred Bauder wrote:
<snip> > It installed all right (after I got my typos fixed). It did not > allow editing when I was not logged in. It does not respect the > <nowiki> tag, or perhaps the nowiki tag does not recognize it.
I have broken the respect for nowiki by the kludgy way I hooked it to ParserAfterTidy instead of earlier as in the SVN version. I did this to look for and squash the section edit tags. But clearly that has to get put back in.
Jim
"==Protect section== I have added an extension to the /extensions folder ProtectSection.php see http://www.mediawiki.org/wiki/ Extension:ProtectSection Supposedly it will by use of the tags <nowiki><protect>(section protected)</protect></nowiki> protect the section between the beginning and ending tags. This should be useful for signed articles, copyright notices, and links back to Wikipedia. Please test and comment. [[User:FJB|FJB]] 16:49, 17 April 2007 (EDT) :It works when I am not logged in, but gives no warning that the section is protected until after the edit is attempted. Of course, one can see the tag, if one is looking for it. [[User:Fred Bauder| Fred]] 16:52, 17 April 2007 (EDT)"
Yes, the warning happening only on save is annoying. That's a major reason I suppressed the section edit tags since someone wouldn't even see the protect tags in some situations. I'm not sure how one would implement a less annoying warning system, esp. when the user clicks the top edit tag. At least not easily. I can imagine doing something to replace the text in the textbox with a big comment <!-- noneditable content here id=some unique id--> and then put it back upon saving. But that would be a lot more complex.
Shows as:
"Protect section
I have added an extension to the /extensions folder ProtectSection.php see http://www.mediawiki.org/wiki/ Extension:ProtectSection Supposedly it will by use of the tags (section protected) protect the section between the beginning and ending tags. This should be useful for signed articles, copyright notices, and links back to Wikipedia. Please test and comment. FJB 16:49, 17 April 2007 (EDT) "
I guess it must be this way, otherwise it could be defeated by the simple addition of nowiki tags inclosing the protected section. However it does present a problem in explaining the tag.
This was tried on a system which has a robust, and troublesome, caching system, ibiblio. Seemed to take effect immediately.
Fred
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
Jim Hu wrote:
Thinking about this, I'm not sure how protect should interact with nowiki, since you wouldn't want someone to be able to unprotect something by wrapping it in nowiki. But you do want to be able to document the protect tag in the wiki.
Jim
Don't <nowiki> full protect tags. Document it with <nowiki><prote</nowiki>ct> or similar.
On Apr 18, 2007, at 5:20 PM, Platonides wrote:
Jim Hu wrote:
Thinking about this, I'm not sure how protect should interact with nowiki, since you wouldn't want someone to be able to unprotect something by wrapping it in nowiki. But you do want to be able to document the protect tag in the wiki.
Jim
Don't <nowiki> full protect tags. Document it with <nowiki><prote</nowiki>ct> or similar.
I am in awe of your wiki-markup-fu.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
mediawiki-l@lists.wikimedia.org