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

Commit

Permalink
Use "button" type to download the Jumploader applet and install it at…
Browse files Browse the repository at this point in the history
… the right place.
  • Loading branch information
cdujeu committed Aug 23, 2013
1 parent 3b38383 commit f637641
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/src/plugins/uploader.jumploader/class.JumploaderProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,5 +397,19 @@ public function postProcess($action, $httpVars, $postProcessData){
}
}
}

public function jumploaderInstallApplet($params){
if(is_file($this->getBaseDir()."/jumploader_z.jar")){
return "ERROR: The applet is already installed!";
}
$fileData = AJXP_Utils::getRemoteContent("http://jumploader.com/jumploader_z.jar");
if(!is_writable($this->getBaseDir())){
file_put_contents(AJXP_CACHE_DIR."/jumploader_z.jar", $fileData);
return "ERROR: The applet was downloaded, but the folder plugins/uploader.jumploader is not writeable. Applet is located in the cache folder, please put it manually in the plugin folder.";
}else{
file_put_contents($this->getBaseDir()."/jumploader_z.jar", $fileData);
return "SUCCESS: Installed applet successfully!";
}
}
}
?>
3 changes: 3 additions & 0 deletions core/src/plugins/uploader.jumploader/manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<i18n namespace="jumploader" path="plugins/uploader.jumploader/i18n"/>
</resources>
</client_settings>
<server_settings>
<global_param name="JUMPLOADER_INSTALL" type="button" label="CONF_MESSAGE[Install Applet]" description="CONF_MESSAGE[Install Applet]" choices="run_plugin_action:uploader.jumploader:jumploaderInstallApplet"/>
</server_settings>
<registry_contributions>
<actions>
<action name="upload">
Expand Down

0 comments on commit f637641

Please sign in to comment.