Is there any way I can stop that gaping mouth of an edit box on empty
category pages??
P.S., I will see you here in Taiwan at WikiMania, 8/2007.
function fnmybla($text,$title)
{
if ( ( NS_CATEGORY == $title->mNamespace )
|| ( NS_CATEGORY_TALK == $title->mNamespace ) )
{
$text = "(Please don't edit any Category pages on this wiki.
They are ment to have members, but no text bodies, on purpose. I
cannot figure out any way to stop the big edit window from opening
below. I wish when one visits action=edit on category pages, it would
act like action=view. I could have \$wgHooks['userCan'] return false,
but then the user is given 'This page has been locked to prevent
editing...' and must click an additional time to see what are the
member categories.
makeBrokenLinkObj() has no hook to stop making them &action=edit links
for empty categories. I wish I had a way to change them to
action=view, i.e., no action= parameter at all.)";
}
}
$wgHooks['EditFormPreloadText'][]='fnmybla';
function fnmyEdit(&$this )
{
#gave up due to not being a php phd
global $wgUser, $wgOut, $wgRequest, $wgContLang;
global $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol, $wgParser;
global $wgUseTrackbacks, $wgNamespaceRobotPolicies;
global $wgArticle, $wgTitle;
$sk = $wgUser->getSkin();
wfDebug("qq$wgTitle->mNamespace $wgTitle->mTitle\n");
if ( ( NS_CATEGORY == $wgTitle->mNamespace )
|| ( NS_CATEGORY_TALK == $wgTitle->mNamespace ) )
{
#maybe these will do what I want, except I don't know how to invoke them.
CategoryPage::view();
#CategoryPage::doCategoryMagic();
return false;
#you see, I want the user to see just what he would if action=view,
though he did HTTP GET action=edit.
#no, Article::view(); won't get the category links shown.
}
return true;
}
$wgHooks['AlternateEdit'][]=fnmyEdit;
As you can see I want to contain all this inside LocalSettings.php.
Show replies by thread