aboutsummaryrefslogtreecommitdiff
path: root/views/default/forms
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/forms')
-rw-r--r--views/default/forms/add.php322
-rw-r--r--views/default/forms/browsetube.php355
-rw-r--r--views/default/forms/labels/googlevideos.php60
-rw-r--r--views/default/forms/labels/metacafe.php60
-rw-r--r--views/default/forms/labels/vimeo.php60
-rw-r--r--views/default/forms/labels/youtube.php60
6 files changed, 444 insertions, 473 deletions
diff --git a/views/default/forms/add.php b/views/default/forms/add.php
index b387731f8..f6d5ed4c2 100644
--- a/views/default/forms/add.php
+++ b/views/default/forms/add.php
@@ -1,176 +1,156 @@
<?php
- /**
- * Elgg Video Plugin
- * This plugin allows users to create a library of youtube/vimeo/metacafe videos
- * @file - the add user interface
- * @package Elgg
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Prateek Choudhary <synapticfield@gmail.com>
- * @copyright Prateek Choudhary
- */
+/**
+ * Elgg Video Plugin
+ * This plugin allows users to create a library of youtube/vimeo/metacafe videos
+ * @file - the add user interface
+ * @package Elgg
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Prateek Choudhary <synapticfield@gmail.com>
+ * @copyright Prateek Choudhary
+ */
// Make sure we're logged in (send us to the front page if not)
- gatekeeper();
- $page_owner = page_owner_entity();
- $error = array(
- 'no-video' => 1
- );
- $error_msg = array(
- 'no-video' => "Please enter a valid video url"
- );
-
- $container_guid = get_input("container_guid");
- set_page_owner($container_guid);
-
- $confirm_action = get_input('video_action');
- $guid = get_input('guid');
- $access_id = get_input('access_id');
- $title_videourl = get_input('title_videourl');
- $Pagecontainer = get_input('page');
- $get_addvideourl = get_input('add_videourl');
- $timestamp = time();
- $token = generate_action_token(time());
- if(!empty($get_addvideourl) && ($Pagecontainer == "youtube"))
- $title_add_videourl = "http://www.youtube.com/watch?v=".$get_addvideourl;
- else if(!empty($get_addvideourl) && ($Pagecontainer == "metacafe"))
- $title_add_videourl = "http://www.metacafe.com/api/item/".$get_addvideourl;
- else if(!empty($get_addvideourl) && ($Pagecontainer == "vimeo"))
- $title_add_videourl = "http://vimeo.com/".$get_addvideourl;
- else
- $title_add_videourl = "";
-
-
- $tags = get_input('videolisttags');
-
- function video_youtube_parse_url($url)
- {
- if (!preg_match('/(http:\/\/)([a-zA-Z]{2,3}\.)(youtube\.com\/)(.*)/', $url, $matches))
- {
- return false;
- }
-
- $domain = $matches[2] . $matches[3];
- $path = $matches[4];
-
- if (!preg_match('/^(watch\?v=)([a-zA-Z0-9_-]*)(&.*)?$/',$path, $matches))
- {
- return false;
- }
-
- $hash = $matches[2];
-
-
- return $domain . 'v/' . $hash;
- }
-
- function video_vimeo_parse_url($url)
- {
- if (!preg_match('/(http:\/\/)([a-zA-Z]{2,3}\.)(vimeo\.com\/)(.*)/', $url, $matches))
- {
- return false;
- }
-
- $domain = $matches[2] . $matches[3];
- $path = $matches[4];
-
- $hash = $matches[2];
-
-
- return $domain . '/' . $hash;
- }
-
- function video_metacafe_parse_url($url)
- {
- if (!preg_match('/(http:\/\/)([a-zA-Z]{2,3}\.)(metacafe\.com\/)(.*)/', $url, $matches))
- {
- return false;
- }
-
- $domain = $matches[2] . $matches[3];
- $path = $matches[4];
-
- $hash = $matches[2];
-
-
- return $domain . '/' . $hash;
- }
-
- if(isset($confirm_action) && ($confirm_action == 'add_video'))
- {
- if(isset($title_videourl) && ($title_videourl != ''))
- {
- if($Pagecontainer != "youtube" || $Pagecontainer != "vimeo" || $Pagecontainer != "metacafe"){
- if(preg_match("/youtube/i", $title_videourl))
- $Pagecontainer = "youtube";
- if(preg_match("/vimeo/i", $title_videourl))
- $Pagecontainer = "vimeo";
- if(preg_match("/metacafe/i", $title_videourl))
- $Pagecontainer = "metacafe";
- }
- if($Pagecontainer == "youtube")
- $is_valid_video = video_youtube_parse_url($title_videourl);
- else if($Pagecontainer == "vimeo"){
- $is_valid_video = video_vimeo_parse_url($title_videourl);
- $is_valid_video = $get_addvideourl;
- }
- else if($Pagecontainer == "metacafe"){
- $is_valid_video = video_metacafe_parse_url($title_videourl);
- $is_valid_video = $get_addvideourl;
- }
- if($is_valid_video)
- {
- $error['no-video'] = 1;
- $_SESSION['candidate_profile_video'] = $is_valid_video;
- $_SESSION['candidate_profile_video_access_id'] = $access_id;
- $_SESSION['videolisttags'] = $tags;
- $_SESSION['Pagecontainer'] = $Pagecontainer;
- $_SESSION['container_guid'] = $container_guid;
- //echo $_SESSION['candidate_profile_video'];
- $url = "action/videolist/addvideo?__elgg_ts={$timestamp}&__elgg_token={$token}";
- forward($url);
- }
- else
- $error['no-video'] = 0;
- }
- else
- {
- $error['no-video'] = 0;
+gatekeeper();
+$page_owner = page_owner_entity();
+$error = array(
+ 'no-video' => 1
+ );
+$error_msg = array(
+ 'no-video' => "Please enter a valid video url"
+ );
+
+$container_guid = get_input("container_guid");
+set_page_owner($container_guid);
+
+$confirm_action = get_input('video_action');
+$guid = get_input('guid');
+$access_id = get_input('access_id');
+$title_videourl = get_input('title_videourl');
+$Pagecontainer = get_input('page');
+$get_addvideourl = get_input('add_videourl');
+$timestamp = time();
+$token = generate_action_token(time());
+if (!empty($get_addvideourl) && ($Pagecontainer == "youtube")) {
+ $title_add_videourl = "http://www.youtube.com/watch?v=".$get_addvideourl;
+} else if(!empty($get_addvideourl) && ($Pagecontainer == "metacafe")) {
+ $title_add_videourl = "http://www.metacafe.com/api/item/".$get_addvideourl;
+} else if(!empty($get_addvideourl) && ($Pagecontainer == "vimeo")) {
+ $title_add_videourl = "http://vimeo.com/".$get_addvideourl;
+} else {
+ $title_add_videourl = "";
+}
+
+$tags = get_input('videolisttags');
+
+function video_youtube_parse_url($url) {
+ if (!preg_match('/(http:\/\/)([a-zA-Z]{2,3}\.)(youtube\.com\/)(.*)/', $url, $matches)) {
+ return false;
+ }
+
+ $domain = $matches[2] . $matches[3];
+ $path = $matches[4];
+
+ if (!preg_match('/^(watch\?v=)([a-zA-Z0-9_-]*)(&.*)?$/',$path, $matches)) {
+ return false;
+ }
+
+ $hash = $matches[2];
+ return $domain . 'v/' . $hash;
+}
+
+function video_vimeo_parse_url($url) {
+ if (!preg_match('/(http:\/\/)([a-zA-Z]{2,3}\.)(vimeo\.com\/)(.*)/', $url, $matches)) {
+ return false;
+ }
+
+ $domain = $matches[2] . $matches[3];
+ $path = $matches[4];
+
+ $hash = $matches[2];
+
+ return $domain . '/' . $hash;
+}
+
+function video_metacafe_parse_url($url) {
+ if (!preg_match('/(http:\/\/)([a-zA-Z]{2,3}\.)(metacafe\.com\/)(.*)/', $url, $matches)) {
+ return false;
+ }
+
+ $domain = $matches[2] . $matches[3];
+ $path = $matches[4];
+
+ $hash = $matches[2];
+
+ return $domain . '/' . $hash;
+}
+
+if(isset($confirm_action) && ($confirm_action == 'add_video')) {
+ if(isset($title_videourl) && ($title_videourl != '')) {
+ if($Pagecontainer != "youtube" || $Pagecontainer != "vimeo" || $Pagecontainer != "metacafe"){
+ if(preg_match("/youtube/i", $title_videourl)) {
+ $Pagecontainer = "youtube";
+ }
+
+ if(preg_match("/vimeo/i", $title_videourl)) {
+ $Pagecontainer = "vimeo";
+ }
+
+ if(preg_match("/metacafe/i", $title_videourl)) {
+ $Pagecontainer = "metacafe";
}
- }
-
-
-
- $body = '<div class="videolist-content">';
-
- $body .= '<form action="'.$_SERVER['php_self'].'" method="post">';
- $body .= elgg_view('input/hidden',array('internalname'=>'video_action', 'value'=>'add_video'));
- $body .= elgg_view('input/hidden',array('internalname'=>'guid', 'value'=>$vars['guid']));
-
-
- $body .= '<p><label>'.elgg_echo("videolist:title_videourl").'<br />';
- $body .= elgg_view("input/text",array('internalname' => 'title_videourl','value'=>$title_add_videourl));
- if($error['no-video'] == 0)
- {
- $body .= '<div class="error">'.$error_msg['no-video'].'</div>';
}
- $body .= '</label></p>';
-
- $body .= '<p><label>'.elgg_echo('videolist:tags');
- $body .= elgg_view('input/tags', array('internalname' => 'videolisttags', 'value' => $tags));
- $body .= '</label></p>';
-
- $body .= '<p><label>'.elgg_echo("videolist:title_access").'<br />';
- $body .= elgg_view('input/access',array('internalname'=>'access_id', 'value' => $access_id));
- $body .= '</label></p>';
- $body .= elgg_view('input/submit', array('internalname'=>'submit','value'=>elgg_echo('videolist:submit')));
- $body .= '</form>';
- $body .= '</div>';
-
- print $body."<br /><br />";
-
-
-?>
-
-<script type="text/javascript">
-
-</script>
+ if($Pagecontainer == "youtube") {
+ $is_valid_video = video_youtube_parse_url($title_videourl);
+ } else if($Pagecontainer == "vimeo") {
+ $is_valid_video = video_vimeo_parse_url($title_videourl);
+ $is_valid_video = $get_addvideourl;
+ } else if($Pagecontainer == "metacafe"){
+ $is_valid_video = video_metacafe_parse_url($title_videourl);
+ $is_valid_video = $get_addvideourl;
+ }
+
+ if($is_valid_video) {
+ $error['no-video'] = 1;
+ $_SESSION['candidate_profile_video'] = $is_valid_video;
+ $_SESSION['candidate_profile_video_access_id'] = $access_id;
+ $_SESSION['videolisttags'] = $tags;
+ $_SESSION['Pagecontainer'] = $Pagecontainer;
+ $_SESSION['container_guid'] = $container_guid;
+ //echo $_SESSION['candidate_profile_video'];
+ $url = "action/videolist/addvideo?__elgg_ts={$timestamp}&__elgg_token={$token}";
+ forward($url);
+ }
+ else
+ $error['no-video'] = 0;
+ }
+ else {
+ $error['no-video'] = 0;
+ }
+}
+
+$body = '<div class="videolist-content">';
+
+$body .= '<form action="'.$_SERVER['php_self'].'" method="post">';
+$body .= elgg_view('input/hidden',array('internalname'=>'video_action', 'value'=>'add_video'));
+$body .= elgg_view('input/hidden',array('internalname'=>'guid', 'value'=>$vars['guid']));
+
+
+$body .= '<p><label>'.elgg_echo("videolist:title_videourl").'<br />';
+$body .= elgg_view("input/text",array('internalname' => 'title_videourl','value'=>$title_add_videourl));
+if($error['no-video'] == 0) {
+ $body .= '<div class="error">'.$error_msg['no-video'].'</div>';
+}
+$body .= '</label></p>';
+
+$body .= '<p><label>'.elgg_echo('videolist:tags');
+$body .= elgg_view('input/tags', array('internalname' => 'videolisttags', 'value' => $tags));
+$body .= '</label></p>';
+
+$body .= '<p><label>'.elgg_echo("videolist:title_access").'<br />';
+$body .= elgg_view('input/access',array('internalname'=>'access_id', 'value' => $access_id));
+$body .= '</label></p>';
+$body .= elgg_view('input/submit', array('internalname'=>'submit','value'=>elgg_echo('videolist:submit')));
+$body .= '</form>';
+$body .= '</div>';
+
+print $body."<br /><br />";
diff --git a/views/default/forms/browsetube.php b/views/default/forms/browsetube.php
index 601fb4e6a..0a54f0d10 100644
--- a/views/default/forms/browsetube.php
+++ b/views/default/forms/browsetube.php
@@ -1,106 +1,105 @@
<?php
- /**
- * Elgg Video Plugin
- * This plugin allows users to create a library of youtube/vimeo/metacafe videos
- * @file - load the browse view
- * @package Elgg
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Prateek Choudhary <synapticfield@gmail.com>
- * @copyright Prateek Choudhary
- */
+/**
+ * Elgg Video Plugin
+ * This plugin allows users to create a library of youtube/vimeo/metacafe videos
+ * @file - load the browse view
+ * @package Elgg
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Prateek Choudhary <synapticfield@gmail.com>
+ * @copyright Prateek Choudhary
+ */
$getcontainer_guid = get_input("container");
$container_guid = explode(":", $getcontainer_guid);
if($container_guid[0] == "group"){
$container = $container_guid[1];
-}
-else{
+} else{
$container = $getcontainer_guid;
}
- $error = array(
- 'no-search' => 1
- );
- $error_msg = array(
- 'no-search' => "Please enter a valid search term"
- );
- $browseCat = get_input('q');
- if(empty($browseCat) || !isset($browseCat))
- $browseCat = "youtube";
- $confirm_action = get_input('video_action');
-
- if(isset($confirm_action) && ($confirm_action == 'search_video'))
- {
- if(isset($title_search) && ($title_search != ''))
- $error['no-search'] = 0;
- else
- $error['no-search'] = 1;
- }
+$error = array(
+ 'no-search' => 1
+ );
+$error_msg = array(
+ 'no-search' => "Please enter a valid search term"
+ );
+$browseCat = get_input('q');
+if(empty($browseCat) || !isset($browseCat)) {
+ $browseCat = "youtube";
+}
+
+$confirm_action = get_input('video_action');
+
+if(isset($confirm_action) && ($confirm_action == 'search_video')) {
+ if(isset($title_search) && ($title_search != '')) {
+ $error['no-search'] = 0;
+ } else {
+ $error['no-search'] = 1;
+ }
+}
+
+//$body = '<div class="videolist-content">';
+//Load youtube menu
+$body .= "<br /><div class=\"elgg_horizontal_tabbed_nav\">";
+$body .= "<ul id=\"videonav\">";
+$body .= "<li class=\"active\" id=\"YT\">";
+$body .= "<a href=\"".$vars['url']."pg/videolist/browse/".$getcontainer_guid."?q=youtube\">YouTube</a>";
+$body .= "</li>";
+$body .= "<li id=\"MC\">";
+$body .= "<a href=\"".$vars['url']."pg/videolist/browse/".$getcontainer_guid."?q=metacafe\">Metacafe</a>";
+$body .= "</li>";
+$body .= "<li id=\"VM\">";
+$body .= "<a href=\"".$vars['url']."pg/videolist/browse/".$getcontainer_guid."?q=vimeo\">Vimeo</a>";
+$body .= "</li>";
+/*
+$body .= "<li id=\"GV\">";
+$body .= "<a href=\"".$vars['url']."pg/videolist/browse?q=googlevideos\">Google Videos</a>";
+$body .= "</li>";
+*/
+$body .= "</ul>";
+$body .= "</div>";
+
+$body .= "<div class=\"clearfloat\"></div>";
+
+//$body .= "<div id=\"videosearch-interface\">";
+$body .= '<form action="javascript:sendSearchRequest(1);" method="get">';
+//$body .= "<form action=\"".$vars['url']."action/videolist/tubesearch\" method=\"get\">";
+$body .= elgg_view('input/hidden',array('internalname'=>'video_action', 'value'=>'search_video'));
+$body .= elgg_view('input/hidden',array('internalname'=>'guid', 'value'=>$vars['guid']));
+//$body .= elgg_view('input/hidden',array('internalname'=>'start_index', 'value'=>1));
+
+switch($browseCat) {
+ case "youtube" :
+ $body .= elgg_view('forms/labels/youtube');
+ break;
+ case "metacafe" :
+ $body .= elgg_view('forms/labels/metacafe');
+ break;
+ case "vimeo" :
+ $body .= elgg_view('forms/labels/vimeo');
+ break;
+ case "googlevideos" :
+ $body .= elgg_view('forms/labels/googlevideos');
+ break;
+ default :
+ $body .= elgg_view('forms/labels/youtube');
+ break;
+}
+$body .= elgg_view('input/hidden',array('internalname'=>'page', 'value'=>$browseCat));
+$body .= '</form>';
+//$body .= '</div>';
+//$body .= '</div>';
+
+$body .= '<div id="SearchContainer">';
+$body .= '<div id="loadingSearch">';
+$body .= '</div>';
+$body .= '<div id="responseSearch" align="center">';
+$body .= '</div>';
+$body .= '</div>';
+
+print $body."<br /><br />";
+
-
- //$body = '<div class="videolist-content">';
- //Load youtube menu
- $body .= "<br /><div class=\"elgg_horizontal_tabbed_nav\">";
- $body .= "<ul id=\"videonav\">";
- $body .= "<li class=\"active\" id=\"YT\">";
- $body .= "<a href=\"".$vars['url']."pg/videolist/browse/".$getcontainer_guid."?q=youtube\">YouTube</a>";
- $body .= "</li>";
- $body .= "<li id=\"MC\">";
- $body .= "<a href=\"".$vars['url']."pg/videolist/browse/".$getcontainer_guid."?q=metacafe\">Metacafe</a>";
- $body .= "</li>";
- $body .= "<li id=\"VM\">";
- $body .= "<a href=\"".$vars['url']."pg/videolist/browse/".$getcontainer_guid."?q=vimeo\">Vimeo</a>";
- $body .= "</li>";
- /*
- $body .= "<li id=\"GV\">";
- $body .= "<a href=\"".$vars['url']."pg/videolist/browse?q=googlevideos\">Google Videos</a>";
- $body .= "</li>";
- */
- $body .= "</ul>";
- $body .= "</div>";
-
- $body .= "<div class=\"clearfloat\"></div>";
-
- //$body .= "<div id=\"videosearch-interface\">";
- $body .= '<form action="javascript:sendSearchRequest(1);" method="get">';
- //$body .= "<form action=\"".$vars['url']."action/videolist/tubesearch\" method=\"get\">";
- $body .= elgg_view('input/hidden',array('internalname'=>'video_action', 'value'=>'search_video'));
- $body .= elgg_view('input/hidden',array('internalname'=>'guid', 'value'=>$vars['guid']));
- //$body .= elgg_view('input/hidden',array('internalname'=>'start_index', 'value'=>1));
-
- switch($browseCat)
- {
- case "youtube" :
- $body .= elgg_view('forms/labels/youtube');
- break;
- case "metacafe" :
- $body .= elgg_view('forms/labels/metacafe');
- break;
- case "vimeo" :
- $body .= elgg_view('forms/labels/vimeo');
- break;
- case "googlevideos" :
- $body .= elgg_view('forms/labels/googlevideos');
- break;
- default :
- $body .= elgg_view('forms/labels/youtube');
- break;
- }
- $body .= elgg_view('input/hidden',array('internalname'=>'page', 'value'=>$browseCat));
- $body .= '</form>';
- //$body .= '</div>';
- //$body .= '</div>';
-
- $body .= '<div id="SearchContainer">';
- $body .= '<div id="loadingSearch">';
- $body .= '</div>';
- $body .= '<div id="responseSearch" align="center">';
- $body .= '</div>';
- $body .= '</div>';
-
- print $body."<br /><br />";
-
-
?>
<style type="text/css">
#videosearch-menu{
@@ -136,122 +135,122 @@ var container = "<?php echo $container;?>";
$('#videonav li').removeClass();
switch(page)
{
- case "youtube" : $('#YT').removeClass().addClass('active');
- break;
- case "metacafe" : $('#MC').removeClass().addClass('active');
- break;
- case "vimeo" : $('#VM').removeClass().addClass('active');
- break;
- case "googlevideos" : $('#GV').removeClass().addClass('active');
- break;
- default : $('#YT').removeClass().addClass('active');
- break;
+case "youtube" : $('#YT').removeClass().addClass('active');
+ break;
+case "metacafe" : $('#MC').removeClass().addClass('active');
+ break;
+case "vimeo" : $('#VM').removeClass().addClass('active');
+ break;
+case "googlevideos" : $('#GV').removeClass().addClass('active');
+ break;
+default : $('#YT').removeClass().addClass('active');
+ break;
}
function sendSearchRequest(p){
- var queryFeed = $("#title_search").val();
- if(trim(queryFeed) != '')
- {
- $("#loadingSearch").html("<div align=\"center\" class=\"ajax_loader\"></div>");
- var elggTS = "<?php echo time(); ?>";
- var elggToken = "<?php echo generate_action_token(time()); ?>";
- $.ajax({
- type: "GET",
- url: "<?php echo $vars['url']; ?>"+"action/videolist/tubesearch",
- data: "bustcache="+new Date().getTime()+"&__elgg_ts="+elggTS+"&__elgg_token="+elggToken+"&page="+page+"&q="+queryFeed+"&start_index="+p+"&container="+container,
- success: function(html){
- $("#loadingSearch").html("");
- $("#responseSearch").html('');
- $("#responseSearch").html(html);
- }
- });
- }
- else{}
+var queryFeed = $("#title_search").val();
+if(trim(queryFeed) != '')
+{
+ $("#loadingSearch").html("<div align=\"center\" class=\"ajax_loader\"></div>");
+ var elggTS = "<?php echo time(); ?>";
+ var elggToken = "<?php echo generate_action_token(time()); ?>";
+ $.ajax({
+ type: "GET",
+ url: "<?php echo $vars['url']; ?>"+"action/videolist/tubesearch",
+ data: "bustcache="+new Date().getTime()+"&__elgg_ts="+elggTS+"&__elgg_token="+elggToken+"&page="+page+"&q="+queryFeed+"&start_index="+p+"&container="+container,
+ success: function(html){
+ $("#loadingSearch").html("");
+ $("#responseSearch").html('');
+ $("#responseSearch").html(html);
+ }
+ });
+}
+else{}
}
function showV_idFeed(param, param2){
- var arg = param;
- var embed_video = "<div style='text-align:right;'><a href='javascript:void(0);' onclick='javascript:closeit("+param2+");'>close</a></div><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' width='475' height='350'>"+
- "<param name='movie' value='"+arg+"&amp;autoplay=1'>"+
- "<param name='quality' value='high'>"+
- "<param name='bgcolor' value='#CEEFFF'>"+
- "<!--[if !IE]> <-->"+
- "<object data='"+arg+"&amp;autoplay=1' width='475' height='350' autoplay=1 type='application/x-shockwave-flash'>"+
- "<param name='quality' value='high'>"+
- "<param name='bgcolor' value='#CEEFFF'>"+
- "<param name='pluginurl' value='http://www.adobe.com/go/getflashplayer'>"+
- "FAIL (the browser should render some flash content, not this)."+
- "</object>"+
- "<!--> <![endif]-->"+
- "</object>";
- disableScreen(embed_video, param2);
+var arg = param;
+var embed_video = "<div style='text-align:right;'><a href='javascript:void(0);' onclick='javascript:closeit("+param2+");'>close</a></div><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' width='475' height='350'>"+
+ "<param name='movie' value='"+arg+"&amp;autoplay=1'>"+
+ "<param name='quality' value='high'>"+
+ "<param name='bgcolor' value='#CEEFFF'>"+
+ "<!--[if !IE]> <-->"+
+ "<object data='"+arg+"&amp;autoplay=1' width='475' height='350' autoplay=1 type='application/x-shockwave-flash'>"+
+ "<param name='quality' value='high'>"+
+ "<param name='bgcolor' value='#CEEFFF'>"+
+ "<param name='pluginurl' value='http://www.adobe.com/go/getflashplayer'>"+
+ "FAIL (the browser should render some flash content, not this)."+
+ "</object>"+
+ "<!--> <![endif]-->"+
+ "</object>";
+disableScreen(embed_video, param2);
}
function showV_idFeedMetacafe(param, param2){
- var argArray = param.split("/");
- var arg = argArray[0]+"/"+argArray[1]+".swf";
- var embed_video = "<div style='text-align:right;'><a href='javascript:void(0);' onclick='javascript:closeit("+param2+");'>close</a></div><object width=\"475\" height=\"350\"><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"Metacafe_"+argArray[0]+"\" value=\"http://www.metacafe.com/fplayer/"+arg+"&amp;autoplay=1\" /><embed src=\"http://www.metacafe.com/fplayer/"+arg+"&amp;autoplay=1\" type=\"application/x-shockwave-flash\" name=\"Metacafe_"+argArray[0]+"\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"475\" height=\"350\"></embed></object>";
-
- disableScreen(embed_video, param2);
+var argArray = param.split("/");
+var arg = argArray[0]+"/"+argArray[1]+".swf";
+var embed_video = "<div style='text-align:right;'><a href='javascript:void(0);' onclick='javascript:closeit("+param2+");'>close</a></div><object width=\"475\" height=\"350\"><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"Metacafe_"+argArray[0]+"\" value=\"http://www.metacafe.com/fplayer/"+arg+"&amp;autoplay=1\" /><embed src=\"http://www.metacafe.com/fplayer/"+arg+"&amp;autoplay=1\" type=\"application/x-shockwave-flash\" name=\"Metacafe_"+argArray[0]+"\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"475\" height=\"350\"></embed></object>";
+
+disableScreen(embed_video, param2);
}
function showV_idFeedVimeo(param, param2){
- var arg = param;
- var embed_video = "<div style='text-align:right;'><a href='javascript:void(0);' onclick='javascript:closeit("+param2+");'>close</a></div><object width=\"475\" height=\"350\"><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"movie\" value=\"http://vimeo.com/moogaloop.swf?clip_id="+arg+"&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1\" /><embed src=\"http://vimeo.com/moogaloop.swf?clip_id="+arg+"&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"475\" height=\"350\"></embed></object>";
- disableScreen(embed_video, param2);
+var arg = param;
+var embed_video = "<div style='text-align:right;'><a href='javascript:void(0);' onclick='javascript:closeit("+param2+");'>close</a></div><object width=\"475\" height=\"350\"><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"movie\" value=\"http://vimeo.com/moogaloop.swf?clip_id="+arg+"&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1\" /><embed src=\"http://vimeo.com/moogaloop.swf?clip_id="+arg+"&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"475\" height=\"350\"></embed></object>";
+disableScreen(embed_video, param2);
}
function disableScreen(embed_video, param2)
{
- var getContainer = "#vidContainer"+param2;
- $('#page_container').append("<div id='page_overlay' style='position:absolute;'/>");
- $('#page_overlay').css({
- backgroundColor: "#000",
- opacity: "0.8",
- width: $(window).width(),
- height: $('#page_container').height(),
- top: "0px",
- left: -(($(window).width() - $('body').width()) / 2)
- }).fadeIn();
- $(getContainer).css("width", "0%");
- $(getContainer).animate( { width:"45%"}, 300 );
- document.getElementById("vidContainer"+param2).innerHTML = embed_video;
+var getContainer = "#vidContainer"+param2;
+$('#page_container').append("<div id='page_overlay' style='position:absolute;'/>");
+$('#page_overlay').css({
+ backgroundColor: "#000",
+ opacity: "0.8",
+ width: $(window).width(),
+ height: $('#page_container').height(),
+ top: "0px",
+ left: -(($(window).width() - $('body').width()) / 2)
+ }).fadeIn();
+$(getContainer).css("width", "0%");
+$(getContainer).animate( { width:"45%"}, 300 );
+document.getElementById("vidContainer"+param2).innerHTML = embed_video;
}
function trim(stringToTrim)
{
- return ltrim(rtrim(stringToTrim));
+return ltrim(rtrim(stringToTrim));
}
function ltrim(stringToTrim) {
- return stringToTrim.replace(/^\s+/,"");
+return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
- return stringToTrim.replace(/\s+$/,"");
+return stringToTrim.replace(/\s+$/,"");
}
function closeit(param){
- document.getElementById("vidContainer"+param).innerHTML = "";
- document.getElementById("vidContainer"+param).style.display = "none";
- $('#page_overlay').remove();
+document.getElementById("vidContainer"+param).innerHTML = "";
+document.getElementById("vidContainer"+param).style.display = "none";
+$('#page_overlay').remove();
}
function InsertVideoUrl(param, param2){
- var actionAction = "add_video";
- var access_id = 2;
- var elggTS = "<?php echo time(); ?>";
- var elggToken = "<?php echo generate_action_token(time()); ?>";
- $.ajax({
- type: "GET",
- url: "<?php echo $vars['url']; ?>"+"action/videolist/addvideo",
- data: "bustcache="+new Date().getTime()+"&__elgg_ts="+elggTS+"&__elgg_token="+elggToken+"&video_action="+actionAction+"&title_videourl="+param+"&videolisttags="+param2+"&access_id="+access_id,
- success: function(html){
- $("#loadingSearch").html("");
- $("#responseSearch").html('');
- $("#responseSearch").html(html);
- }
- });
-
+ var actionAction = "add_video";
+ var access_id = 2;
+ var elggTS = "<?php echo time(); ?>";
+ var elggToken = "<?php echo generate_action_token(time()); ?>";
+ $.ajax({
+ type: "GET",
+ url: "<?php echo $vars['url']; ?>"+"action/videolist/addvideo",
+ data: "bustcache="+new Date().getTime()+"&__elgg_ts="+elggTS+"&__elgg_token="+elggToken+"&video_action="+actionAction+"&title_videourl="+param+"&videolisttags="+param2+"&access_id="+access_id,
+ success: function(html){
+ $("#loadingSearch").html("");
+ $("#responseSearch").html('');
+ $("#responseSearch").html(html);
+ }
+ });
+
}
</script>
diff --git a/views/default/forms/labels/googlevideos.php b/views/default/forms/labels/googlevideos.php
index 76673c10b..41893cea2 100644
--- a/views/default/forms/labels/googlevideos.php
+++ b/views/default/forms/labels/googlevideos.php
@@ -1,34 +1,32 @@
<?php
- /**
- * Elgg User Profile Video Plugin
- * This plugin allows users to browse youtube videos
- *
- * @package ElggProfile
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Prateek Choudhary <synapticfield@gmail.com>
- * @copyright Prateek Choudhary
- */
+/**
+ * Elgg User Profile Video Plugin
+ * This plugin allows users to browse youtube videos
+ *
+ * @package ElggProfile
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Prateek Choudhary <synapticfield@gmail.com>
+ * @copyright Prateek Choudhary
+ */
- $body = '<p><label>'.elgg_echo("videolist:title_search_tube").'<br />';
- //$body .= elgg_view("input/text",array('internalname' => 'title_search','value' => '', 'id' => 'title_search'));
- $body .= "<div style='width:100%;'>";
- $body .= "<div style='float:left;width:19%;'>";
- $body .= "<a href=\"http://video.google.com\"><img src='".$vars['url']."mod/videolist/graphics/logo_videos.png' width='120'/></a>";
- $body .= "</div>";
- $body .= "<div style='float:left;width:45%;'>";
- $body .= "<input type=\"text\" name=\"title_search\" value=\"\" id=\"title_search\" size=\"30\"/> &nbsp;&nbsp;";
- if($error['no-search'] == 0)
- {
- $body .= '<div class="error">'.$error_msg['no-search'].'</div>';
- }
- $body .= "</div>";
- //$body .= "<div>";
- //$body .= '<input type="submit" value="Submit" class="submit_button" name="submit" onclick="sendSearchRequest(1);"/>';
- $body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos:vimeo')));
- //$body .= "</div>";
- $body .= "</div>";
- $body .= '</label></p>';
- $body .= '<div id="searchcontrol">Loading...</div>';
- print $body;
-?>
+$body = '<p><label>'.elgg_echo("videolist:title_search_tube").'<br />';
+//$body .= elgg_view("input/text",array('internalname' => 'title_search','value' => '', 'id' => 'title_search'));
+$body .= "<div style='width:100%;'>";
+$body .= "<div style='float:left;width:19%;'>";
+$body .= "<a href=\"http://video.google.com\"><img src='".$vars['url']."mod/videolist/graphics/logo_videos.png' width='120'/></a>";
+$body .= "</div>";
+$body .= "<div style='float:left;width:45%;'>";
+$body .= "<input type=\"text\" name=\"title_search\" value=\"\" id=\"title_search\" size=\"30\"/> &nbsp;&nbsp;";
+if($error['no-search'] == 0) {
+ $body .= '<div class="error">'.$error_msg['no-search'].'</div>';
+}
+$body .= "</div>";
+//$body .= "<div>";
+//$body .= '<input type="submit" value="Submit" class="submit_button" name="submit" onclick="sendSearchRequest(1);"/>';
+$body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos:vimeo')));
+//$body .= "</div>";
+$body .= "</div>";
+$body .= '</label></p>';
+$body .= '<div id="searchcontrol">Loading...</div>';
+print $body; \ No newline at end of file
diff --git a/views/default/forms/labels/metacafe.php b/views/default/forms/labels/metacafe.php
index 7003b6743..08edbcfdd 100644
--- a/views/default/forms/labels/metacafe.php
+++ b/views/default/forms/labels/metacafe.php
@@ -1,34 +1,32 @@
<?php
- /**
- * Elgg Video Plugin
- * This plugin allows users to create a library of youtube/vimeo/metacafe videos
- * @file - load metacafe label
- * @package Elgg
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Prateek Choudhary <synapticfield@gmail.com>
- * @copyright Prateek Choudhary
- */
+/**
+ * Elgg Video Plugin
+ * This plugin allows users to create a library of youtube/vimeo/metacafe videos
+ * @file - load metacafe label
+ * @package Elgg
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Prateek Choudhary <synapticfield@gmail.com>
+ * @copyright Prateek Choudhary
+ */
- $body = '<p><label>'.elgg_echo("videolist:title_search_tube").'<br />';
- //$body .= elgg_view("input/text",array('internalname' => 'title_search','value' => '', 'id' => 'title_search'));
- $body .= "<div style='width:100%;'>";
- $body .= "<div style='float:left;width:19%;'>";
- $body .= "<a href=\"http://www.metacafe.com\"><img src='".$vars['url']."mod/videolist/graphics/metacafe.jpg' width='120'/></a>";
- $body .= "</div>";
- $body .= "<div style='float:left;width:45%;'>";
- $body .= "<input type=\"text\" name=\"title_search\" value=\"\" id=\"title_search\" size=\"30\"/> &nbsp;&nbsp;";
- if($error['no-search'] == 0)
- {
- $body .= '<div class="error">'.$error_msg['no-search'].'</div>';
- }
- $body .= "</div>";
- //$body .= "<div>";
- //$body .= '<input type="submit" value="Submit" class="submit_button" name="submit" onclick="sendSearchRequest(1);"/>';
- $body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos:metacafe')));
- //$body .= "</div>";
- $body .= "</div>";
- $body .= '</label></p>';
-
- print $body;
-?>
+$body = '<p><label>'.elgg_echo("videolist:title_search_tube").'<br />';
+//$body .= elgg_view("input/text",array('internalname' => 'title_search','value' => '', 'id' => 'title_search'));
+$body .= "<div style='width:100%;'>";
+$body .= "<div style='float:left;width:19%;'>";
+$body .= "<a href=\"http://www.metacafe.com\"><img src='".$vars['url']."mod/videolist/graphics/metacafe.jpg' width='120'/></a>";
+$body .= "</div>";
+$body .= "<div style='float:left;width:45%;'>";
+$body .= "<input type=\"text\" name=\"title_search\" value=\"\" id=\"title_search\" size=\"30\"/> &nbsp;&nbsp;";
+if($error['no-search'] == 0) {
+ $body .= '<div class="error">'.$error_msg['no-search'].'</div>';
+}
+$body .= "</div>";
+//$body .= "<div>";
+//$body .= '<input type="submit" value="Submit" class="submit_button" name="submit" onclick="sendSearchRequest(1);"/>';
+$body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos:metacafe')));
+//$body .= "</div>";
+$body .= "</div>";
+$body .= '</label></p>';
+
+print $body; \ No newline at end of file
diff --git a/views/default/forms/labels/vimeo.php b/views/default/forms/labels/vimeo.php
index 6a15909b4..38ffc17f0 100644
--- a/views/default/forms/labels/vimeo.php
+++ b/views/default/forms/labels/vimeo.php
@@ -1,34 +1,32 @@
<?php
- /**
- * Elgg Video Plugin
- * This plugin allows users to create a library of youtube/vimeo/metacafe videos
- * @file - load vimeo label
- * @package Elgg
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Prateek Choudhary <synapticfield@gmail.com>
- * @copyright Prateek Choudhary
- */
+/**
+ * Elgg Video Plugin
+ * This plugin allows users to create a library of youtube/vimeo/metacafe videos
+ * @file - load vimeo label
+ * @package Elgg
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Prateek Choudhary <synapticfield@gmail.com>
+ * @copyright Prateek Choudhary
+ */
- $body = '<p><label>'.elgg_echo("videolist:title_search_tube").'<br />';
- //$body .= elgg_view("input/text",array('internalname' => 'title_search','value' => '', 'id' => 'title_search'));
- $body .= "<div style='width:100%;'>";
- $body .= "<div style='float:left;width:19%;'>";
- $body .= "<a href=\"http://www.vimeo.com\"><img src='".$vars['url']."mod/videolist/graphics/vimeo_logo.gif' width='120'/></a>";
- $body .= "</div>";
- $body .= "<div style='float:left;width:45%;'>";
- $body .= "<input type=\"text\" name=\"title_search\" value=\"\" id=\"title_search\" size=\"30\"/> &nbsp;&nbsp;";
- if($error['no-search'] == 0)
- {
- $body .= '<div class="error">'.$error_msg['no-search'].'</div>';
- }
- $body .= "</div>";
- //$body .= "<div>";
- //$body .= '<input type="submit" value="Submit" class="submit_button" name="submit" onclick="sendSearchRequest(1);"/>';
- $body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos:vimeo')));
- //$body .= "</div>";
- $body .= "</div>";
- $body .= '</label></p>';
-
- print $body;
-?>
+$body = '<p><label>'.elgg_echo("videolist:title_search_tube").'<br />';
+//$body .= elgg_view("input/text",array('internalname' => 'title_search','value' => '', 'id' => 'title_search'));
+$body .= "<div style='width:100%;'>";
+$body .= "<div style='float:left;width:19%;'>";
+$body .= "<a href=\"http://www.vimeo.com\"><img src='".$vars['url']."mod/videolist/graphics/vimeo_logo.gif' width='120'/></a>";
+$body .= "</div>";
+$body .= "<div style='float:left;width:45%;'>";
+$body .= "<input type=\"text\" name=\"title_search\" value=\"\" id=\"title_search\" size=\"30\"/> &nbsp;&nbsp;";
+if ($error['no-search'] == 0) {
+ $body .= '<div class="error">'.$error_msg['no-search'].'</div>';
+}
+$body .= "</div>";
+//$body .= "<div>";
+//$body .= '<input type="submit" value="Submit" class="submit_button" name="submit" onclick="sendSearchRequest(1);"/>';
+$body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos:vimeo')));
+//$body .= "</div>";
+$body .= "</div>";
+$body .= '</label></p>';
+
+print $body; \ No newline at end of file
diff --git a/views/default/forms/labels/youtube.php b/views/default/forms/labels/youtube.php
index 4ec53b27a..37575c0f1 100644
--- a/views/default/forms/labels/youtube.php
+++ b/views/default/forms/labels/youtube.php
@@ -1,34 +1,32 @@
<?php
- /**
- * Elgg Video Plugin
- * This plugin allows users to create a library of youtube/vimeo/metacafe videos
- * @file - load youtube label
- * @package Elgg
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Prateek Choudhary <synapticfield@gmail.com>
- * @copyright Prateek Choudhary
- */
+/**
+ * Elgg Video Plugin
+ * This plugin allows users to create a library of youtube/vimeo/metacafe videos
+ * @file - load youtube label
+ * @package Elgg
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Prateek Choudhary <synapticfield@gmail.com>
+ * @copyright Prateek Choudhary
+ */
- $body = '<p><label>'.elgg_echo("videolist:title_search_tube").'<br />';
- //$body .= elgg_view("input/text",array('internalname' => 'title_search','value' => '', 'id' => 'title_search'));
- $body .= "<div style='width:100%;'>";
- $body .= "<div style='float:left;width:10%;'>";
- $body .= "<a href=\"http://www.youtube.com\"><img src='".$vars['url']."mod/videolist/graphics/badge3.gif' height='30'/></a>";
- $body .= "</div>";
- $body .= "<div style='float:left;width:45%;'>";
- $body .= "<input type=\"text\" name=\"title_search\" value=\"\" id=\"title_search\" size=\"30\"/> &nbsp;&nbsp;";
- if($error['no-search'] == 0)
- {
- $body .= '<div class="error">'.$error_msg['no-search'].'</div>';
- }
- $body .= "</div>";
- //$body .= "<div>";
- //$body .= '<input type="submit" value="Submit" class="submit_button" name="submit" onclick="sendSearchRequest(1);"/>';
- $body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos')));
- //$body .= "</div>";
- $body .= "</div>";
- $body .= '</label></p>';
-
- print $body;
-?>
+$body = '<p><label>'.elgg_echo("videolist:title_search_tube").'<br />';
+//$body .= elgg_view("input/text",array('internalname' => 'title_search','value' => '', 'id' => 'title_search'));
+$body .= "<div style='width:100%;'>";
+$body .= "<div style='float:left;width:10%;'>";
+$body .= "<a href=\"http://www.youtube.com\"><img src='".$vars['url']."mod/videolist/graphics/badge3.gif' height='30'/></a>";
+$body .= "</div>";
+$body .= "<div style='float:left;width:45%;'>";
+$body .= "<input type=\"text\" name=\"title_search\" value=\"\" id=\"title_search\" size=\"30\"/> &nbsp;&nbsp;";
+if($error['no-search'] == 0) {
+ $body .= '<div class="error">'.$error_msg['no-search'].'</div>';
+}
+$body .= "</div>";
+//$body .= "<div>";
+//$body .= '<input type="submit" value="Submit" class="submit_button" name="submit" onclick="sendSearchRequest(1);"/>';
+$body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('videolist:searchTubeVideos')));
+//$body .= "</div>";
+$body .= "</div>";
+$body .= '</label></p>';
+
+print $body; \ No newline at end of file