Version Description
(08/04/2015) = * Fix bug token sKey affich en double dans url et mauvaise interprtation dans un iframe car paramtre appel en "?" et non "&"
Download this release
Release Info
Developer | infomaniak-dev |
Plugin | VOD Infomaniak |
Version | 1.2.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.8 to 1.2.1
- js/editor_plugin.js +59 -24
- readme.txt +13 -2
- vod.api.php +1 -1
- vod.class.php +56 -32
- vod.php +1 -1
- vod.template.php +29 -30
- vod_callback.php +1 -1
js/editor_plugin.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
*
|
4 |
* @author Destrem Kevin
|
5 |
* @link http://statslive.infomaniak.ch/vod/api/
|
6 |
-
* @version 1.
|
7 |
* @copyright infomaniak.ch
|
8 |
*
|
9 |
*/
|
@@ -14,12 +14,47 @@
|
|
14 |
|
15 |
//Fonction permettant de cacher l'overlay de configuration
|
16 |
Vod_dialogOpen = function () {
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
24 |
|
25 |
//Fonction permettant de naviguer entre les onglets
|
@@ -164,23 +199,23 @@ Vod_dialogValid = function () {
|
|
164 |
tinymce.create('tinymce.plugins.vodplugin', {
|
165 |
init : function(ed, url){
|
166 |
jQuery('#dialog-vod-form').dialog({
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
|
185 |
jQuery('#dialog-tabs').tabs({
|
186 |
show: function(event, ui) {
|
3 |
*
|
4 |
* @author Destrem Kevin
|
5 |
* @link http://statslive.infomaniak.ch/vod/api/
|
6 |
+
* @version 1.2
|
7 |
* @copyright infomaniak.ch
|
8 |
*
|
9 |
*/
|
14 |
|
15 |
//Fonction permettant de cacher l'overlay de configuration
|
16 |
Vod_dialogOpen = function () {
|
17 |
+
if (jQuery('#dialog-player')) {
|
18 |
+
var iPlayerCode = parseInt(jQuery('#dialog-player').val(),10);
|
19 |
+
if(iPlayerCode > 0 && jQuery('#player_'+iPlayerCode+'_height')){
|
20 |
+
jQuery("#dialog-vod-form").dialog('open');
|
21 |
+
jQuery("#dialog-url-input").value = "";
|
22 |
+
jQuery("#dialog-slide-header").removeClass("selected");
|
23 |
+
jQuery("#dialog-slide").hide();
|
24 |
+
Vod_setPlayerOptions();
|
25 |
+
Vod_selectTab(2);
|
26 |
+
return true;
|
27 |
+
}
|
28 |
+
}
|
29 |
+
jQuery('#dialog-vod-logout').dialog({modal: true});
|
30 |
+
jQuery("#dialog-vod-logout").dialog( "option", {'position' : 'center'} );
|
31 |
+
}
|
32 |
+
|
33 |
+
Vod_setPlayerOptions = function (){
|
34 |
+
var iPlayerCode = parseInt(jQuery('#dialog-player').val(),10);
|
35 |
+
if(iPlayerCode > 0 && jQuery('#player_'+iPlayerCode+'_height')){
|
36 |
+
jQuery('#dialog-width-input').val(jQuery('#player_'+iPlayerCode+'_width').val());
|
37 |
+
jQuery('#dialog-height-input').val(jQuery('#player_'+iPlayerCode+'_height').val());
|
38 |
+
|
39 |
+
if(parseInt(jQuery('#player_'+iPlayerCode+'_stretch').val(),10) == 1){
|
40 |
+
jQuery('#dialog-stretch').attr('checked', true);
|
41 |
+
}else{
|
42 |
+
jQuery('#dialog-stretch').attr('checked', false);
|
43 |
+
}
|
44 |
+
|
45 |
+
if(parseInt(jQuery('#player_'+iPlayerCode+'_autoload').val(),10) == 1){
|
46 |
+
jQuery('#dialog-autostart').attr('checked', true);
|
47 |
+
}else{
|
48 |
+
jQuery('#dialog-autostart').attr('checked', false);
|
49 |
+
}
|
50 |
+
|
51 |
+
if(parseInt(jQuery('#player_'+iPlayerCode+'_loop').val(),10) == 1){
|
52 |
+
jQuery('#dialog-loop').attr('checked', true);
|
53 |
+
}else{
|
54 |
+
jQuery('#dialog-loop').attr('checked', false);
|
55 |
+
}
|
56 |
+
return true;
|
57 |
+
}
|
58 |
}
|
59 |
|
60 |
//Fonction permettant de naviguer entre les onglets
|
199 |
tinymce.create('tinymce.plugins.vodplugin', {
|
200 |
init : function(ed, url){
|
201 |
jQuery('#dialog-vod-form').dialog({
|
202 |
+
title: 'Ajout d\'une video de la VOD',
|
203 |
+
resizable: false,
|
204 |
+
autoOpen: false,
|
205 |
+
width: 750,
|
206 |
+
modal: true,
|
207 |
+
buttons: {
|
208 |
+
"Ajouter": function() {
|
209 |
+
var bValid = true;
|
210 |
+
if ( bValid ) {
|
211 |
+
Vod_dialogValid();
|
212 |
+
}
|
213 |
+
},
|
214 |
+
Cancel: function() {
|
215 |
+
Vod_dialogClose();
|
216 |
+
}
|
217 |
+
}
|
218 |
+
});
|
219 |
|
220 |
jQuery('#dialog-tabs').tabs({
|
221 |
show: function(event, ui) {
|
readme.txt
CHANGED
@@ -4,8 +4,8 @@ Contributors: Infomaniak Network
|
|
4 |
Plugin Name: Vod Infomaniak
|
5 |
Tags: video, manage, infomaniak, vod
|
6 |
Requires at least: 2.8.6
|
7 |
-
Tested up to:
|
8 |
-
Stable tag: 1.1
|
9 |
|
10 |
|
11 |
|
@@ -72,6 +72,17 @@ Si vous ne trouvez pas de solution à votre question, vous pouvez aussi nous con
|
|
72 |
|
73 |
== Changelog ==
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
= 1.1.8 (17/06/2014) =
|
76 |
* Ajout de la création d'un article depuis la liste des playlistes
|
77 |
|
4 |
Plugin Name: Vod Infomaniak
|
5 |
Tags: video, manage, infomaniak, vod
|
6 |
Requires at least: 2.8.6
|
7 |
+
Tested up to: 4.1
|
8 |
+
Stable tag: 1.2.1
|
9 |
|
10 |
|
11 |
|
72 |
|
73 |
== Changelog ==
|
74 |
|
75 |
+
= 1.2.1 (08/04/2015) =
|
76 |
+
* Fix bug token sKey affiché en double dans url et mauvaise interprétation dans un iframe car paramètre appelé en "?" et non "&"
|
77 |
+
|
78 |
+
= 1.2 (08/01/2015) =
|
79 |
+
* Vérification de la compatiblité avec Wordpress 4.1
|
80 |
+
* Fix du bug d'interprétation de la taille du player lors de l'ajout d'une vidéo dans un article.
|
81 |
+
* Adaptation PHP 5.6
|
82 |
+
|
83 |
+
= 1.1.9 (19/06/2014) =
|
84 |
+
* Ajout d'un avertissement lors de l'insertion depuis un article si le plugin n'est pas configuré.
|
85 |
+
|
86 |
= 1.1.8 (17/06/2014) =
|
87 |
* Ajout de la création d'un article depuis la liste des playlistes
|
88 |
|
vod.api.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
*
|
7 |
* @author Destrem Kevin
|
8 |
* @link http://statslive.infomaniak.ch/vod/api/
|
9 |
-
* @version 1.
|
10 |
* @copyright infomaniak.ch
|
11 |
*
|
12 |
*/
|
6 |
*
|
7 |
* @author Destrem Kevin
|
8 |
* @link http://statslive.infomaniak.ch/vod/api/
|
9 |
+
* @version 1.2
|
10 |
* @copyright infomaniak.ch
|
11 |
*
|
12 |
*/
|
vod.class.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
*
|
6 |
* @author Destrem Kevin + Davide Rubini
|
7 |
* @link http://statslive.infomaniak.ch/vod/api/
|
8 |
-
* @version 1.1
|
9 |
* @copyright infomaniak.ch
|
10 |
*
|
11 |
*/
|
@@ -30,7 +30,7 @@
|
|
30 |
$this->db = new EasyVod_db();
|
31 |
$this->auto_sync = true;
|
32 |
$this->auto_sync_delay = 3600;
|
33 |
-
define("SALT", "
|
34 |
}
|
35 |
|
36 |
function add_filters_and_hooks() {
|
@@ -191,7 +191,6 @@
|
|
191 |
$tReturn = "";
|
192 |
if (!empty($aResult)) {
|
193 |
foreach ($aResult as $oPlaylist) {
|
194 |
-
var_dump($oPlaylist);
|
195 |
$sDuration = "";
|
196 |
if(!empty($oPlaylist->iTotalDuration)){
|
197 |
$iDuration = intval($oPlaylist->iTotalDuration/100);
|
@@ -296,11 +295,12 @@
|
|
296 |
//Recuperation des parametres optionnels des tags
|
297 |
$aTagParam = array();
|
298 |
if (!empty($params)) {
|
299 |
-
|
300 |
-
|
|
|
301 |
foreach ($aList as $param) {
|
302 |
if (strpos($param, "=") !== false) {
|
303 |
-
|
304 |
if (in_array($aCut[0], array("width", "height", "autoplay", "loop", "player", "videoimage", "tokenfolder"))) {
|
305 |
$aTagParam[$aCut[0]] = $aCut[1];
|
306 |
}
|
@@ -318,7 +318,7 @@
|
|
318 |
if (!empty($oFolder)) {
|
319 |
$fileInfo = pathinfo($file);
|
320 |
$sFileName = basename($file, '.' . $fileInfo['extension']);
|
321 |
-
$sKey = "
|
322 |
}
|
323 |
}
|
324 |
$videoimage = empty($aTagParam['videoimage']) ? 1 : intval($aTagParam['videoimage']);
|
@@ -328,7 +328,7 @@
|
|
328 |
$width = empty($aTagParam['width']) ? $this->options['width'] : intval($aTagParam['width']);
|
329 |
$height = empty($aTagParam['height']) ? $this->options['height'] : intval($aTagParam['height']);
|
330 |
|
331 |
-
|
332 |
$video_url = $sUrl . "?url=&playlist=" . $file;
|
333 |
} else {
|
334 |
//Build de l'url finale
|
@@ -337,7 +337,6 @@
|
|
337 |
} else {
|
338 |
$sFile = $file;
|
339 |
}
|
340 |
-
$sFile = $sFile . $sKey;
|
341 |
$video_url = $sUrl . "?url=" . $sFile;
|
342 |
if ($videoimage) {
|
343 |
$video_url .= "&preloadImage=" . str_replace(array(".flv", ".mp4"), ".jpg", $sFile);
|
@@ -357,6 +356,15 @@
|
|
357 |
if (isset($aTagParam['loop'])) {
|
358 |
$video_url .= "&loop=$loop";
|
359 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
|
361 |
//Build de la balise
|
362 |
$html_tag = '<span class="youtube">
|
@@ -413,8 +421,8 @@
|
|
413 |
}
|
414 |
|
415 |
function buildForm() {
|
416 |
-
|
417 |
-
|
418 |
$aPlayers = $this->db->get_players();
|
419 |
$aVideos = $this->db->get_videos_byPage(0, 50, $this->options['vod_filter_folder']);
|
420 |
$aPlaylists = $this->db->get_playlists();
|
@@ -424,7 +432,9 @@
|
|
424 |
$bCanUpload = true;
|
425 |
}
|
426 |
EasyVod_Display::buildForm($this->options, $aPlayers, $aVideos, $aPlaylists, $aFolders, $bCanUpload);
|
427 |
-
}
|
|
|
|
|
428 |
}
|
429 |
|
430 |
function checkAutoUpdate() {
|
@@ -558,10 +568,10 @@
|
|
558 |
|
559 |
function vod_admin_menu() {
|
560 |
$site_url = get_option("siteurl");
|
561 |
-
|
562 |
if (isset($_POST['submitted'])) {
|
563 |
$bResult = false;
|
564 |
-
|
565 |
if (empty($this->options['vod_api_callbackKey'])) {
|
566 |
$this->options['vod_api_callbackKey'] = sha1(time() * rand());
|
567 |
}
|
@@ -575,29 +585,29 @@
|
|
575 |
}
|
576 |
$this->options['vod_api_id'] = stripslashes(htmlspecialchars($_POST['vod_api_id']));
|
577 |
$this->options['vod_api_connected'] = 'off';
|
578 |
-
|
579 |
-
try {
|
580 |
$oApi = $this->getAPI();
|
581 |
-
|
582 |
-
$bResult = $oApi->ping();
|
583 |
if ($bResult) {
|
584 |
-
|
585 |
-
$this->options['vod_api_connected'] = 'on';
|
586 |
$this->options['vod_api_icodeservice'] = $oApi->getServiceItemID();
|
587 |
$this->options['vod_api_group'] = $oApi->getGroupID();
|
588 |
$this->options['vod_api_lastUpdate'] = 0;
|
589 |
$this->options['vod_filter_folder'] = "";
|
590 |
-
//Verification DB et synchro
|
591 |
-
$this->install_db();
|
592 |
-
if (empty($this->options['vod_api_valid_callback']) || $this->options['vod_api_valid_callback'] == 'off') {
|
593 |
|
594 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
595 |
$sUrl = $oApi->getCallback();
|
596 |
if (!empty($sUrl) && strpos($sUrl, str_replace('http://', '', $site_url)) !== false) {
|
597 |
$oApi->setCallback("");
|
598 |
}
|
599 |
|
600 |
-
|
601 |
$sUrl2 = $oApi->getCallbackV2();
|
602 |
$bCallbackV2 = true;
|
603 |
if ($sUrl2 != false) {
|
@@ -607,40 +617,52 @@
|
|
607 |
}
|
608 |
}
|
609 |
}
|
610 |
-
|
|
|
611 |
$oApi->setCallbackV2($site_url . "/?vod_page=callback&key=" . $this->options['vod_api_callbackKey']);
|
612 |
}
|
613 |
-
|
|
|
614 |
}
|
615 |
-
|
616 |
-
|
|
|
|
|
617 |
|
618 |
//Update des videos
|
619 |
$iNumberVideoApi = 200;
|
620 |
$this->db->clean_videos();
|
621 |
$iVideo = $oApi->countVideo();
|
622 |
$iPageTotal = floor(($iVideo - 1) / $iNumberVideoApi);
|
623 |
-
|
|
|
624 |
$aVideos = $oApi->getLastVideo($iNumberVideoApi, $iPage * $iNumberVideoApi);
|
625 |
foreach ($aVideos as $oVideo) {
|
626 |
$this->db->insert_video($oVideo['iFileCode'], $oVideo['iFolder'], $oVideo['sFileName'], $oVideo['sFileServerCode'], $oVideo['aEncodes'][0]['sPath'], $oVideo['aEncodes'][0]['eConteneur'], $oVideo['fFileDuration'], $oVideo['dFileUpload']);
|
627 |
}
|
628 |
}
|
629 |
-
|
630 |
}
|
631 |
} catch (Exception $oException) {
|
632 |
echo "<h4 style='color: red;'>" . __('Erreur : Impossible de se connecter', 'vod_infomaniak') . '</h4>';
|
633 |
}
|
634 |
-
|
|
|
|
|
|
|
|
|
635 |
}
|
|
|
636 |
if (isset($_POST['updateSynchro']) && $_POST['updateSynchro'] == 1) {
|
637 |
$this->options['vod_api_lastUpdate'] = 0;
|
638 |
$this->fastSynchro();
|
639 |
}
|
|
|
640 |
if (isset($_POST['updateSynchroVideo']) && $_POST['updateSynchroVideo'] == 1) {
|
641 |
$this->options['vod_api_lastUpdate'] = 0;
|
642 |
$this->fullSynchro();
|
643 |
}
|
|
|
644 |
if (isset($_POST['updateFilterFolder']) && $_POST['updateFilterFolder'] == 1) {
|
645 |
if ($_POST['sFolderPath'] == -1) {
|
646 |
$this->options['vod_filter_folder'] = "";
|
@@ -649,6 +671,7 @@
|
|
649 |
}
|
650 |
update_option($this->key, $this->options);
|
651 |
}
|
|
|
652 |
if (isset($_POST['updateRightPlugins']) && $_POST['updateRightPlugins'] == 1) {
|
653 |
$this->options['vod_right_integration'] = $this->getRightValue($_POST['integration_role']);
|
654 |
$this->options['vod_right_upload'] = $this->getRightValue($_POST['upload_role']);
|
@@ -656,6 +679,7 @@
|
|
656 |
$this->options['vod_right_playlist'] = $this->getRightValue($_POST['playlist_role']);
|
657 |
update_option($this->key, $this->options);
|
658 |
}
|
|
|
659 |
if ($this->options['vod_api_connected'] == "on") {
|
660 |
$this->options['vod_count_player'] = $this->db->count_player();
|
661 |
$this->options['vod_count_folder'] = $this->db->count_folder();
|
5 |
*
|
6 |
* @author Destrem Kevin + Davide Rubini
|
7 |
* @link http://statslive.infomaniak.ch/vod/api/
|
8 |
+
* @version 1.2.1
|
9 |
* @copyright infomaniak.ch
|
10 |
*
|
11 |
*/
|
30 |
$this->db = new EasyVod_db();
|
31 |
$this->auto_sync = true;
|
32 |
$this->auto_sync_delay = 3600;
|
33 |
+
define("SALT", "2saLsNw4s4MCG9BVjXCKxvZA");
|
34 |
}
|
35 |
|
36 |
function add_filters_and_hooks() {
|
191 |
$tReturn = "";
|
192 |
if (!empty($aResult)) {
|
193 |
foreach ($aResult as $oPlaylist) {
|
|
|
194 |
$sDuration = "";
|
195 |
if(!empty($oPlaylist->iTotalDuration)){
|
196 |
$iDuration = intval($oPlaylist->iTotalDuration/100);
|
295 |
//Recuperation des parametres optionnels des tags
|
296 |
$aTagParam = array();
|
297 |
if (!empty($params)) {
|
298 |
+
$params = html_entity_decode($params);
|
299 |
+
$params = strtolower(str_replace(array("'", '"', '’'), "", $params));
|
300 |
+
$aList = split(" ", $params);
|
301 |
foreach ($aList as $param) {
|
302 |
if (strpos($param, "=") !== false) {
|
303 |
+
$aCut = split("=", $param);
|
304 |
if (in_array($aCut[0], array("width", "height", "autoplay", "loop", "player", "videoimage", "tokenfolder"))) {
|
305 |
$aTagParam[$aCut[0]] = $aCut[1];
|
306 |
}
|
318 |
if (!empty($oFolder)) {
|
319 |
$fileInfo = pathinfo($file);
|
320 |
$sFileName = basename($file, '.' . $fileInfo['extension']);
|
321 |
+
$sKey = "&sKey=" . $this->getTemporaryKey($oFolder->sToken, $sFileName);
|
322 |
}
|
323 |
}
|
324 |
$videoimage = empty($aTagParam['videoimage']) ? 1 : intval($aTagParam['videoimage']);
|
328 |
$width = empty($aTagParam['width']) ? $this->options['width'] : intval($aTagParam['width']);
|
329 |
$height = empty($aTagParam['height']) ? $this->options['height'] : intval($aTagParam['height']);
|
330 |
|
331 |
+
if (is_numeric($file)) {
|
332 |
$video_url = $sUrl . "?url=&playlist=" . $file;
|
333 |
} else {
|
334 |
//Build de l'url finale
|
337 |
} else {
|
338 |
$sFile = $file;
|
339 |
}
|
|
|
340 |
$video_url = $sUrl . "?url=" . $sFile;
|
341 |
if ($videoimage) {
|
342 |
$video_url .= "&preloadImage=" . str_replace(array(".flv", ".mp4"), ".jpg", $sFile);
|
356 |
if (isset($aTagParam['loop'])) {
|
357 |
$video_url .= "&loop=$loop";
|
358 |
}
|
359 |
+
if (!empty($sKey)) {
|
360 |
+
$video_url .= $sKey;
|
361 |
+
}
|
362 |
+
if (empty($width)) {
|
363 |
+
$width = 480;
|
364 |
+
}
|
365 |
+
if (empty($height)) {
|
366 |
+
$height = 288;
|
367 |
+
}
|
368 |
|
369 |
//Build de la balise
|
370 |
$html_tag = '<span class="youtube">
|
421 |
}
|
422 |
|
423 |
function buildForm() {
|
424 |
+
require_once("vod.template.php");
|
425 |
+
if (!empty($this->options['vod_api_connected']) && $this->options['vod_api_connected'] == 'on') {
|
426 |
$aPlayers = $this->db->get_players();
|
427 |
$aVideos = $this->db->get_videos_byPage(0, 50, $this->options['vod_filter_folder']);
|
428 |
$aPlaylists = $this->db->get_playlists();
|
432 |
$bCanUpload = true;
|
433 |
}
|
434 |
EasyVod_Display::buildForm($this->options, $aPlayers, $aVideos, $aPlaylists, $aFolders, $bCanUpload);
|
435 |
+
} else {
|
436 |
+
EasyVod_Display::buildFormNoConfig();
|
437 |
+
}
|
438 |
}
|
439 |
|
440 |
function checkAutoUpdate() {
|
568 |
|
569 |
function vod_admin_menu() {
|
570 |
$site_url = get_option("siteurl");
|
571 |
+
$aFolders = array();
|
572 |
if (isset($_POST['submitted'])) {
|
573 |
$bResult = false;
|
574 |
+
|
575 |
if (empty($this->options['vod_api_callbackKey'])) {
|
576 |
$this->options['vod_api_callbackKey'] = sha1(time() * rand());
|
577 |
}
|
585 |
}
|
586 |
$this->options['vod_api_id'] = stripslashes(htmlspecialchars($_POST['vod_api_id']));
|
587 |
$this->options['vod_api_connected'] = 'off';
|
588 |
+
try {
|
|
|
589 |
$oApi = $this->getAPI();
|
590 |
+
$bResult = $oApi->ping();
|
|
|
591 |
if ($bResult) {
|
592 |
+
$this->options['vod_api_connected'] = 'on';
|
|
|
593 |
$this->options['vod_api_icodeservice'] = $oApi->getServiceItemID();
|
594 |
$this->options['vod_api_group'] = $oApi->getGroupID();
|
595 |
$this->options['vod_api_lastUpdate'] = 0;
|
596 |
$this->options['vod_filter_folder'] = "";
|
|
|
|
|
|
|
597 |
|
598 |
+
if (empty($_POST['logout']) === true) {
|
599 |
+
//Installation de la base de donnée seulement si elle n'est pas à jour
|
600 |
+
$this->update_db();
|
601 |
+
}
|
602 |
+
|
603 |
+
if (empty($this->options['vod_api_valid_callback']) || $this->options['vod_api_valid_callback'] == 'off') {
|
604 |
+
//Clean de callback V1 s'il y en a encore
|
605 |
$sUrl = $oApi->getCallback();
|
606 |
if (!empty($sUrl) && strpos($sUrl, str_replace('http://', '', $site_url)) !== false) {
|
607 |
$oApi->setCallback("");
|
608 |
}
|
609 |
|
610 |
+
//On va essayer d'ajouter un callback V2
|
611 |
$sUrl2 = $oApi->getCallbackV2();
|
612 |
$bCallbackV2 = true;
|
613 |
if ($sUrl2 != false) {
|
617 |
}
|
618 |
}
|
619 |
}
|
620 |
+
|
621 |
+
if ($bCallbackV2) {
|
622 |
$oApi->setCallbackV2($site_url . "/?vod_page=callback&key=" . $this->options['vod_api_callbackKey']);
|
623 |
}
|
624 |
+
|
625 |
+
$this->options['vod_api_valid_callback'] == 'on';
|
626 |
}
|
627 |
+
|
628 |
+
if ($this->db->count_video() == 0) {
|
629 |
+
|
630 |
+
$oApi = $this->getAPI();
|
631 |
|
632 |
//Update des videos
|
633 |
$iNumberVideoApi = 200;
|
634 |
$this->db->clean_videos();
|
635 |
$iVideo = $oApi->countVideo();
|
636 |
$iPageTotal = floor(($iVideo - 1) / $iNumberVideoApi);
|
637 |
+
|
638 |
+
for ($iPage = 0; $iPage <= $iPageTotal; $iPage++) {
|
639 |
$aVideos = $oApi->getLastVideo($iNumberVideoApi, $iPage * $iNumberVideoApi);
|
640 |
foreach ($aVideos as $oVideo) {
|
641 |
$this->db->insert_video($oVideo['iFileCode'], $oVideo['iFolder'], $oVideo['sFileName'], $oVideo['sFileServerCode'], $oVideo['aEncodes'][0]['sPath'], $oVideo['aEncodes'][0]['eConteneur'], $oVideo['fFileDuration'], $oVideo['dFileUpload']);
|
642 |
}
|
643 |
}
|
644 |
+
}
|
645 |
}
|
646 |
} catch (Exception $oException) {
|
647 |
echo "<h4 style='color: red;'>" . __('Erreur : Impossible de se connecter', 'vod_infomaniak') . '</h4>';
|
648 |
}
|
649 |
+
|
650 |
+
if (empty($_POST['logout']) === false) {
|
651 |
+
$this->options['vod_api_connected'] = 'off';
|
652 |
+
}
|
653 |
+
update_option($this->key, $this->options);
|
654 |
}
|
655 |
+
|
656 |
if (isset($_POST['updateSynchro']) && $_POST['updateSynchro'] == 1) {
|
657 |
$this->options['vod_api_lastUpdate'] = 0;
|
658 |
$this->fastSynchro();
|
659 |
}
|
660 |
+
|
661 |
if (isset($_POST['updateSynchroVideo']) && $_POST['updateSynchroVideo'] == 1) {
|
662 |
$this->options['vod_api_lastUpdate'] = 0;
|
663 |
$this->fullSynchro();
|
664 |
}
|
665 |
+
|
666 |
if (isset($_POST['updateFilterFolder']) && $_POST['updateFilterFolder'] == 1) {
|
667 |
if ($_POST['sFolderPath'] == -1) {
|
668 |
$this->options['vod_filter_folder'] = "";
|
671 |
}
|
672 |
update_option($this->key, $this->options);
|
673 |
}
|
674 |
+
|
675 |
if (isset($_POST['updateRightPlugins']) && $_POST['updateRightPlugins'] == 1) {
|
676 |
$this->options['vod_right_integration'] = $this->getRightValue($_POST['integration_role']);
|
677 |
$this->options['vod_right_upload'] = $this->getRightValue($_POST['upload_role']);
|
679 |
$this->options['vod_right_playlist'] = $this->getRightValue($_POST['playlist_role']);
|
680 |
update_option($this->key, $this->options);
|
681 |
}
|
682 |
+
|
683 |
if ($this->options['vod_api_connected'] == "on") {
|
684 |
$this->options['vod_count_player'] = $this->db->count_player();
|
685 |
$this->options['vod_count_folder'] = $this->db->count_folder();
|
vod.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/vod-infomaniak/
|
5 |
Description: Easily embed and manage videos from Infomaniak VOD in your posts, comments and RSS feeds. You need an Infomaniak VOD account to use this plugin.
|
6 |
Author: Infomaniak Staff
|
7 |
-
Version: 1.1
|
8 |
Author URI: http://infomaniak.com
|
9 |
*/
|
10 |
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/vod-infomaniak/
|
5 |
Description: Easily embed and manage videos from Infomaniak VOD in your posts, comments and RSS feeds. You need an Infomaniak VOD account to use this plugin.
|
6 |
Author: Infomaniak Staff
|
7 |
+
Version: 1.2.1
|
8 |
Author URI: http://infomaniak.com
|
9 |
*/
|
10 |
|
vod.template.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
*
|
6 |
* @author Destrem Kevin + Davide Rubini
|
7 |
* @link http://statslive.infomaniak.ch/vod/api/
|
8 |
-
* @version 1.
|
9 |
* @copyright infomaniak.ch
|
10 |
*
|
11 |
*/
|
@@ -14,8 +14,13 @@
|
|
14 |
|
15 |
static function buildForm($options, $aPlayers, $aVideos, $aPlaylists, $aFolders, $bCanUpload) {
|
16 |
?>
|
|
|
|
|
|
|
|
|
|
|
17 |
<div class="hidden">
|
18 |
-
|
19 |
<div id="dialog-tabs" class="ui-tabs">
|
20 |
<ul class="ui-tabs-nav">
|
21 |
<li><a href="#dialog-tab2" onclick="Vod_selectTab(2);"><?php _e('Videos', 'vod_infomaniak'); ?></a></li>
|
@@ -277,32 +282,6 @@
|
|
277 |
|
278 |
<script>
|
279 |
(function($) {
|
280 |
-
Vod_setPlayerOptions = function (){
|
281 |
-
var iPlayerCode = parseInt($('#dialog-player').val(),10);
|
282 |
-
if(iPlayerCode > 0 && $('#player_'+iPlayerCode+'_height')){
|
283 |
-
$('#dialog-width-input').val($('#player_'+iPlayerCode+'_width').val());
|
284 |
-
$('#dialog-height-input').val($('#player_'+iPlayerCode+'_height').val());
|
285 |
-
|
286 |
-
if(parseInt($('#player_'+iPlayerCode+'_stretch').val(),10) == 1){
|
287 |
-
$('#dialog-stretch').attr('checked', true);
|
288 |
-
}else{
|
289 |
-
$('#dialog-stretch').attr('checked', false);
|
290 |
-
}
|
291 |
-
|
292 |
-
if(parseInt($('#player_'+iPlayerCode+'_autoload').val(),10) == 1){
|
293 |
-
$('#dialog-autostart').attr('checked', true);
|
294 |
-
}else{
|
295 |
-
$('#dialog-autostart').attr('checked', false);
|
296 |
-
}
|
297 |
-
|
298 |
-
if(parseInt($('#player_'+iPlayerCode+'_loop').val(),10) == 1){
|
299 |
-
$('#dialog-loop').attr('checked', true);
|
300 |
-
}else{
|
301 |
-
$('#dialog-loop').attr('checked', false);
|
302 |
-
}
|
303 |
-
}
|
304 |
-
};
|
305 |
-
|
306 |
$('#dialog-player').unbind();
|
307 |
$('#dialog-player').change(function(){
|
308 |
Vod_setPlayerOptions();
|
@@ -338,11 +317,26 @@
|
|
338 |
<?php
|
339 |
}
|
340 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
static function adminMenu($action_url, $options, $sUrl, $aFolders) {
|
342 |
?>
|
343 |
<h2><?php _e('Administration du plugin VOD', 'vod_infomaniak'); ?></h2>
|
344 |
<form name="adminForm" action="<?php echo $action_url; ?>" method="post">
|
345 |
<input type="hidden" name="submitted" value="1"/>
|
|
|
|
|
|
|
346 |
|
347 |
<p>
|
348 |
<?php _e("Pour fonctionner, le plugin a besoin de s'interfacer avec votre compte VOD infomaniak.<br/>
|
@@ -382,8 +376,13 @@
|
|
382 |
?>
|
383 |
</p>
|
384 |
|
385 |
-
|
386 |
-
|
|
|
|
|
|
|
|
|
|
|
387 |
</form>
|
388 |
|
389 |
<?php
|
5 |
*
|
6 |
* @author Destrem Kevin + Davide Rubini
|
7 |
* @link http://statslive.infomaniak.ch/vod/api/
|
8 |
+
* @version 1.2
|
9 |
* @copyright infomaniak.ch
|
10 |
*
|
11 |
*/
|
14 |
|
15 |
static function buildForm($options, $aPlayers, $aVideos, $aPlaylists, $aFolders, $bCanUpload) {
|
16 |
?>
|
17 |
+
<div id="dialog-vod-logout" style="display:none;" title="<?=__('Probleme de configuration', 'vod_infomaniak')?>">
|
18 |
+
<p><?=__("Veuillez-vous rendre dans <a href='admin.php?page=configuration'>Videos -> Configuration</a> afin de configurer votre compte.", 'vod_infomaniak');?></p>
|
19 |
+
?>
|
20 |
+
</div>
|
21 |
+
|
22 |
<div class="hidden">
|
23 |
+
<div id="dialog-vod-form">
|
24 |
<div id="dialog-tabs" class="ui-tabs">
|
25 |
<ul class="ui-tabs-nav">
|
26 |
<li><a href="#dialog-tab2" onclick="Vod_selectTab(2);"><?php _e('Videos', 'vod_infomaniak'); ?></a></li>
|
282 |
|
283 |
<script>
|
284 |
(function($) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
$('#dialog-player').unbind();
|
286 |
$('#dialog-player').change(function(){
|
287 |
Vod_setPlayerOptions();
|
317 |
<?php
|
318 |
}
|
319 |
|
320 |
+
static function buildFormNoConfig() {
|
321 |
+
?>
|
322 |
+
<div id="dialog-vod-logout" style="display:none;" title="<?=__('Probleme de configuration', 'vod_infomaniak')?>">
|
323 |
+
<p style="padding: 0px 10px 0px">
|
324 |
+
<?php
|
325 |
+
echo __("Veuillez-vous rendre dans <a href='admin.php?page=configuration'>Videos -> Configuration</a> afin de configurer votre compte.", 'vod_infomaniak');
|
326 |
+
?>
|
327 |
+
</p>
|
328 |
+
</div>
|
329 |
+
<?php
|
330 |
+
}
|
331 |
+
|
332 |
static function adminMenu($action_url, $options, $sUrl, $aFolders) {
|
333 |
?>
|
334 |
<h2><?php _e('Administration du plugin VOD', 'vod_infomaniak'); ?></h2>
|
335 |
<form name="adminForm" action="<?php echo $action_url; ?>" method="post">
|
336 |
<input type="hidden" name="submitted" value="1"/>
|
337 |
+
<?php if ($options['vod_api_connected'] == "on") { ?>
|
338 |
+
<input type="hidden" name="logout" value="1"/>
|
339 |
+
<?php } ?>
|
340 |
|
341 |
<p>
|
342 |
<?php _e("Pour fonctionner, le plugin a besoin de s'interfacer avec votre compte VOD infomaniak.<br/>
|
376 |
?>
|
377 |
</p>
|
378 |
|
379 |
+
<?php if ($options['vod_api_connected'] == "on") { ?>
|
380 |
+
<div class="submit"><input class="button" type="submit" name="Submit"
|
381 |
+
value="<?php _e('Deconnexion', 'vod_infomaniak'); ?>"/></div>
|
382 |
+
<?php } else { ?>
|
383 |
+
<div class="submit"><input class="button" type="submit" name="Submit"
|
384 |
+
value="<?php _e('Connexion', 'vod_infomaniak'); ?>"/></div>
|
385 |
+
<?php } ?>
|
386 |
</form>
|
387 |
|
388 |
<?php
|
vod_callback.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
*
|
7 |
* @author Destrem Kevin
|
8 |
* @link http://statslive.infomaniak.ch/vod/api/
|
9 |
-
* @version 1.
|
10 |
* @copyright infomaniak.ch
|
11 |
*
|
12 |
*/
|
6 |
*
|
7 |
* @author Destrem Kevin
|
8 |
* @link http://statslive.infomaniak.ch/vod/api/
|
9 |
+
* @version 1.2
|
10 |
* @copyright infomaniak.ch
|
11 |
*
|
12 |
*/
|