I have been struggling with this for a while now. The thing I am trying to create is an online database of files. Now I came across DropFiles, which was almost perfect. The only problem was that the upload button is only available when text is edited (thus the text editor is loaded). Now I figured that I would simply find the code, and add it somewhere in the Joomla site, resulting in a working button. Of course I was wrong.
Therefore I have a question, is there any way I can manually trigger this plugin (it's part of the editors-xtd group) or can I easily convert this to a module, since the button only has to be shown at certain pages.
The best would be of course to have a module call this plugin, however, I cannot seem to get this to work.
I have added a piece of the code which creates the button, I am not sharing all code since this is a paid extension;
Code: Select all
class plgButtonDropfilesbtn extends JPlugin
{
protected $do = true;
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
JLoader::register('DropfilesBase', JPATH_ADMINISTRATOR.'/components/com_dropfiles/classes/dropfilesBase.php');
if(!class_exists('DropfilesBase')){
$this->do = false;
}
$lang = JFactory::getLanguage();
$lang->load('plg_editors-xtd_dropfilesbtn',JPATH_PLUGINS.'/editors-xtd/dropfilesbtn',null,true);
$lang->load('plg_editors-xtd_dropfilesbtn.sys',JPATH_PLUGINS.'/editors-xtd/dropfilesbtn',null,true);
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_dropfiles')) {
$this->do = false;
}
}
}