I try to create a plugin which will display some text after creation of article in the editor.
/editors/materialwords/materialwords.xml:
<?xml version="1.0" encoding="utf-8"?>
<extension version="3.1" type="plugin" group="editors">
<name>Editor Material Words Count Plugin</name>
<creationDate>December 2016</creationDate>
<author>Aleksandr Lapenko</author>
<authorEmail>lapenkoak@gmail.com</authorEmail>
<authorUrl>vk.com/web_rider</authorUrl>
<copyright>Copyright</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>1.0.0</version>
<description>Calculate articles words count</description>
<files>
<filename plugin="materialwords">materialwords.php</filename>
</files>
<config>
<fields name="params">
<fieldset name="basic">
<field name="displayCount" type="text"
label="Display Count"
description="Words display count"
required="true"
size="10"
class="inputbox" />
</fieldset>
</fields>
</config>
</extension>
/editors/materialwords/materialwords.php:
<?php
defined('_JEXEC') or die;
class PlgEditorMaterialwords extends JPlugin
{
public function onSave($id)
{
return 'alert("' . $id . '");';
}
}
I install plugin and enable it. But something wrong (nothing when I save article in editor). Please, help. Best regards, Aleksandr.