Permalink
Browse files

Get the admin go pro panel from before merge.

  • Loading branch information...
1 parent 7ff3f22 commit 9aa65345dbf8475b042d0dea3980272c1f5539ab @cdujeu cdujeu committed Sep 26, 2016
@@ -608,6 +608,49 @@
]]></clientCallback>
</processing>
</action>
+ <action name="display_enterprise">
+ <gui text="ajxp_conf.120" title="ajxp_conf.121" iconClass="icon-lightbulb" src="download_manager.png" hasAccessKey="false">
+ <context selection="false" dir="false" recycle="hidden" behaviour="hidden"
+ actionBar="false" contextMenu="false" infoPanel="false" inZip="false">
+ </context>
+ </gui>
+ <processing>
+ <clientCallback prepareModal="false" dialogOpenForm="enterprise_advertise_block" dialogOkButtonOnly="true" dialogSkipButtons="false">
+ <dialogOnOpen><![CDATA[
+ var lang = "en";
+ if(pydio && pydio.currentLanguage === "fr") lang = "fr";
+ else if(pydio && pydio.currentLanguage === "de") lang = "de";
+ $(oForm).down("iframe").src = "https://pydio.com/"+lang+"/switch-pydio-enterprise";
+ pydio.Controller.DISPLAY_ENTERPRISE_PING = true;
+ ]]></dialogOnOpen>
+ <dialogOnComplete hideDialog="true"><![CDATA[]]></dialogOnComplete>
+ </clientCallback>
+ <clientForm id="enterprise_advertise_block"><![CDATA[
+ <div id="enterprise_advertise_block" box_width="70%" box_padding="0" box_height="80%" box_resize="true" style="height:100%;" class="vertical_layout">
+ <iframe style="width: 100%; height: 90%; border: 0px solid #ddd;" class="vertical_fit"></iframe>
+ <div style="padding:20px;">&nbsp;</div>
+ </div>
+ ]]></clientForm>
+ <clientListener name="init"><![CDATA[
+ var conn = new Connexion();
+ conn.addParameter("get_action", "display_enterprise");
+ conn.onComplete = function(transport){
+ var response = transport.responseJSON;
+ if(response && response.display){
+ pydio.Controller.fireAction("display_enterprise");
+ }else if(response && !response.display){
+ pydio.Controller.DISPLAY_ENTERPRISE_PING = true;
+ }
+ };
+ window.setTimeout(function(){
+ if(!pydio.Controller.DISPLAY_ENTERPRISE_PING){
+ conn.sendAsync();
+ }
+ }, 5000);
+ ]]></clientListener>
+ <serverCallback methodName="displayEnterprise"/>
+ </processing>
+ </action>
<action name="share_react" forbidOverride="true"></action>
</actions>
@@ -417,6 +417,28 @@ public function preProcessBookmarkAction(ServerRequestInterface &$request, Respo
}
+ /**
+ * @param ServerRequestInterface $requestInterface
+ * @param ResponseInterface $responseInterface
+ */
+ public function displayEnterprise(ServerRequestInterface $requestInterface, ResponseInterface &$responseInterface){
+ $touchFile = $this->getPluginWorkDir(true).DIRECTORY_SEPARATOR."enterprise-display";
+ if(file_exists($touchFile)){
+ $lastDisplay = intval(file_get_contents($touchFile));
+ if(time() - $lastDisplay > 60 * 60 * 24 * 15){
+ $responseInterface = new JsonResponse(["display" => true]);
+ file_put_contents($touchFile, time());
+ }else{
+ $responseInterface = new JsonResponse(["display" => false]);
+ echo json_encode(["display" => false]);
+ }
+ }else{
+ $responseInterface = new JsonResponse(["display" => true]);
+ file_put_contents($touchFile, time());
+ }
+ }
+
+
/********************/
/* PLUGIN LIFECYCLE
/********************/

0 comments on commit 9aa6534

Please sign in to comment.