r51069 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51068‎ | r51069 | r51070 >
Date:15:50, 27 May 2009
Author:yaron
Status:deferred
Tags:
Comment:
Added Admin Links hook
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php
@@ -7,7 +7,7 @@
88
99 if ( !defined( 'MEDIAWIKI' ) ) die();
1010
11 -define('SF_VERSION','1.6');
 11+define('SF_VERSION','1.7');
1212
1313 $wgExtensionCredits['specialpage'][]= array(
1414 'path' => __FILE__,
@@ -34,6 +34,7 @@
3535 $wgHooks['UnknownAction'][] = 'SFFormEditTab::displayForm';
3636 $wgHooks['SkinTemplateTabs'][] = 'SFFormEditTab::displayTab';
3737 $wgHooks['smwInitProperties'][] = 'SFUtils::initProperties';
 38+$wgHooks['AdminLinks'][] = 'sffAddToAdminLinks';
3839
3940 $wgAPIModules['sfautocomplete'] = 'SFAutocompleteAPI';
4041
@@ -68,6 +69,9 @@
6970 $wgSpecialPages['EditData'] = 'SFEditData';
7071 $wgAutoloadClasses['SFEditData'] = $sfgIP . '/specials/SF_EditData.php';
7172 $wgSpecialPageGroups['EditData'] = 'sf_group';
 73+$wgSpecialPages['RunQuery'] = 'SFRunQuery';
 74+$wgAutoloadClasses['SFRunQuery'] = $sfgIP . '/specials/SF_RunQuery.php';
 75+$wgSpecialPageGroups['RunQuery'] = 'sf_group';
7276 $wgSpecialPages['UploadWindow'] = 'SFUploadWindow';
7377 $wgAutoloadClasses['SFUploadWindow'] = $sfgIP . '/specials/SF_UploadWindow.php';
7478
@@ -203,3 +207,24 @@
204208 $sfgLang = new $sfLangClass();
205209 }
206210 }
 211+
 212+function sffAddToAdminLinks(&$admin_links_tree) {
 213+ $data_structure_section = $admin_links_tree->getSection('Data structure');
 214+ if (is_null($data_structure_section))
 215+ return true;
 216+ $smw_row = $data_structure_section->getRow('smw');
 217+ $smw_row->addItem(ALItem::newFromSpecialPage('Templates'), 'Properties');
 218+ $smw_row->addItem(ALItem::newFromSpecialPage('Forms'), 'SemanticStatistics');
 219+ $smw_admin_row = $data_structure_section->getRow('smw_admin');
 220+ $smw_admin_row->addItem(ALItem::newFromSpecialPage('CreateClass'), 'SMWAdmin');
 221+ $smw_admin_row->addItem(ALItem::newFromSpecialPage('CreateProperty'), 'SMWAdmin');
 222+ $smw_admin_row->addItem(ALItem::newFromSpecialPage('CreateTemplate'), 'SMWAdmin');
 223+ $smw_admin_row->addItem(ALItem::newFromSpecialPage('CreateForm'), 'SMWAdmin');
 224+ $smw_admin_row->addItem(ALItem::newFromSpecialPage('CreateCategory'), 'SMWAdmin');
 225+ $smw_docu_row = $data_structure_section->getRow('smw_docu');
 226+ $sf_name = wfMsg('specialpages-group-sf_group');
 227+ $sf_docu_label = wfMsg('adminlinks_documentation', $sf_name);
 228+ $smw_docu_row->addItem(AlItem::newFromExternalLink("http://www.mediawiki.org/wiki/Extension:Semantic_Forms", $sf_docu_label));
 229+
 230+ return true;
 231+}

Status & tagging log