setApplication($application); } /** * Display the button * * @param string $name The name of the button to add * * @return CMSObject The button options as JObject * * @since __DEPLOY_VERSION__ */ public function onDisplay($name) { $user = $this->getApplication()->getIdentity(); if ($user->authorise('core.create', 'com_weblinks') || $user->authorise('core.edit', 'com_weblinks') || $user->authorise('core.edit.own', 'com_weblinks')) { // The URL for the weblinks list $link = 'index.php?option=com_weblinks&view=weblinks&layout=modal&tmpl=component&' . Session::getFormToken() . '=1&editor=' . $name; $button = new CMSObject; $button->modal = true; $button->link = $link; $button->text = Text::_('PLG_EDITORS-XTD_WEBLINK_BUTTON_WEBLINK'); $button->name = $this->_type . '_' . $this->_name; $button->icon = 'globe'; $button->iconSVG = ' '; $button->options = [ 'height' => '300px', 'width' => '800px', 'bodyHeight' => '70', 'modalWidth' => '80', ]; return $button; } } }