-
-
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.
[j3.7] New Feature Contact editor-xtd plugin (#12252)
* New editor-xtd contact plugin * docs * update sql * add contact icon * prevent loading in com_banners where it is useless * Installation sql * correct installation * extra line feed * __DEPLOY_VERSION__ * __DEPLOY_VERSION__ * com_admin script * Update contact.php * Update contact.php * Update contact.php * Update contact.xml * Update en-GB.plg_editors-xtd_contact.sys.ini * Update en-GB.plg_editors-xtd_contact.ini * Update 3.7.0-2016-10-01.sql * Update 3.7.0-2016-10-01.sql * Update 3.7.0-2016-10-01.sql
- Loading branch information
1 parent
f8812d5
commit 1f3db97
Showing
12 changed files
with
127 additions
and
3 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-10-01.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 | ||
(460, 'plg_editors-xtd_contact', 'plugin', 'contact', '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-10-01.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 | ||
(460, 'plg_editors-xtd_contact', 'plugin', 'contact', '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-10-01.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 460, 'plg_editors-xtd_contact', 'plugin', 'contact', '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
8 changes: 8 additions & 0 deletions
8
administrator/language/en-GB/en-GB.plg_editors-xtd_contact.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,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_CONTACT="Button - Contact" | ||
PLG_EDITORS-XTD_CONTACT_BUTTON_CONTACT="Contact" | ||
PLG_EDITORS-XTD_CONTACT_XML_DESCRIPTION="Displays a button to make it possible to insert links to Contacts in an article. Displays a popup allowing you to choose the contact." |
7 changes: 7 additions & 0 deletions
7
administrator/language/en-GB/en-GB.plg_editors-xtd_contact.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_CONTACT="Button - Contact" | ||
PLG_EDITORS-XTD_CONTACT_XML_DESCRIPTION="Displays a button to make it possible to insert links to Contacts in an article. Displays a popup allowing you to choose the contact." |
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.contact | ||
* | ||
* @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 Contact buton | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
class PlgButtonContact extends JPlugin | ||
{ | ||
/** | ||
* Load the language file on instantiation. | ||
* | ||
* @var boolean | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
protected $autoloadLanguage = true; | ||
|
||
/** | ||
* Display the button | ||
* | ||
* @param string $name The name of the button to add | ||
* | ||
* @return JObject The button options as JObject | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
public function onDisplay($name) | ||
{ | ||
/* | ||
* Javascript to insert the link | ||
* View element calls jSelectContact when a contact is clicked | ||
* jSelectContact creates the link tag, sends it to the editor, | ||
* and closes the select frame. | ||
*/ | ||
$js = " | ||
function jSelectContact(id, title, catid, object, link, lang) | ||
{ | ||
var hreflang = ''; | ||
if (lang !== '') | ||
{ | ||
var hreflang = ' hreflang = \"' + lang + '\"'; | ||
} | ||
var tag = '<a' + hreflang + ' href=\"' + link + '\">' + title + '</a>'; | ||
jInsertEditorText(tag, '" . $name . "'); | ||
jModalClose(); | ||
}"; | ||
|
||
JFactory::getDocument()->addScriptDeclaration($js); | ||
|
||
/* | ||
* Use the built-in element view to select the contact. | ||
* Currently uses blank class. | ||
*/ | ||
$link = 'index.php?option=com_contact&view=contacts&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1'; | ||
|
||
$button = new JObject; | ||
$button->modal = true; | ||
$button->class = 'btn'; | ||
$button->link = $link; | ||
$button->text = JText::_('PLG_EDITORS-XTD_CONTACT_BUTTON_CONTACT'); | ||
$button->name = 'address'; | ||
$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_contact</name> | ||
<author>Joomla! Project</author> | ||
<creationDate>October 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>__DEPLOY_VERSION__</version> | ||
<description>PLG_EDITORS-XTD_CONTACT_XML_DESCRIPTION</description> | ||
<files> | ||
<filename plugin="contact">contact.php</filename> | ||
</files> | ||
<languages> | ||
<language tag="en-GB">en-GB.plg_editors-xtd_contact.ini</language> | ||
<language tag="en-GB">en-GB.plg_editors-xtd_contact.sys.ini</language> | ||
</languages> | ||
</extension> |