Skip to content

Instantly share code, notes, and snippets.

@johansundell
Created September 12, 2017 08:17
Show Gist options
  • Save johansundell/eb505037336a6c6965283f502dac4558 to your computer and use it in GitHub Desktop.
Save johansundell/eb505037336a6c6965283f502dac4558 to your computer and use it in GitHub Desktop.
editor-xtd plugin
<?php
/**
* @author Johan Sundell <johan@pixpro.net>
* @link https://www.pixpro.net/labs
* @copyright Copyright © You Rock AB 2003-2017 All Rights Reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
class PlgEditorsXtdTestme extends JPlugin
{
public function onDisplay( $name )
{
$link = 'index.php?option=com_ajax&group=editors-xtd&&plugin=testme&format=html&tmpl=component&name=' . $name;
$button = new JObject;
$button->modal = true;
$button->class = 'btn';
$button->link = $link;
$button->text = JText::_('PLG_EDITORSXTD_TESTME_BUTTON_TEST');
$button->name = 'copy';
$button->options = "{handler: 'iframe', size: {x: 500, y: 300}}";
return $button;
}
public function onAjaxTestme()
{
return '<h1>Works!!</h1>';
}
}
<?xml version="1.0" encoding="utf-8"?>
<extension version="3.1" type="plugin" group="editors-xtd" method="upgrade">
<name>plg_editors-xtd_testme</name>
<author>Johan Sundell</author>
<creationDate>Sep 2017</creationDate>
<copyright>Copyright (C) 2017 Johan Sundell All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>johan@pixpro.net</authorEmail>
<authorUrl>www.pixpro.net</authorUrl>
<version>0.0.1</version>
<description>TODO</description>
<files>
<filename plugin="testme">testme.php</filename>
</files>
</extension>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment