- md5
- 32bcddd2f2925387da99f73fd6431f20
- sha1
- 5a38db9e09045803e3e8c47ffae93c25ad08604a
- sha256
- f741688a99ebe9e0d6fba3f26c157e17d5dd7a3bb2b4a00b85c3dae0454b9b9e
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
<?php
/**
* @package Joomla.Plugin
* @subpackage Editors-xtd.menu
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Session\Session;
/**
* Editor menu button
*
* @since 3.7.0
*/
class PlgButtonMenu extends CMSPlugin
{
/**
* Load the language file on instantiation.
*
* @var boolean
* @since 3.7.0
*/
protected $autoloadLanguage = true;
/**
* Display the button
*
* @param string $name The name of the button to add
*
* @since 3.7.0
* @return CMSObject
*/
public function onDisplay($name)
{
/*
* Use the built-in element view to select the menu item.
* Currently uses blank class.
*/
$user = Factory::getUser();
if ($user->authorise('core.create', 'com_menus')
|| $user->authorise('core.edit', 'com_menus'))
{
$link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&'
. Session::getFormToken() . '=1&editor=' . $name;
$button = new CMSObject;
$button->modal = true;
$button->link = $link;
$button->text = Text::_('PLG_EDITORS-XTD_MENU_BUTTON_MENU');
$button->name = 'share-alt';
$button->options = [
'height' => '300px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
];
return $button;
}
}
}
No other release has this exact content. See every version of this file.