r52418 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52417‎ | r52418 | r52419 >
Date:21:26, 25 June 2009
Author:yaron
Status:deferred
Tags:
Comment:
Added handling for new $sfgRenamedMainEditTab
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormEditTab.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormEditTab.php
@@ -24,7 +24,7 @@
2525 $form_names = SFLinkUtils::getFormsForArticle($obj);
2626 if (count($form_names) > 0) {
2727 global $wgRequest, $wgUser;
28 - global $sfgRenameEditTabs;
 28+ global $sfgRenameEditTabs, $sfgRenameMainEditTab;
2929
3030 wfLoadExtensionMessages('SemanticForms');
3131
@@ -37,10 +37,18 @@
3838 if (array_key_exists('edit', $content_actions)) {
3939 $content_actions['edit']['text'] = $user_can_edit ? wfMsg('sf_editsource') : wfMsg('viewsource');
4040 }
41 - } elseif ($user_can_edit) {
42 - $form_edit_tab_text = $obj->mTitle->exists() ? wfMsg('sf_formedit') : wfMsg('sf_formcreate');
4341 } else {
44 - $form_edit_tab_text = wfMsg('sf_viewform');
 42+ if ($user_can_edit)
 43+ $form_edit_tab_text = $obj->mTitle->exists() ? wfMsg('sf_formedit') : wfMsg('sf_formcreate');
 44+ else
 45+ $form_edit_tab_text = wfMsg('sf_viewform');
 46+ // check for renaming of main edit tab
 47+ // only if $sfgRenameEditTabs is off
 48+ if ($sfgRenameMainEditTab) {
 49+ if (array_key_exists('edit', $content_actions)) {
 50+ $content_actions['edit']['text'] = $user_can_edit ? wfMsg('sf_editsource') : wfMsg('viewsource');
 51+ }
 52+ }
4553 }
4654
4755 $class_name = ($wgRequest->getVal('action') == 'formedit') ? 'selected' : '';

Status & tagging log