Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Migrate Videos Pane enable/variables in ajxp_home instead of ajxp_user
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Jul 24, 2014
1 parent 62902d4 commit a512b5f
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 59 deletions.
58 changes: 58 additions & 0 deletions core/src/plugins/access.ajxp_home/class.HomePagePlugin.php
@@ -0,0 +1,58 @@
<?php
/*
* Copyright 2007-2013 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
* 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 <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <http://pyd.io/>.
*
*/
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);
}
}
}

}
10 changes: 7 additions & 3 deletions core/src/plugins/access.ajxp_home/class.UserDashboardHome.js
Expand Up @@ -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');
Expand All @@ -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('<br>' + 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);
}

Expand Down
30 changes: 6 additions & 24 deletions core/src/plugins/access.ajxp_home/manifest.xml
Expand Up @@ -6,6 +6,7 @@
<js className="UserDashboardHome" file="plugins/access.ajxp_home/class.UserDashboardHome.js" autoload="true"/>
<css file="plugins/access.ajxp_home/home.css" autoload="true"/>
</resources>
<node_provider ajxpClass="EmptyNodeProvider" ajxpOptions="{}"/>
</client_settings>
<server_settings>
<global_param name="ENABLE_GETTING_STARTED" type="boolean"
Expand Down Expand Up @@ -131,7 +132,9 @@
<div id="ws_legend"></div>
</div>
</div>
<div id="videos_pane" style="display:none;" class="skipSibling" ajxpClass="AjxpPane" ajxpOptions='{"replaceScroller":true}' style="overflow-y: scroll;">
]]></template_part>
<template element="ajxp_desktop" name="tutorial_pane" position="bottom" theme="orbit"><![CDATA[
<div id="videos_pane" style="display:none;" class="skipSibling" ajxpClass="AjxpPane" ajxpOptions='{}' style="overflow-y: scroll;">
<div style="float:right;font-size: 2em;margin-right: 6px;margin-top: 6px; cursor:pointer;" onclick="$('videos_pane').hide();" class="icon-remove-sign"></div>
<div style="clear:left; font-size: 25px; text-align:center; margin: 40px 0 30px;">AJXP_MESSAGE[user_home.56]</div>
<div id="tutorial_dl_apps_pane">
Expand Down Expand Up @@ -177,29 +180,8 @@
<div style="clear:left; text-align:center;">
<a href="http://pyd.io/end-user-tutorials/" target="_blank" style="text-align: center;font-size: 25px;background-color: #e35d52;padding: 10px;border-radius: 5px;color: white;display: inline-block;margin: 40px 0;"><i class="icon-youtube-play"></i> AJXP_MESSAGE[user_home.65]</a></div>
</div>
]]></template_part>
]]></template>
</client_configs>
<actions>
<action name="ls" dirDefault="true">
<gui text="32" title="32" src="fileopen.png"
accessKey="folder_access_key">
<context selection="true" dir="" recycle="false"
actionBar="false" actionBarGroup="get" contextMenu="true" infoPanel="true">
</context>
<selectionContext dir="true" file="true" recycle="false"
unique="true" allowedMimes="AJXP_MIMES_ZIP">
</selectionContext>
</gui>
<rightsContext noUser="true" userLogged="only" read="true"
write="false" adminOnly="false">
</rightsContext>
<processing>
<clientCallback prepareModal="true"><![CDATA[
]]></clientCallback>
<serverCallback methodName="switchAction"/>
</processing>
</action>
</actions>
</registry_contributions>
<class_definition filename="plugins/access.ajxp_user/class.UserDashboardDriver.php" classname="UserDashboardDriver"/>
<class_definition filename="plugins/access.ajxp_home/class.HomePagePlugin.php" classname="HomePagePlugin"/>
</ajxpdriver>
22 changes: 0 additions & 22 deletions core/src/plugins/access.ajxp_user/class.UserDashboardDriver.php
Expand Up @@ -34,28 +34,6 @@ 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('component_config/additional_tab[@id="tutorials_pane"]', $contribNode);
if(!$gettingStartedList->length) return ;
if($this->getFilteredOption("ENABLE_GETTING_STARTED") === false){
$compConfig = $gettingStartedList->item(0)->parentNode;
$contribNode->removeChild($compConfig);
}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);
}
}
}

public function switchAction($action, $httpVars, $fileVars)
{
if(!isSet($this->actions[$action])) return;
Expand Down
11 changes: 1 addition & 10 deletions core/src/plugins/access.ajxp_user/manifest.xml
Expand Up @@ -8,17 +8,8 @@
<js className="WebDAVprefsEditor" file="plugins/access.ajxp_user/class.WebDAVprefsEditor.js" autoload="true"/>
<css file="plugins/access.ajxp_user/dashboard.css"/>
</resources>
<node_provider ajxpClass="EmptyNodeProvider" ajxpOptions="{}"/>
</client_settings>
<server_settings>
<global_param name="URL_APP_IOSAPPSTORE" type="string"
label="iOS App URL" description="URL of the iOS application" default="https://itunes.apple.com/us/app/pydio/id709275884?mt=8"/>
<global_param name="URL_APP_ANDROID" type="string"
label="iOS App URL" description="URL of the iOS application" default="https://play.google.com/store/apps/details?id=com.pydio.android.Client"/>
<global_param name="URL_APP_SYNC_WIN" type="string"
label="iOS App URL" description="URL of the iOS application" default="http://pyd.io/apps/desktop-sync-client/"/>
<global_param name="URL_APP_SYNC_MAC" type="string"
label="iOS App URL" description="URL of the iOS application" default="http://pyd.io/apps/desktop-sync-client/"/>
</server_settings>
<registry_contributions>
<client_configs>
<template_part theme="umbra" ajxpId="sidebar_splitter" ajxpClass="AjxpPane" ajxpOptions='{"fit":"height","fake":"option"}'><![CDATA[
Expand Down

0 comments on commit a512b5f

Please sign in to comment.