Index: trunk/extensions/UploadWizard/UploadWizard.php |
— | — | @@ -67,6 +67,7 @@ |
68 | 68 | // for ResourceLoader |
69 | 69 | $wgHooks['ResourceLoaderRegisterModules'][] = 'UploadWizardHooks::resourceLoaderRegisterModules'; |
70 | 70 | $wgHooks['CanonicalNamespaces'][] = 'UploadWizardHooks::canonicalNamespaces'; |
| 71 | +$wgHooks['LoadExtensionSchemaUpdates'][] = 'UploadWizardHooks::onSchemaUpdate'; |
71 | 72 | |
72 | 73 | // Init the upload wizard config array |
73 | 74 | // UploadWizard.config.php includes default configuration |
Index: trunk/extensions/UploadWizard/SpecialUploadCampaigns.php |
— | — | @@ -1,4 +1,5 @@ |
2 | 2 | <?php |
| 3 | + |
3 | 4 | /** |
4 | 5 | * Special:UploadCampaigns |
5 | 6 | * |
— | — | @@ -7,36 +8,513 @@ |
8 | 9 | * @file |
9 | 10 | * @ingroup SpecialPage |
10 | 11 | * @ingroup Upload |
| 12 | + * |
| 13 | + * @since 1.2 |
| 14 | + * |
| 15 | + * @licence GNU GPL v3+ |
| 16 | + * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
11 | 17 | */ |
12 | | - |
13 | 18 | class SpecialUploadCampaigns extends SpecialPage { |
14 | 19 | |
15 | 20 | /** |
16 | 21 | * Constructor. |
17 | 22 | * |
18 | 23 | * @param $request is the request (usually wgRequest) |
19 | | - * @param $par is everything in the URL after Special:UploadWizard. Not sure what we can use it for |
| 24 | + * @param $par is everything in the URL after Special:UploadCampaigns. Not sure what we can use it for |
20 | 25 | */ |
21 | 26 | public function __construct( $request = null, $par = null ) { |
22 | 27 | global $wgRequest; |
23 | 28 | |
24 | 29 | parent::__construct( 'UploadCampaigns', 'delete' ); |
25 | | - |
26 | | - // TODO |
27 | 30 | } |
28 | 31 | |
29 | 32 | /** |
30 | 33 | * Main method. |
31 | 34 | * |
32 | | - * @param string $subPage, e.g. the "foo" in Special:UploadWizard/foo. |
| 35 | + * @param string $subPage, e.g. the "foo" in Special:UploadCampaigns/foo. |
33 | 36 | */ |
34 | 37 | public function execute( $subPage ) { |
| 38 | + $this->setHeaders(); |
| 39 | + $this->outputHeader(); |
| 40 | + |
35 | 41 | // If the user is authorized, display the page, if not, show an error. |
36 | 42 | if ( $this->userCanExecute( $GLOBALS['wgUser'] ) ) { |
37 | | - // TODO |
| 43 | + if ( $GLOBALS['wgRequest']->wasPosted() && $GLOBALS['wgUser']->matchEditToken( $GLOBALS['wgRequest']->getVal( 'wpEditToken' ) ) ) { |
| 44 | + $this->handleSubmission(); |
| 45 | + } |
| 46 | + |
| 47 | + if ( !is_null( $subPage ) && trim( $subPage ) != '' ) { |
| 48 | + if ( $subPage == 'new' ) { |
| 49 | + $this->displayCampaign( new UWCampaign( null, '', true, array() ), true ); |
| 50 | + } |
| 51 | + else { |
| 52 | + $campaign = UWCampaign::newFromName( $subPage ); |
| 53 | + |
| 54 | + if ( $campaign === false ) { |
| 55 | + $this->displayCampaignList(); |
| 56 | + } |
| 57 | + else { |
| 58 | + $this->displayCampaign( $campaign ); |
| 59 | + } |
| 60 | + } |
| 61 | + } |
| 62 | + else { |
| 63 | + $this->displayCampaignList(); |
| 64 | + } |
38 | 65 | } else { |
39 | 66 | $this->displayRestrictionError(); |
40 | | - } |
| 67 | + } |
41 | 68 | } |
| 69 | + |
| 70 | + protected function handleSubmission() { |
| 71 | + global $wgOut; |
| 72 | + |
| 73 | + // TODO |
| 74 | + } |
| 75 | + |
| 76 | + /** |
| 77 | + * Displays a list of all campaigns. |
| 78 | + * |
| 79 | + * @since 1.2 |
| 80 | + */ |
| 81 | + protected function displayCampaignList() { |
| 82 | + $this->displayAddNewControl(); |
| 83 | + |
| 84 | + $dbr = wfGetDB( DB_SLAVE ); |
| 85 | + |
| 86 | + $campaigns = $dbr->select( |
| 87 | + 'uw_campaigns', |
| 88 | + array( |
| 89 | + 'campaign_id', |
| 90 | + 'campaign_name', |
| 91 | + 'campaign_enabled', |
| 92 | + ) |
| 93 | + ); |
| 94 | + |
| 95 | + if ( $campaigns->numRows() > 0 ) { |
| 96 | + $this->displayCampaignTable( $campaigns ); |
| 97 | + } |
| 98 | + } |
| 99 | + |
| 100 | + protected function displayAddNewControl() { |
| 101 | + global $wgOut; |
| 102 | + |
| 103 | + $wgOut->addHTML( Html::openElement( |
| 104 | + 'form', |
| 105 | + array( |
| 106 | + 'method' => 'post', |
| 107 | + 'action' => $this->getTitle()->getLocalURL(), |
| 108 | + ) |
| 109 | + ) ); |
| 110 | + |
| 111 | + $wgOut->addHTML( '<fieldset>' ); |
| 112 | + |
| 113 | + $wgOut->addHTML( '<legend>' . htmlspecialchars( wfMsg( 'mwe-upwiz-campaigns-addnew' ) ) . '</legend>' ); |
| 114 | + |
| 115 | + $wgOut->addHTML( Html::element( 'p', array(), wfMsg( 'mwe-upwiz-campaigns-namedoc' ) ) ); |
| 116 | + |
| 117 | + $wgOut->addHTML( Html::element( 'label', array( 'for' => 'newcampaign' ), wfMsg( 'mwe-upwiz-campaigns-newname' ) ) ); |
| 118 | + |
| 119 | + $wgOut->addHTML( Html::input( 'newcampaign' ) . ' ' ); |
| 120 | + |
| 121 | + $wgOut->addHTML( Html::input( |
| 122 | + 'addnewcampaign', |
| 123 | + wfMsg( 'mwe-upwiz-campaigns-add' ), |
| 124 | + 'submit' |
| 125 | + ) ); |
| 126 | + |
| 127 | + $wgOut->addHTML( Html::hidden( 'wpEditToken', $GLOBALS['wgUser']->editToken() ) ); |
| 128 | + |
| 129 | + $wgOut->addHTML( '</fieldset></form>' ); |
| 130 | + } |
| 131 | + |
| 132 | + protected function displayCampaignTable( ResultWrapper $campaigns ) { |
| 133 | + global $wgOut; |
| 134 | + |
| 135 | + $wgOut->addHTML( Html::element( 'h2', array(), wfMsg( 'mwe-upwiz-campaigns-existing' ) ) ); |
| 136 | + |
| 137 | + $wgOut->addHTML( '<table>' ); |
| 138 | + |
| 139 | + $wgOut->addHTML( |
| 140 | + '<tr>' . |
| 141 | + Html::element( 'th', array(), wfMsg( 'mwe-upwiz-campaigns-name' ) ) . |
| 142 | + Html::element( 'th', array(), wfMsg( 'mwe-upwiz-campaigns-status' ) ) . |
| 143 | + Html::element( 'th', array(), wfMsg( 'mwe-upwiz-campaigns-edit' ) ) . |
| 144 | + '</tr>' |
| 145 | + ); |
| 146 | + |
| 147 | + foreach ( $campaigns as $campaign ) { |
| 148 | + $wgOut->addHTML( |
| 149 | + '<tr>' . |
| 150 | + Html::element( 'td', array(), $campaign->campaign_name ) . |
| 151 | + Html::element( 'td', array(), wfMsg( 'mwe-upwiz-campaigns-' . ( $campaign->campaign_enabled ? 'enabled' : 'disabled' ) ) ) . |
| 152 | + Html::element( 'td', array(), wfMsg( 'mwe-upwiz-campaigns-edit' ) ) . |
| 153 | + '</tr>' |
| 154 | + ); |
| 155 | + } |
| 156 | + |
| 157 | + $wgOut->addHTML( '</table>' ); |
| 158 | + } |
| 159 | + |
| 160 | + /** |
| 161 | + * Displays a form to modify a single campaign. |
| 162 | + * |
| 163 | + * @since 1.2 |
| 164 | + * |
| 165 | + * @param UWCampaign $campaign |
| 166 | + * @param boolean $isInsert |
| 167 | + */ |
| 168 | + protected function displayCampaign( UWCampaign $campaign, $isInsert = false ) { |
| 169 | + global $wgOut; |
| 170 | + |
| 171 | + // TODO |
| 172 | + } |
42 | 173 | |
43 | | -} |
\ No newline at end of file |
| 174 | +} |
| 175 | + |
| 176 | +class UWCampaign { |
| 177 | + |
| 178 | + /** |
| 179 | + * If the ID of the campaign. |
| 180 | + * Either this matched a record in the uw_campaigns table or is null. |
| 181 | + * |
| 182 | + * @since 1.2 |
| 183 | + * @var integer or null |
| 184 | + */ |
| 185 | + protected $id; |
| 186 | + |
| 187 | + /** |
| 188 | + * If the name of the campaign. |
| 189 | + * This name is the string used to invoke the campaign via campaign=name. |
| 190 | + * |
| 191 | + * @since 1.2 |
| 192 | + * @var string |
| 193 | + */ |
| 194 | + protected $name; |
| 195 | + |
| 196 | + /** |
| 197 | + * If the campaign is enabled or not. |
| 198 | + * |
| 199 | + * @since 1.2 |
| 200 | + * @var boolean |
| 201 | + */ |
| 202 | + protected $isEnabled; |
| 203 | + |
| 204 | + /** |
| 205 | + * The campaign configuration. |
| 206 | + * |
| 207 | + * @since 1.2 |
| 208 | + * @var array |
| 209 | + */ |
| 210 | + protected $config; |
| 211 | + |
| 212 | + /** |
| 213 | + * Create a new instance of $campaignName. |
| 214 | + * |
| 215 | + * @since 1.2 |
| 216 | + * |
| 217 | + * @param integer $id |
| 218 | + * @param string $name |
| 219 | + * @param boolean $isEnabled |
| 220 | + * @param array $config |
| 221 | + */ |
| 222 | + public function __construct( $id, $name, $isEnabled, array $config ) { |
| 223 | + $this->id = $id; |
| 224 | + $this->name = $name; |
| 225 | + $this->isEnabled = $isEnabled; |
| 226 | + $this->config = $config; |
| 227 | + } |
| 228 | + |
| 229 | + /** |
| 230 | + * Returns the UWCampaign with specified name, or false if there is no such campaign. |
| 231 | + * |
| 232 | + * @since 1.2 |
| 233 | + * |
| 234 | + * @param string $campaignName |
| 235 | + * |
| 236 | + * @return UWCampaign or false |
| 237 | + */ |
| 238 | + public static function newFromName( $campaignName ) { |
| 239 | + return self::newFromDB( array( 'campaign_name' => $campaignName ) ); |
| 240 | + } |
| 241 | + |
| 242 | + /** |
| 243 | + * Returns the UWCampaign with specified ID, or false if there is no such campaign. |
| 244 | + * |
| 245 | + * @since 1.2 |
| 246 | + * |
| 247 | + * @param integer $campaignId |
| 248 | + * |
| 249 | + * @return UWCampaign or false |
| 250 | + */ |
| 251 | + public static function newFromId( $campaignId ) { |
| 252 | + return self::newFromDB( array( 'campaign_id' => $campaignId ) ); |
| 253 | + } |
| 254 | + |
| 255 | + /** |
| 256 | + * Returns a new instance of UWCampaign build from a database result |
| 257 | + * obtained by doing a select with the porvided conditions on the uw_campaigns table. |
| 258 | + * If no campaign matches the conditions, false will be returned. |
| 259 | + * |
| 260 | + * @since 1.2 |
| 261 | + * |
| 262 | + * @param array $conditions |
| 263 | + * |
| 264 | + * @return UWCampaign or false |
| 265 | + */ |
| 266 | + protected static function newFromDB( array $conditions ) { |
| 267 | + $dbr = wfGetDB( DB_SLAVE ); |
| 268 | + |
| 269 | + $campaign = $dbr->selectRow( |
| 270 | + 'uw_campaigns', |
| 271 | + array( |
| 272 | + 'campaign_id', |
| 273 | + 'campaign_name', |
| 274 | + 'campaign_enabled', |
| 275 | + ), |
| 276 | + $conditions |
| 277 | + ); |
| 278 | + |
| 279 | + if ( !$campaign ) { |
| 280 | + return false; |
| 281 | + } |
| 282 | + |
| 283 | + $confProps = $dbr->select( |
| 284 | + 'uw_campaign_conf', |
| 285 | + array( 'cc_property', 'cc_value' ), |
| 286 | + array( 'cc_campaign_id' => $campaign->campaign_id ) |
| 287 | + ); |
| 288 | + |
| 289 | + $config = array(); |
| 290 | + |
| 291 | + foreach ( $confProps as $confProp ) { |
| 292 | + $config[$confProp->cc_property] = $confProp->cc_value; |
| 293 | + } |
| 294 | + |
| 295 | + return new self( |
| 296 | + $campaign->campaign_id, |
| 297 | + $campaign->campaign_name, |
| 298 | + $campaign->campaign_enabled, |
| 299 | + $config |
| 300 | + ); |
| 301 | + } |
| 302 | + |
| 303 | + /** |
| 304 | + * Returns the id of the campaign. |
| 305 | + * |
| 306 | + * @since 1.2 |
| 307 | + * |
| 308 | + * @return intgere |
| 309 | + */ |
| 310 | + public function getId() { |
| 311 | + return $this->id; |
| 312 | + } |
| 313 | + |
| 314 | + /** |
| 315 | + * Returns the name of the campaign. |
| 316 | + * |
| 317 | + * @since 1.2 |
| 318 | + * |
| 319 | + * @return string |
| 320 | + */ |
| 321 | + public function getName() { |
| 322 | + return $this->name; |
| 323 | + } |
| 324 | + |
| 325 | + /** |
| 326 | + * Returns if the campaign is enabled. |
| 327 | + * |
| 328 | + * @since 1.2 |
| 329 | + * |
| 330 | + * @return boolean |
| 331 | + */ |
| 332 | + public function getIsEnabled() { |
| 333 | + return $this->isEnabled; |
| 334 | + } |
| 335 | + |
| 336 | + /** |
| 337 | + * Sets all config properties. |
| 338 | + * |
| 339 | + * @since 1.2 |
| 340 | + * |
| 341 | + * @param array $config |
| 342 | + */ |
| 343 | + public function setConfig( array $config ) { |
| 344 | + $this->config = $config; |
| 345 | + } |
| 346 | + |
| 347 | + /** |
| 348 | + * Returns all config properties. |
| 349 | + * |
| 350 | + * @since 1.2 |
| 351 | + * |
| 352 | + * @return array |
| 353 | + */ |
| 354 | + public function getConfig() { |
| 355 | + return $this->config; |
| 356 | + } |
| 357 | + |
| 358 | + /** |
| 359 | + * Returns the value of the specified config property. |
| 360 | + * |
| 361 | + * @since 1.2 |
| 362 | + * |
| 363 | + * @param string $property |
| 364 | + * |
| 365 | + * @return mixed |
| 366 | + */ |
| 367 | + public function getProperty( $property ) { |
| 368 | + global $wgUploadWizardConfig; |
| 369 | + |
| 370 | + if ( array_key_exists( $property, $this->config ) ) { |
| 371 | + return $this->config[$property]; |
| 372 | + } |
| 373 | + elseif ( array_key_exists( $property, $wgUploadWizardConfig['campaignDefaults'] ) ) { |
| 374 | + return $wgUploadWizardConfig['campaignDefaults'][$property]; |
| 375 | + } |
| 376 | + else { |
| 377 | + return null; |
| 378 | + } |
| 379 | + } |
| 380 | + |
| 381 | + /** |
| 382 | + * Set the value of a config property. |
| 383 | + * |
| 384 | + * @since 1.2 |
| 385 | + * |
| 386 | + * @param string $property |
| 387 | + * @param mixed $value |
| 388 | + */ |
| 389 | + public function setProperty( $property, $value ) { |
| 390 | + $this->config[$property] = $value; |
| 391 | + } |
| 392 | + |
| 393 | + /** |
| 394 | + * Write the campaign to the DB. |
| 395 | + * If it's already there, it'll be updated, else it'll be inserted. |
| 396 | + * |
| 397 | + * @since 1.2 |
| 398 | + * |
| 399 | + * @return boolean Success indicator |
| 400 | + */ |
| 401 | + public function writeToDB() { |
| 402 | + if ( is_null( $this->id ) ) { |
| 403 | + return $this->insertIntoDB(); |
| 404 | + } |
| 405 | + else { |
| 406 | + return $this->updateInDB(); |
| 407 | + } |
| 408 | + } |
| 409 | + |
| 410 | + /** |
| 411 | + * Insert the campaign into the DB. |
| 412 | + * |
| 413 | + * @since 1.2 |
| 414 | + * |
| 415 | + * @return boolean Success indicator |
| 416 | + */ |
| 417 | + protected function insertIntoDB() { |
| 418 | + $dbw = wfGetDB( DB_MASTER ); |
| 419 | + |
| 420 | + $success = $dbw->insert( |
| 421 | + 'uw_campaigns', |
| 422 | + array( |
| 423 | + 'campaign_name' => $this->name, |
| 424 | + 'campaign_enabled' => $this->isEnabled, |
| 425 | + ), |
| 426 | + array( 'campaign_id' => $this->id ) |
| 427 | + ); |
| 428 | + |
| 429 | + if ( $success ) { |
| 430 | + $this->id = $dbr->insertId(); |
| 431 | + $success &= $this->writePropsToDB( $dbw ); |
| 432 | + } |
| 433 | + |
| 434 | + return $success; |
| 435 | + } |
| 436 | + |
| 437 | + /** |
| 438 | + * Update the campaign in the DB. |
| 439 | + * |
| 440 | + * @since 1.2 |
| 441 | + * |
| 442 | + * @return boolean Success indicator |
| 443 | + */ |
| 444 | + protected function updateInDB() { |
| 445 | + $dbw = wfGetDB( DB_MASTER ); |
| 446 | + |
| 447 | + $success = $dbw->update( |
| 448 | + 'uw_campaigns', |
| 449 | + array( |
| 450 | + 'campaign_name' => $this->name, |
| 451 | + 'campaign_enabled' => $this->isEnabled, |
| 452 | + ), |
| 453 | + array( 'campaign_id' => $this->id ) |
| 454 | + ); |
| 455 | + |
| 456 | + // Delete and insert instead of update. |
| 457 | + // This will not result into dead-data when config vars are removed. |
| 458 | + $success &= $dbw->delete( |
| 459 | + 'uw_campaign_conf', |
| 460 | + array( 'cc_campaign_id' => $this->id ) |
| 461 | + ); |
| 462 | + |
| 463 | + $success &= $this->writePropsToDB( $dbw ); |
| 464 | + |
| 465 | + return $success; |
| 466 | + } |
| 467 | + |
| 468 | + /** |
| 469 | + * Write (insert) the properties into the DB. |
| 470 | + * |
| 471 | + * @since 1.2 |
| 472 | + * |
| 473 | + * @param Database $dbw |
| 474 | + * |
| 475 | + * @return boolean Success indicator |
| 476 | + */ |
| 477 | + protected function writePropsToDB( Database $dbw ) { |
| 478 | + $success = true; |
| 479 | + |
| 480 | + foreach ( $this->config as $prop => $value ) { |
| 481 | + $success &= $dbw->insert( |
| 482 | + 'uw_campaign_conf', |
| 483 | + array( |
| 484 | + 'cc_campaign_id' => $this->id, |
| 485 | + 'cc_property' => $prop, |
| 486 | + 'cc_value' => $value |
| 487 | + ) |
| 488 | + ); |
| 489 | + } |
| 490 | + |
| 491 | + return $success; |
| 492 | + } |
| 493 | + |
| 494 | + /** |
| 495 | + * Delete the campaign from the DB (when present). |
| 496 | + * |
| 497 | + * @since 1.2 |
| 498 | + * |
| 499 | + * @return boolean Success indicator |
| 500 | + */ |
| 501 | + public function deleteFromDB() { |
| 502 | + if ( is_null( $this->id ) ) { |
| 503 | + return true; |
| 504 | + } |
| 505 | + |
| 506 | + $dbw = wfGetDB( DB_MASTER ); |
| 507 | + |
| 508 | + $d1 = $dbw->delete( |
| 509 | + 'uw_campaigns', |
| 510 | + array( 'campaign_id' => $this->id ) |
| 511 | + ); |
| 512 | + |
| 513 | + $d2 = $dbw->delete( |
| 514 | + 'uw_campaign_conf', |
| 515 | + array( 'cc_campaign_id' => $this->id ) |
| 516 | + ); |
| 517 | + |
| 518 | + return $d1 && $d2; |
| 519 | + } |
| 520 | + |
| 521 | +} |
Index: trunk/extensions/UploadWizard/UploadWizard.config.php |
— | — | @@ -285,5 +285,10 @@ |
286 | 286 | |
287 | 287 | // URL for alternative uploading form |
288 | 288 | 'altUploadForm' => '', |
| 289 | + |
| 290 | + 'campaignDefaults' => array( |
| 291 | + 'skiptutorial' => false, |
| 292 | + |
| 293 | + ), |
289 | 294 | |
290 | 295 | ); |
Index: trunk/extensions/UploadWizard/UploadWizardHooks.php |
— | — | @@ -385,4 +385,52 @@ |
386 | 386 | } |
387 | 387 | return true; |
388 | 388 | } |
| 389 | + |
| 390 | + /** |
| 391 | + * Schema update to set up the needed database tables. |
| 392 | + * |
| 393 | + * @since 1.2 |
| 394 | + * |
| 395 | + * @param DatabaseUpdater $updater |
| 396 | + * |
| 397 | + * @return true |
| 398 | + */ |
| 399 | + public static function onSchemaUpdate( /* DatabaseUpdater */ $updater = null ) { |
| 400 | + $updater->addExtensionUpdate( array( |
| 401 | + 'addTable', |
| 402 | + 'uw_campaigns', |
| 403 | + dirname( __FILE__ ) . '/UploadWizard.sql', |
| 404 | + true |
| 405 | + ) ); |
| 406 | + $updater->addExtensionUpdate( array( |
| 407 | + 'addTable', |
| 408 | + 'uw_campaign_conf', |
| 409 | + dirname( __FILE__ ) . '/UploadWizard.sql', |
| 410 | + true |
| 411 | + ) ); |
| 412 | + $updater->addExtensionUpdate( array( |
| 413 | + 'addIndex', |
| 414 | + 'uw_campaigns', |
| 415 | + 'uw_campaigns_name', |
| 416 | + dirname( __FILE__ ) . '/sql/UW_IndexCampaignsName.sql', |
| 417 | + true |
| 418 | + ) ); |
| 419 | + $updater->addExtensionUpdate( array( |
| 420 | + 'addIndex', |
| 421 | + 'uw_campaign_conf', |
| 422 | + 'uw_cc_id_property', |
| 423 | + dirname( __FILE__ ) . '/sql/UW_IndexConfIdProp.sql', |
| 424 | + true |
| 425 | + ) ); |
| 426 | + $updater->addExtensionUpdate( array( |
| 427 | + 'addIndex', |
| 428 | + 'uw_campaign_conf', |
| 429 | + 'uw_cc_property', |
| 430 | + dirname( __FILE__ ) . '/sql/UW_IndexConfProp.sql', |
| 431 | + true |
| 432 | + ) ); |
| 433 | + |
| 434 | + return true; |
| 435 | + } |
| 436 | + |
389 | 437 | } |
Index: trunk/extensions/UploadWizard/sql/UW_IndexCampaignsName.sql |
— | — | @@ -0,0 +1 @@ |
| 2 | +CREATE UNIQUE INDEX /*i*/uw_campaigns_name ON /*_*/uw_campaigns (campaign_name); |
\ No newline at end of file |
Property changes on: trunk/extensions/UploadWizard/sql/UW_IndexCampaignsName.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 3 | + native |
Index: trunk/extensions/UploadWizard/sql/UW_IndexConfIdProp.sql |
— | — | @@ -0,0 +1 @@ |
| 2 | +CREATE UNIQUE INDEX /*i*/uw_cc_id_property ON /*_*/uw_campaign_conf (cc_campaign_id,cc_property); |
\ No newline at end of file |
Property changes on: trunk/extensions/UploadWizard/sql/UW_IndexConfIdProp.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 3 | + native |
Index: trunk/extensions/UploadWizard/sql/UW_IndexConfProp.sql |
— | — | @@ -0,0 +1 @@ |
| 2 | +CREATE INDEX /*i*/uw_cc_property ON /*_*/uw_campaign_conf (cc_property); |
\ No newline at end of file |
Property changes on: trunk/extensions/UploadWizard/sql/UW_IndexConfProp.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 3 | + native |
Index: trunk/extensions/UploadWizard/UploadWizard.sql |
— | — | @@ -0,0 +1,17 @@ |
| 2 | +-- MySQL version of the database schema for the Upload Wizard extension. |
| 3 | +-- Licence: GNU GPL v3+ |
| 4 | +-- Author: Jeroen De Dauw < jeroendedauw@gmail.com > |
| 5 | + |
| 6 | +-- Upload wizard campaigns |
| 7 | +CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/uw_campaigns ( |
| 8 | + campaign_id SMALLINT unsigned NOT NULL auto_increment PRIMARY KEY, |
| 9 | + campaign_name VARCHAR(255) NOT NULL, |
| 10 | + campaign_enabled TINYINT NOT NULL default '0' |
| 11 | +) /*$wgDBTableOptions*/; |
| 12 | + |
| 13 | +-- Upload wizard campaign config |
| 14 | +CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/uw_campaign_conf ( |
| 15 | + cc_campaign_id SMALLINT unsigned NOT NULL auto_increment PRIMARY KEY, |
| 16 | + cc_property VARCHAR(255) NULL, |
| 17 | + cc_value BLOB NULL |
| 18 | +) /*$wgDBTableOptions*/; |
Property changes on: trunk/extensions/UploadWizard/UploadWizard.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 19 | + native |
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php |
— | — | @@ -271,8 +271,19 @@ |
272 | 272 | 'mwe-upwiz-feedback-adding' => 'Adding feedback to page...', |
273 | 273 | 'mwe-upwiz-feedback-error1' => 'Error: Unrecognized result from API', |
274 | 274 | 'mwe-upwiz-feedback-error2' => 'Error: Edit failed', |
275 | | - 'mwe-upwiz-feedback-error3' => 'Error: No response from API' |
| 275 | + 'mwe-upwiz-feedback-error3' => 'Error: No response from API', |
276 | 276 | |
| 277 | + // Special:UploadCampaigns |
| 278 | + 'mwe-upwiz-campaigns-name' => 'Campaign name', |
| 279 | + 'mwe-upwiz-campaigns-status' => 'Status', |
| 280 | + 'mwe-upwiz-campaigns-enabled' => 'Enabled', |
| 281 | + 'mwe-upwiz-campaigns-disabled' => 'Disabled', |
| 282 | + 'mwe-upwiz-campaigns-edit' => 'Edit', |
| 283 | + 'mwe-upwiz-campaigns-add' => 'Add', |
| 284 | + 'mwe-upwiz-campaigns-addnew' => 'Add a new campaign', |
| 285 | + 'mwe-upwiz-campaigns-newname' => 'Campaign name: ', |
| 286 | + 'mwe-upwiz-campaigns-namedoc' => 'The name of the campaign is the identifier used in URLs. ie "name" in ?campaign=name', |
| 287 | + 'mwe-upwiz-campaigns-existing' => 'Existing campaigns', |
277 | 288 | ); |
278 | 289 | |
279 | 290 | /** Message documentation (Message documentation) |