<?php
/**
* @version 1.4
* @package Joomla
* @subpackage System
* @copyright Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.
* @license GNU GPL v2.0
*/
defined('_JEXEC') or die;
class plgButtonsnapchunkz extends JPlugin
{
public function onDisplay($name)
{
$chunkz = file_get_contents(JURI::root(). 'plugins/editors-xtd/Snapchunkz/models/chunks/test.txt');
$label = 'btnnnnnn';
$jsCode = "
function chk(editor) {
jInsertEditorText('" . preg_replace('#\s+#imsU',' ',$chunkz) ."');
}
";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($jsCode);
$button = new JObject();
$button->modal = false;
$button->class = 'btn';
$button->text = $label;
$button->name = 'blank';
$button->onclick = 'chk(\''.$name.'\');return false;';
//$button->link = '#';
return $button;
}
}
?>
<div class="ph-row">
<div class="ph-col4" style="margin: 0px;">
<div class="ph-boxed-module">
<span class="ph-boxed-module-icon ph-left icon-home icon-4x"></span>
<h3 class="ph-black">Small Business</h3>
<h5 class="ph-grey">Websites</h5>
</div>
</div>
</div>
Uncaught TypeError: Cannot read property 'replaceSelection' of undefined rokpad.js?cache=2.1.8:425
RokPadData.insertion.onGetInsertMethod rokpad.js?cache=2.1.8:425
jInsertEditorText index.php?option=com_modules&view=module&layout=edit&id=90:77
chk index.php?option=com_modules&view=module&layout=edit&id=90:83
onclick
function chk(editor) {
jInsertEditorText('" . preg_replace('#\s+#imsU',' ',$chunkz) ."');
}
Time to create page: 0.114 seconds