r95302 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95301‎ | r95302 | r95303 >
Date:08:00, 23 August 2011
Author:jeroendedauw
Status:deferred
Tags:lamecommitsummary 
Comment:
Modified paths:
  • /trunk/extensions/Survey/Survey.hooks.php (modified) (history)
  • /trunk/extensions/Survey/Survey.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Survey/Survey.php
@@ -60,4 +60,33 @@
6161 $wgSpecialPages['SpecialSurveys'] = 'SpecialSurveys';
6262 $wgSpecialPages['SpecialSurveyStats'] = 'SpecialSurveyStats';
6363
 64+$wgAPIModules['addsurvey'] = 'ApiAddSurvey';
 65+$wgAPIModules['deletesurvey'] = 'ApiDeleteSurvey';
 66+$wgAPIModules['editsurvey'] = 'ApiEditSurvey';
 67+$wgAPIModules['submitsurvey'] = 'ApiSubmitSurvey';
 68+$wgAPIListModules['surveys'] = 'ApiQuerySurveys';
 69+
 70+$wgHooks['LoadExtensionSchemaUpdates'][] = 'SurveyHooks::onSchemaUpdate';
 71+
 72+$wgAvailableRights[] = 'surveyadmin';
 73+$wgAvailableRights[] = 'surveysubmit';
 74+
 75+$egSurveyScriptPath = $wgExtensionAssetsPath === false ? $wgScriptPath . '/extensions' : $wgExtensionAssetsPath;
 76+$egSurveyScriptPath .= '/Survey/resources';
 77+
 78+$moduleTemplate = array(
 79+ 'localBasePath' => dirname( __FILE__ ),
 80+ 'remoteBasePath' => $egSurveyScriptPath
 81+);
 82+
 83+$wgResourceModules['ext.survey'] = $moduleTemplate + array(
 84+ 'styles' => array(),
 85+ 'scripts' => array(
 86+ 'jquery.survey.js'
 87+ ),
 88+ 'dependencies' => array(),
 89+ 'messages' => array(
 90+ )
 91+);
 92+
6493 $egSurveySettings = array();
Index: trunk/extensions/Survey/Survey.hooks.php
@@ -13,6 +13,46 @@
1414 */
1515 final class SurveyHooks {
1616
 17+ /**
 18+ * Schema update to set up the needed database tables.
 19+ *
 20+ * @since 0.1
 21+ *
 22+ * @param DatabaseUpdater $updater
 23+ *
 24+ * @return true
 25+ */
 26+ public static function onSchemaUpdate( /* DatabaseUpdater */ $updater = null ) {
 27+ global $wgDBtype;
 28+
 29+ if ( $wgDBtype == 'mysql' ) {
 30+ $updater->addExtensionUpdate( array(
 31+ 'addTable',
 32+ 'surveys',
 33+ dirname( __FILE__ ) . '/Survey.sql',
 34+ true
 35+ ) );
 36+ $updater->addExtensionUpdate( array(
 37+ 'addTable',
 38+ 'survey_questions',
 39+ dirname( __FILE__ ) . '/Survey.sql',
 40+ true
 41+ ) );
 42+ $updater->addExtensionUpdate( array(
 43+ 'addTable',
 44+ 'survey_submissions',
 45+ dirname( __FILE__ ) . '/Survey.sql',
 46+ true
 47+ ) );
 48+ $updater->addExtensionUpdate( array(
 49+ 'addTable',
 50+ 'survey_answers',
 51+ dirname( __FILE__ ) . '/Survey.sql',
 52+ true
 53+ ) );
 54+ }
 55+
 56+ return true;
 57+ }
1758
18 -
1959 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95301added base of API modulesjeroendedauw07:50, 23 August 2011

Status & tagging log