-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3.7.0: New Feature=>editor-xtd to insert menu items links in content
- Loading branch information
1 parent
1f48268
commit d95c1f9
Showing
12 changed files
with
128 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
administrator/components/com_admin/sql/updates/mysql/3.7.0-2016-08-22.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES | ||
(459, 'plg_editors-xtd_menu', 'plugin', 'menu', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0); |
2 changes: 2 additions & 0 deletions
2
administrator/components/com_admin/sql/updates/postgresql/3.7.0-2016-08-22.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES | ||
(459, 'plg_editors-xtd_menu', 'plugin', 'menu', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0); |
6 changes: 6 additions & 0 deletions
6
administrator/components/com_admin/sql/updates/sqlazure/3.7.0-2016-08-22.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SET IDENTITY_INSERT #__extensions ON; | ||
|
||
INSERT INTO #__extensions ([extension_id], [name], [type], [element], [folder], [client_id], [enabled], [access], [protected], [manifest_cache], [params], [custom_data], [system_data], [checked_out], [checked_out_time], [ordering], [state]) | ||
SELECT 459, 'plg_editors-xtd_menu', 'plugin', 'menu', 'editors-xtd', 0, 1, 1, 0, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0; | ||
|
||
SET IDENTITY_INSERT #__extensions OFF; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
; Joomla! Project | ||
; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. | ||
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
; Note : All ini files need to be saved as UTF-8 | ||
|
||
PLG_EDITORS-XTD_MENU="Button - Menu" | ||
PLG_MENU_BUTTON_MENU="Menu" | ||
PLG_MENU_XML_DESCRIPTION="Displays a button to make it possible to insert menu items links into an Article. Displays a popup allowing you to choose the menu item." |
7 changes: 7 additions & 0 deletions
7
administrator/language/en-GB/en-GB.plg_editors-xtd_menu.sys.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
; Joomla! Project | ||
; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. | ||
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
; Note : All ini files need to be saved as UTF-8 | ||
|
||
PLG_EDITORS-XTD_MENU="Button - Menu" | ||
PLG_MENU_XML_DESCRIPTION="Displays a button to make it possible to insert menu items links into an Article. Displays a popup allowing you to choose the menu item." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Plugin | ||
* @subpackage Editors-xtd.menu | ||
* | ||
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
/** | ||
* Editor menu buton | ||
* | ||
* @since 3.7 | ||
*/ | ||
class PlgButtonMenu extends JPlugin | ||
{ | ||
/** | ||
* Load the language file on instantiation. | ||
* | ||
* @var boolean | ||
* @since 3.7 | ||
*/ | ||
protected $autoloadLanguage = true; | ||
|
||
/** | ||
* Display the button | ||
* | ||
* @param string $name The name of the button to add | ||
* | ||
* @since 3.7 | ||
* @return array | ||
*/ | ||
public function onDisplay($name) | ||
{ | ||
/* | ||
* Javascript to insert the link | ||
* View element calls jSelectMenuItem when a menu item is clicked | ||
* jSelectMenuItem creates the link tag, sends it to the editor, | ||
* and closes the select frame. | ||
*/ | ||
$js = " | ||
function jSelectMenuItem(id, title, tree, object, uri, language) | ||
{ | ||
var thislang = ''; | ||
if (language !== '') | ||
{ | ||
var thislang = '&lang='; | ||
} | ||
var tag = '<a href=\"' + uri + thislang + language + '\">' + title + '</a>'; | ||
jInsertEditorText(tag, '" . $name . "'); | ||
jModalClose(); | ||
}"; | ||
|
||
$doc = JFactory::getDocument(); | ||
$doc->addScriptDeclaration($js); | ||
|
||
/* | ||
* Use the built-in element view to select the menu item. | ||
* Currently uses blank class. | ||
*/ | ||
$link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1'; | ||
|
||
$button = new JObject; | ||
$button->modal = true; | ||
$button->class = 'btn'; | ||
$button->link = $link; | ||
$button->text = JText::_('PLG_MENU_BUTTON_MENU'); | ||
$button->name = 'file-add'; | ||
$button->options = "{handler: 'iframe', size: {x: 800, y: 500}}"; | ||
|
||
return $button; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<extension version="3.7" type="plugin" group="editors-xtd" method="upgrade"> | ||
<name>plg_editors-xtd_menu</name> | ||
<author>Joomla! Project</author> | ||
<creationDate>August 2016</creationDate> | ||
<copyright>Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved.</copyright> | ||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license> | ||
<authorEmail>[email protected]</authorEmail> | ||
<authorUrl>www.joomla.org</authorUrl> | ||
<version>3.7.0</version> | ||
<description>PLG_MENU_XML_DESCRIPTION</description> | ||
<files> | ||
<filename plugin="menu">menu.php</filename> | ||
</files> | ||
<languages> | ||
<language tag="en-GB">en-GB.plg_editors-xtd_menu.ini</language> | ||
<language tag="en-GB">en-GB.plg_editors-xtd_menu.sys.ini</language> | ||
</languages> | ||
</extension> |