Skip to content

Commit

Permalink
added optional "&theme=le-frog" cgi-arg type ability to override the …
Browse files Browse the repository at this point in the history
…default "redmond" theme. added hook and check for archive.org assets to setup the $_REQUEST

git-svn-id: http://www.kaltura.org/kalorg/html5video/trunk/mwEmbed@1255 b58a29cf-3064-46da-94c6-1c29cc75c8e5
  • Loading branch information
traceypooh committed Dec 1, 2010
1 parent 052e81e commit a85c8a5
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions mwEmbedFrame.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class mwEmbedFrame {
);
var $playerIframeId = 'iframeVid';
var $debug = false;
var $theme = 'redmond';


// When used in direct source mode the source asset.
// NOTE: can be an array of sources in cases of "many" sources set
Expand All @@ -58,9 +60,13 @@ function __construct(){
//parse input:
$this->parseRequest();
}

// Parse the embedFrame request and sanitize input
private function parseRequest(){
if( isset($_REQUEST['iaid']) && include('/petabox/setup.inc') ){
Video::mwEmbedSetup(); // archive.org media
}

// Check for / attribute type request and update "REQUEST" global
// ( uses kaltura standard entry_id/{entryId} request )
// normalize to the REQUEST object
Expand Down Expand Up @@ -89,6 +95,14 @@ private function parseRequest(){
}
}

// Check for non-default theme.
if( isset( $_REQUEST['theme'] ) &&
in_array($_REQUEST['theme'],
array('darkness','le-frog', 'redmond','start',
'sunny')) ){
$this->theme = $_REQUEST['theme'];
}

// Check for debug flag
if( isset( $_REQUEST['debug'] ) ){
$this->debug = true;
Expand Down Expand Up @@ -129,7 +143,7 @@ private function getVideoTag( ){

function outputIFrame( ){
// Setup the embed string based on attribute set:
$embedResourceList = 'window.jQuery,mwEmbed,mw.style.mwCommon,$j.fn.menu,mw.style.jquerymenu,mw.EmbedPlayer,mw.EmbedPlayerNative,mw.EmbedPlayerJava,mw.PlayerControlBuilder,$j.fn.hoverIntent,mw.style.EmbedPlayer,$j.cookie,$j.ui,mw.style.ui_redmond,$j.widget,$j.ui.mouse,mw.PlayerSkinKskin,mw.style.PlayerSkinKskin,mw.TimedText,mw.style.TimedText,$j.ui.slider';
$embedResourceList = 'window.jQuery,mwEmbed,mw.style.mwCommon,$j.fn.menu,mw.style.jquerymenu,mw.EmbedPlayer,mw.EmbedPlayerNative,mw.EmbedPlayerJava,mw.PlayerControlBuilder,$j.fn.hoverIntent,mw.style.EmbedPlayer,$j.cookie,$j.ui,mw.style.ui_'.$this->theme.',$j.widget,$j.ui.mouse,mw.PlayerSkinKskin,mw.style.PlayerSkinKskin,mw.TimedText,mw.style.TimedText,$j.ui.slider';

if( isset( $this->kentryid ) ){
$embedResourceList.= ',' . implode(',', array(
Expand Down Expand Up @@ -191,7 +205,6 @@ function outputIFrame( ){
});
});
</script>

</head>
<body>
<?
Expand Down

0 comments on commit a85c8a5

Please sign in to comment.