- Timestamp:
- 10/11/2010 03:13:22 PM (20 months ago)
- Location:
- trunk/w
- Files:
-
- 2 edited
-
LocalSettings.php (modified) (1 diff)
-
extensions/Flash.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/w/LocalSettings.php
r1847 r1851 198 198 $wgEnableUploads = true; 199 199 $wgUploadBaseUrl = $wgServer; 200 $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc', 'pdf', 'xls', 'ppt', 'docx','xlsx','pptx','zip','svg','mpp' );200 $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc', 'pdf', 'xls', 'ppt', 'docx','xlsx','pptx','zip','svg','mpp','swf'); 201 201 202 202 # Workaround for file upload corruption issue. -
trunk/w/extensions/Flash.php
r103 r1851 1 1 <?php 2 2 3 3 /* 4 4 * This program is free software; you can redistribute it and/or modify … … 14 14 * You should have received a copy of the GNU General Public License 15 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA w16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 * 18 * Parts of the program use the file 'Image.php' from the MediaWiki project. The respective source can be acquired from http:// wikipedia.sourceforge.net/.18 * Parts of the program use the file 'Image.php' from the MediaWiki project. The respective source can be acquired from http://svn.wikimedia.org/. 19 19 * 20 20 * @author <marius.treitz@i-u.de> … … 22 22 * A small patch by an unknown author has been applied to fix the flashvars attribute input. 23 23 */ 24 24 25 //Extension credits that show up on Special:Version 26 $wgExtensionCredits['parserhook'][] = array( 27 'name' => 'Flash', 28 'author' => 'Marius Treitz', 29 'description' => 'Allows the display of flash movies within a wiki with the <tt><flash></tt> tag', 30 'url' => 'http://www.mediawiki.org/wiki/Extension:Flash', 31 'version' => '1.0', 32 ); 33 25 34 $wgExtensionFunctions[] = "wfFlashExtension"; 26 27 35 28 36 /* 29 37 * The Flash class generates code in order to implement a flash object. … … 35 43 Flash::genCode(); // Generate the final code 36 44 } 37 45 38 46 /* Parser */ 39 47 function parseInput( $input ) { 40 48 for($pos=0; $pos<strlen($input); $pos++) { // go through all arguments 41 if($input{$pos}=='=') { // separator between command42 //ignore '=' if the attribute is flashvars43 //this will enable to pass query string to flash files44 if($gotflashvars) {45 $this->tmp .= $input{$pos};46 continue;47 }49 if($input{$pos}=='=') { // separator between command 50 //ignore '=' if the attribute is flashvars 51 //this will enable to pass query string to flash files 52 if($gotflashvars) { 53 $this->tmp .= $input{$pos}; 54 continue; 55 } 48 56 $this->instr = $this->tmp; 49 $this->tmp = '';50 //set the flag for flashvars51 if($this->instr == 'flashvars') $gotflashvars = 1;57 $this->tmp = ''; 58 //set the flag for flashvars 59 if($this->instr == 'flashvars') $gotflashvars = 1; 52 60 } 53 else if($input{$pos}=='|') { // separator between arguments54 //reset the flags for other attributes55 if($gotflashvars) $gotflashvars = 0;61 else if($input{$pos}=='|') { // separator between arguments 62 //reset the flags for other attributes 63 if($gotflashvars) $gotflashvars = 0; 56 64 Flash::setValue(); 57 65 $this->tmp=''; … … 62 70 if($this->tmp!='') Flash::setValue(); // Deal with the rest of the input string 63 71 } 64 72 65 73 /* Coordinate commands with values */ 66 74 function setValue() { … … 87 95 } 88 96 } 89 97 90 98 /* Generate big, final chunk of code */ 91 99 function genCode() { … … 93 101 $allowscriptaccess = 'false'; // allow / disallow scripts 94 102 $swliveconnect = 'false'; // start / do not start up java 95 103 96 104 // Default version Setting: 97 105 $this->version='7,0,0,0'; // Version settings for <object> 98 $this->url = $this->getTitle($this->file);//Flash::imageUrl( $this->file, $this->fromSharedDirectory ); // get Wiki internal url99 100 // if flashvars is set append to the url101 if($this->flashvars) $this->url .= $this->flashvars;102 106 $this->url = $this->getTitle($this->file);//Flash::imageUrl( $this->file, $this->fromSharedDirectory ); // get Wiki internal url 107 108 // if flashvars is set append to the url 109 if($this->flashvars) $this->url .= $this->flashvars; 110 103 111 /* Final Code */ 104 $this->code = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="' . $this->width . '" height="' . $this->height . '" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' . $this->version . '"><param name="movie" value="' . $this->url . '">' . $this->codeObject . '<embed src="' . $this->url . '" width="' . $this->width . '" height="' . $this->height . '"' . $this->codeEmbed . ' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object>';112 $this->code = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="' . $this->width . '" height="' . $this->height . '" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' . $this->version . '"><param name="movie" value="' . $this->url . '">' . $this->codeObject . '<embed src="' . $this->url . '" width="' . $this->width . '" height="' . $this->height . '"' . $this->codeEmbed . ' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object>'; 105 113 return $this->code; 106 114 } … … 118 126 function renderFlash( $input ) { 119 127 global $code; 120 128 121 129 // Constructor 122 130 $flashFile = new Flash( $input ); 123 131 $code = $flashFile->code; 124 132 125 133 return $code; // send the final code to the wiki 126 134 } 127 135 128 ?>
Note: See TracChangeset
for help on using the changeset viewer.
