Calling custom plugin

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
NLCJ
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Sat Jan 12, 2008 12:10 pm

Calling custom plugin

Post by NLCJ » Wed Oct 29, 2014 8:21 pm

Hi guys,

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;
            }
        }
}
Could someone push me in the right direction?

coding1
I've been banned!
Posts: 340
Joined: Mon Oct 20, 2014 10:42 am

Re: Calling custom plugin

Post by coding1 » Thu Oct 30, 2014 3:13 am

you can check your feature and put function in one event...

NLCJ
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Sat Jan 12, 2008 12:10 pm

Re: Calling custom plugin

Post by NLCJ » Thu Oct 30, 2014 11:33 am

I'm sorry. I don't understand you. Do you mean I have to change the event on which the plugin is called?


Locked

Return to “Joomla! 3.x Coding”