From a512b5f93f49ad40c89582360db95d0530270cd7 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Thu, 24 Jul 2014 08:54:07 +0200 Subject: [PATCH] Migrate Videos Pane enable/variables in ajxp_home instead of ajxp_user --- .../access.ajxp_home/class.HomePagePlugin.php | 58 +++++++++++++++++++ .../class.UserDashboardHome.js | 10 +++- .../src/plugins/access.ajxp_home/manifest.xml | 30 ++-------- .../class.UserDashboardDriver.php | 22 ------- .../src/plugins/access.ajxp_user/manifest.xml | 11 +--- 5 files changed, 72 insertions(+), 59 deletions(-) create mode 100644 core/src/plugins/access.ajxp_home/class.HomePagePlugin.php diff --git a/core/src/plugins/access.ajxp_home/class.HomePagePlugin.php b/core/src/plugins/access.ajxp_home/class.HomePagePlugin.php new file mode 100644 index 0000000000..077b43435d --- /dev/null +++ b/core/src/plugins/access.ajxp_home/class.HomePagePlugin.php @@ -0,0 +1,58 @@ + + * This file is part of Pydio. + * + * Pydio is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Pydio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Pydio. If not, see . + * + * The latest code can be found at . + * + */ +defined('AJXP_EXEC') or die( 'Access not allowed'); +/** + * @package AjaXplorer_Plugins + * @subpackage Access + * @class userHome + * AJXP_Plugin to access the shared elements of the current user + */ +class HomePagePlugin extends AbstractAccessDriver +{ + + public function initRepository() + { + //require_once AJXP_INSTALL_PATH."/".AJXP_PLUGINS_FOLDER."/action.share/class.ShareCenter.php"; + } + + public function parseSpecificContributions(&$contribNode){ + parent::parseSpecificContributions($contribNode); + if($contribNode->nodeName == "client_configs"){ + $actionXpath=new DOMXPath($contribNode->ownerDocument); + $gettingStartedList = $actionXpath->query('template[@name="tutorial_pane"]', $contribNode); + if(!$gettingStartedList->length) return ; + if($this->getFilteredOption("ENABLE_GETTING_STARTED") === false){ + $contribNode->removeChild($gettingStartedList->item(0)); + }else{ + $cdata = $gettingStartedList->item(0)->firstChild; + $keys = array("URL_APP_IOSAPPSTORE", "URL_APP_ANDROID", "URL_APP_SYNC_WIN", "URL_APP_SYNC_MAC"); + $values = array(); + foreach($keys as $k) $values[] = $this->getFilteredOption($k); + $newData = str_replace($keys, $values, $cdata->nodeValue); + $newCData = $contribNode->ownerDocument->createCDATASection($newData); + $gettingStartedList->item(0)->appendChild($newCData); + $gettingStartedList->item(0)->replaceChild($newCData, $cdata); + } + } + } + +} diff --git a/core/src/plugins/access.ajxp_home/class.UserDashboardHome.js b/core/src/plugins/access.ajxp_home/class.UserDashboardHome.js index 1ec4a414bd..3c6a915bc1 100644 --- a/core/src/plugins/access.ajxp_home/class.UserDashboardHome.js +++ b/core/src/plugins/access.ajxp_home/class.UserDashboardHome.js @@ -141,8 +141,8 @@ Class.create("UserDashboardHome", AjxpPane, { sharedWS.each(function(pair){renderElement(pair.value);}); } - if(oFormObject.next('div#videos_pane')){ - oFormObject.next('div#videos_pane').select('div.tutorial_load_button').invoke("observe", "click", function(e){ + if($('videos_pane')){ + $('videos_pane').select('div.tutorial_load_button').invoke("observe", "click", function(e){ var t = Event.findElement(e, 'div.tutorial_load_button'); try{ var main = t.up('div.tutorial_legend'); @@ -168,7 +168,11 @@ Class.create("UserDashboardHome", AjxpPane, { var obj = oFormObject.down("#welcome"); if(oFormObject.down("#welcome > small")) obj = oFormObject.down("#welcome > small"); var span = new Element('span').update('
' + MessageHash["user_home.55"]); - span.down('a').observe('click', function(){ $('videos_pane').setStyle({display:'block'}); }); + if($('videos_pane')){ + span.down('a').observe('click', function(){ $('videos_pane').setStyle({display:'block'}); }); + }else{ + span.down('a').remove(); + } obj.insert(span); } diff --git a/core/src/plugins/access.ajxp_home/manifest.xml b/core/src/plugins/access.ajxp_home/manifest.xml index 4eb83671a3..841c71759d 100644 --- a/core/src/plugins/access.ajxp_home/manifest.xml +++ b/core/src/plugins/access.ajxp_home/manifest.xml @@ -6,6 +6,7 @@ + -