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

Commit 9aa6534

Browse files
committed
Get the admin go pro panel from before merge.
1 parent 7ff3f22 commit 9aa6534

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

core/src/plugins/access.ajxp_conf/ajxp_confActions.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,49 @@
608608
]]></clientCallback>
609609
</processing>
610610
</action>
611+
<action name="display_enterprise">
612+
<gui text="ajxp_conf.120" title="ajxp_conf.121" iconClass="icon-lightbulb" src="download_manager.png" hasAccessKey="false">
613+
<context selection="false" dir="false" recycle="hidden" behaviour="hidden"
614+
actionBar="false" contextMenu="false" infoPanel="false" inZip="false">
615+
</context>
616+
</gui>
617+
<processing>
618+
<clientCallback prepareModal="false" dialogOpenForm="enterprise_advertise_block" dialogOkButtonOnly="true" dialogSkipButtons="false">
619+
<dialogOnOpen><![CDATA[
620+
var lang = "en";
621+
if(pydio && pydio.currentLanguage === "fr") lang = "fr";
622+
else if(pydio && pydio.currentLanguage === "de") lang = "de";
623+
$(oForm).down("iframe").src = "https://pydio.com/"+lang+"/switch-pydio-enterprise";
624+
pydio.Controller.DISPLAY_ENTERPRISE_PING = true;
625+
]]></dialogOnOpen>
626+
<dialogOnComplete hideDialog="true"><![CDATA[]]></dialogOnComplete>
627+
</clientCallback>
628+
<clientForm id="enterprise_advertise_block"><![CDATA[
629+
<div id="enterprise_advertise_block" box_width="70%" box_padding="0" box_height="80%" box_resize="true" style="height:100%;" class="vertical_layout">
630+
<iframe style="width: 100%; height: 90%; border: 0px solid #ddd;" class="vertical_fit"></iframe>
631+
<div style="padding:20px;">&nbsp;</div>
632+
</div>
633+
]]></clientForm>
634+
<clientListener name="init"><![CDATA[
635+
var conn = new Connexion();
636+
conn.addParameter("get_action", "display_enterprise");
637+
conn.onComplete = function(transport){
638+
var response = transport.responseJSON;
639+
if(response && response.display){
640+
pydio.Controller.fireAction("display_enterprise");
641+
}else if(response && !response.display){
642+
pydio.Controller.DISPLAY_ENTERPRISE_PING = true;
643+
}
644+
};
645+
window.setTimeout(function(){
646+
if(!pydio.Controller.DISPLAY_ENTERPRISE_PING){
647+
conn.sendAsync();
648+
}
649+
}, 5000);
650+
]]></clientListener>
651+
<serverCallback methodName="displayEnterprise"/>
652+
</processing>
653+
</action>
611654
<action name="share_react" forbidOverride="true"></action>
612655

613656
</actions>

core/src/plugins/access.ajxp_conf/src/ConfAccessDriver.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,28 @@ public function preProcessBookmarkAction(ServerRequestInterface &$request, Respo
417417
}
418418

419419

420+
/**
421+
* @param ServerRequestInterface $requestInterface
422+
* @param ResponseInterface $responseInterface
423+
*/
424+
public function displayEnterprise(ServerRequestInterface $requestInterface, ResponseInterface &$responseInterface){
425+
$touchFile = $this->getPluginWorkDir(true).DIRECTORY_SEPARATOR."enterprise-display";
426+
if(file_exists($touchFile)){
427+
$lastDisplay = intval(file_get_contents($touchFile));
428+
if(time() - $lastDisplay > 60 * 60 * 24 * 15){
429+
$responseInterface = new JsonResponse(["display" => true]);
430+
file_put_contents($touchFile, time());
431+
}else{
432+
$responseInterface = new JsonResponse(["display" => false]);
433+
echo json_encode(["display" => false]);
434+
}
435+
}else{
436+
$responseInterface = new JsonResponse(["display" => true]);
437+
file_put_contents($touchFile, time());
438+
}
439+
}
440+
441+
420442
/********************/
421443
/* PLUGIN LIFECYCLE
422444
/********************/

0 commit comments

Comments
 (0)