Documentation:UBC Wiki UploadWizard Modifications

From UBC Wiki

Several modifications were required for UBC specific requirements.

changes indicated by:

/* CTLT MODIFY START */ 

and

/* CTLT MODIFY ADD */ 

Templates are located here:

http://wiki.ubc.ca/Category:Creative_Commons_License_Templates

and

http://wiki.ubc.ca/Category:Copyright_License_Templates

Custom Tutorial image


The following files were modified:

UploadWizardHooks.php

'messages' => array(
                                /* CTLT MODIFY START */
                                // ADD HOOKS
                                'mwe-upwiz-license-cdngov-head',
                                'mwe-upwiz-license-cc-by-2.5-ca',
                                'mwe-upwiz-license-cc-by-sa-2.5-ca',
                                'mwe-upwiz-license-cr-cdn-gov',
                                'mwe-upwiz-license-cr-cdn-exp-head',
                                'mwe-upwiz-license-cr-cdn-exp',
                                'mwe-upwiz-license-ubc-head',
                                'mwe-upwiz-license-cr-ubc',
                                /*CTLT MODIFY END */



UploadWizard.config.php

added additional licenses

/* CTLT ADD START */
                //Add Canadian Licenses
                // 2.5 Attribution Canada
                'cc-by-2.5-ca' => array(
                        'msg' => 'mwe-upwiz-license-cc-by-2.5-ca',
                        'icons' => array( 'cc-by'),
                        'templates' => array( 'cc-by-2.5-ca' )
                ),

                // 2.5 SA Canada
                 'cc-by-sa-2.5-ca' => array(
                        'msg' => 'mwe-upwiz-license-cc-by-sa-2.5-ca',
                        'icons' => array( 'cc-by', 'cc-by-sa'),
                        'templates' => array( 'cc-by-sa-2.5-ca' )
                ),

                // Copyright Canadian Gov
                'cr-cdn-gov' => array(
                        'msg' => 'mwe-upwiz-license-cr-cdn-gov',
                        //'icons' => array( 'cc-by'),
                        'templates' => array( 'cr-cdn-gov' )
                ),

                // Expired Canada
                'cr-cdn-exp' => array(
                        'msg' => 'mwe-upwiz-license-cr-cdn-exp',
                        'templates' => array( 'cr-cdn-exp' )
                ),


                // UBC
                'cr-ubc' => array(
                        'msg' => 'mwe-upwiz-license-cr-ubc',
                        'templates' => array( 'cr-ubc' )
                ),

                /* CTLT ADD END */

added removed licensesOwnWork

'licensesOwnWork' => array(
                'type' => 'or',
                'filterTemplate' => 'self',
                /* CTLT MODIFY START */
                'licenses' => array(
                        'cc-by-sa-2.5-ca',
                        'cc-by-2.5-ca',
                        'cc',
                        //'cc-by-sa-3.0',
                        //'cc-by-3.0',
                        'own-pd'
                ),
                'defaults' => array( 'cc-by-sa-2.5-ca' )
                /* CTLT MODIFY END */
        ),


added removed licensesThirdParty

// checkbox selection of all licenses
        'licensesThirdParty' => array(
                'type' => 'and',
                'licenseGroups' => array(
                        array(
                                // This should be a list of all CC licenses we can reasonably expect to find around the web
                                'head' => 'mwe-upwiz-license-cc-head',
                                'subhead' => 'mwe-upwiz-license-cc-subhead',
                                'licenses' => array(
                                        'cc-by-sa-2.5-ca',
                                        'cc-by-2.5-ca',
                                        'cc-by-sa-3.0',
                                        'cc-by-sa-2.5',
                                        'cc-by-3.0',
                                        'cc-by-2.5',
                                        'cc-zero'
                                )
                        ),
                        /* CTLT MODIFY START */
                        /*
                        array(
                                // n.b. as of April 2011, Flickr still uses CC 2.0 licenses.
                                // The White House also has an account there, hence the Public Domain US Government license
                                'head' => 'mwe-upwiz-license-flickr-head',
                                'subhead' => 'mwe-upwiz-license-flickr-subhead',
                                'prependTemplates' => array( 'flickrreview' ),
                                'licenses' => array(
                                        'cc-by-sa-2.0',
                                        'cc-by-2.0',
                                        'pd-usgov',
                                )
                        ),
                        */
                        /* CTLT MODIFY END */


                        /* CTLT MODIFY START */
                        /*
                        array(
                                'head' => 'mwe-upwiz-license-public-domain-head',
                                'licenses' => array(
                                        'pd-old-100',
                                        'pd-old',
                                        'pd-art',
                                        'pd-us',
                                )
                        ),
                        */
                        /* CTLT MODIFY END */

 /* CTLT MODIFY START */

 /*
                        array(
                                'head' => 'mwe-upwiz-license-public-domain-head',
                                'licenses' => array(
                                        'pd-old-100',
                                        'pd-old',
                                        'pd-art',
                                        'pd-us',
                                )
                        ),
                        */
                        /* CTLT MODIFY END */


                        /* CTLT MODIFY START */
                        // Disable the US GOV options.
                        /*
                        array(
                                // omitted navy because it is believed only MultiChil uses it heavily. Could add it back
                                'head' => 'mwe-upwiz-license-usgov-head',
                                'licenses' => array(
                                        'pd-usgov',
                                        'pd-usgov-nasa'
                                )
                        ),
                        */
                        /* CTLT MODIFY END */

                        /* CTLT MODIFY START */
                        // Canadian Gov license
                        array(
                                'head' => 'mwe-upwiz-license-cdngov-head',
                                'licenses' => array(
                                        'cr-cdn-gov'
                                )
                        ),
                        /* CTLT MODIFY END */

                         /* CTLT MODIFY START */
                        // Expire Canadian Public Domain
                        array(
                                'head' => 'mwe-upwiz-license-cr-cdn-exp-head',
                                'licenses' => array(
                                        'cr-cdn-exp'
                                )
                        ),
                        /* CTLT MODIFY END */

      /* CTLT MODIFY START */
                        // UBC license
                        array(
                                'head' => 'mwe-upwiz-license-ubc-head',
                                'licenses' => array(
                                        'cr-ubc'
                                )
                        ),
                        /* CTLT MODIFY END */



                        /* CTLT MODIFY START */
                        // discable misc option
                        /*
                        array(
                                'head' => 'mwe-upwiz-license-misc',
                                'licenses' => array(
                                        'fal'
                                )
                        ),
                        */
                        /* CTLT MODIFY END */

                        array(
                                'head' => 'mwe-upwiz-license-none-applicable-head',
                                'subhead' => 'mwe-upwiz-license-none-applicable-subhead',
                                'special' => 'delete'
                        )
                ),
                'defaults' => array(),
        ),



UploadWizard.i18n.php

changed from file to donate to upload.

 /* CTLT MODIFY START */
  //Changed donate to upload
   'mwe-upwiz-add-file-0-free' => 'Select a media file to upload',
 /* CTLT MODIFY END */
/* CTLT ADD START */
  'mwe-upwiz-source-ownwork' => 'I am the sole copyright holder in this work.',
/* CTLT ADD END */
/* CTLT ADD START */
 'mwe-upwiz-source-ownwork-assert' => 'I, $2, the sole copyright holder of this work, irrevocably grant any the right to use this work under a Creative Commons Attribution-ShareAlike 2.5 Canada License (<a href="http://creativecommons.org/licenses/by-sa/2.5/ca/">legal code</a>)',
 /* CTLT ADD END */
 /* CTLT ADD START */
 //'mwe-upwiz-source-thirdparty' => '{{PLURAL:$1|This file is|These files are}} not my own work.',
   'mwe-upwiz-source-thirdparty' => 'Someone else holds the copyright in this work OR I hold copyright in this work jointly with others.', 
/* CTLT ADD END */
 /* CTLT ADD START */
 'mwe-upwiz-license-cc-by-2.5-ca' => 'Creative Commons Attribution 2.5 Canada (<a href="http://creativecommons.org/licenses/by/2.5/ca/">legal code</a>)',
 'mwe-upwiz-license-cc-by-sa-2.5-ca' => 'Creative Commons Attribution ShareAlike 2.5 Canada (<a href="http://creativecommons.org/licenses/by-sa/2.5/ca/">legal code</a>)',
 /* CTLT ADD END */
/* CTLT MODIFY START */
 
// ADD Canadian Gov
 'mwe-upwiz-license-cdngov-head' => 'The work was created by the Government of Canada, is under Crown Copyright, and a requirement for permission to reproduce is not specified in the material.',
  'mwe-upwiz-license-cr-cdn-gov' => 'This is an original work of the Government of Canada.',
 // Canadian Expired
 'mwe-upwiz-license-cr-cdn-exp-head' => 'The copyright for this work has definitely expired in Canada. (see http://copyright.ubc.ca for more information about public domain)',
 'mwe-upwiz-license-cr-cdn-exp' => 'I understand that if the file is determined to not be in the public domain, it will be deleted.',
  // UBC licence
  'mwe-upwiz-license-ubc-head' => 'The copyright for this work is owned by UBC.',
  'mwe-upwiz-license-cr-ubc' => 'I have indicated the UBC copyright holder in the source above.',
  
/* CTLT MODIFY END */

 /* CTLT MODIFY START */
//'mwe-upwiz-license-cc-head' => 'The copyright holder published {{PLURAL:$1|this work|these works}} with the right Creative Commons license',
'mwe-upwiz-license-cc-head' => 'The copyright holders of this file grants permission for its use through a Creative Commons license, and the uploading and use of this file in UBC Wiki is compliant with the license terms (select specific license):',
 /* CTLT MODIFY END */

includes/UploadWizardTutorial.php

The extension was pulling the Tutorial overview image from Mediacommons we had to hard code a modified version of that uploaded to the wiki.

  public static function getImageHtml( MediaTransformOutput $thumb, $campaign = null ) {
                $helpDeskUrl = wfMsg( 'mwe-upwiz-help-desk-url' );

                /* CTLT MODIFY START */
                // Pull UBC Copyright Tutorial disable mediacommons
                # ADD a hardcode link to the copyright site:
                $helpDeskHref = "http://copyright.ubc.ca";

                // Per convention, we may be either using an absolute URL or a wiki page title in this UI message
                /*
                if( preg_match( '/^(?:' . wfUrlProtocols() . ')/', $helpDeskUrl )) {
                        $helpDeskHref = $helpDeskUrl;
                } else {
                        $helpDeskTitle = Title::newFromText( $helpDeskUrl );
                        $helpDeskHref = $helpDeskTitle ? $helpDeskTitle->getLocalURL() : '#';
                }
                */
                /* CTLT MODIFY END */

$imgAttributes = array(
                         /* CTLT MODIFY START */
                        // Pull UBC Copyright Tutorial disable mediacommons
                        'src' => 'http://wiki.ubc.ca/images/b/be/Ubc_copyright_tutorial.png',
                        /* CTLT MODIFY END */
                        'width' => $thumb->getWidth(),
                        'height' => $thumb->getHeight(),
                );


i18n/qqq.json - the link to copy rights tag is broken removed the parser variables.

 /* CTLT START  */
 //"mwe-upwiz-license-custom": "Parameters:\n* $1 - (Unused)\n* $2 - full URL, {{msg-mw|mwe-upwiz-license-custom-url}}",
  "mwe-upwiz-license-custom": "{{msg-mw|mwe-upwiz-license-custom-url}}",
 /* CTLT END */


i18n/en.json - remove the parameter link directly to the Copyrights tag

//"mwe-upwiz-license-custom": "The license is described by the following wikitext (must contain a valid [$2  copyright tag]):",
"mwe-upwiz-license-custom": "The license is described by the following wikitext (must contain a valid [https://commons.wikimedia.org/wiki/Commons:Copyright_tags  copyright tag]):",