A hooks.txt file in a recent distribution of MediaWiki refers to a content_actions.php file, which supposedly exposes instantiation logic of edit tabs at the top of the page. I find no such file in that distribution. Am I missing something, or will I need to write original code to gain control of those ubiquitous tabs?
A hooks.txt file in a recent distribution of MediaWiki refers to a content_actions.php file, which supposedly exposes instantiation logic of edit tabs at the top of the page. I find no such file in that distribution. Am I missing something, or will I need to write original code to gain control of those ubiquitous tabs?
------------------------------------------------ # svn blame docs/hooks.txt | grep -i content_actions 10411 avar $content_actions: The array of content actions # ------------------------------------------------
So it's from r10411, i.e.: http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=10411 , and we can see from that URL that it's about 14 months old (so we probably want to confirm that it's still there), and also that $content_actions is probably an array rather than a file (at least in the MediaWiki core).
Testing whether it's still there: ------------------------------------------------ /var/www/hosts/mediawiki/wiki# grep -inr $content_actions includes/* includes/SkinTemplate.php:426: $content_actions = $this->buildContentActionUrls(); includes/SkinTemplate.php:427: $tpl->setRef('content_actions', $content_actions); includes/SkinTemplate.php:432: $tpl->set('body_ondblclick', 'document.location = "' .$content_actions['edit']['href'] .'";'); includes/SkinTemplate.php:618: $content_actions = array(); includes/SkinTemplate.php:628: $content_actions[$nskey] = $this->tabAction( includes/SkinTemplate.php:634: $content_actions['talk'] = $this->tabAction( includes/SkinTemplate.php:645: $content_actions['edit'] = array( includes/SkinTemplate.php:652: $content_actions['addsection'] = array( includes/SkinTemplate.php:659: $content_actions['viewsource'] = array( includes/SkinTemplate.php:670: $content_actions['history'] = array( includes/SkinTemplate.php:678: $content_actions['protect'] = array( includes/SkinTemplate.php:685: $content_actions['unprotect'] = array( includes/SkinTemplate.php:693: $content_actions['delete'] = array( includes/SkinTemplate.php:701: $content_actions['move'] = array( includes/SkinTemplate.php:712: $content_actions['undelete'] = array( includes/SkinTemplate.php:725: $content_actions['watch'] = array( includes/SkinTemplate.php:731: $content_actions['unwatch'] = array( includes/SkinTemplate.php:739: wfRunHooks( 'SkinTemplateTabs', array( &$this , &$content_actions ) ) ; includes/SkinTemplate.php:743: $content_actions[$this->mTitle->getNamespaceKey()] = array( includes/SkinTemplate.php:749: wfRunHooks( 'SkinTemplateBuildContentActionUrlsAfterSpecialPage', array( &$this, &$content_actions ) ); includes/SkinTemplate.php:766: $content_actions['varlang-' . $vcount] = array( includes/SkinTemplate.php:775: wfRunHooks( 'SkinTemplateContentActions', array( &$content_actions ) ); includes/SkinTemplate.php:778: return $content_actions; root@bling:/var/www/hosts/mediawiki/wiki# ------------------------------------------------
So that looks like a yes. And we can check whether any extensions use it with a "grep -inr $content_actions extensions/*" (on a directory with all the extensions from SVN), and there are indeed some extensions that seem to do stuff with the $content_actions array (e.g. extensions/SemanticMediaWiki, extensions/CategoryTree, extensions/Tasks, extensions/Purge.php ).
There's also an "extensions/examples/Content_action.php" file, which sounds like it may be particularly interesting to you. It's viewable via the web at: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/examples/Content_...
Hope that helps.
All the best, Nick.
wikitech-l@lists.wikimedia.org