diff --git a/universalbuttons.php b/universalbuttons.php old mode 100644 new mode 100755 index 3e5745a..ef150a3 --- a/universalbuttons.php +++ b/universalbuttons.php @@ -9,6 +9,8 @@ defined('_JEXEC') or die; +use Joomla\CMS\Factory; + class plgButtonUniversalButtons extends JPlugin { public function onDisplay($name, &$params) @@ -47,7 +49,7 @@ public function onDisplay($name, &$params) case "0": - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // ... $root = ''; if ($app->isAdmin()) { @@ -104,7 +106,7 @@ public function onDisplay($name, &$params) $iVariable++; } - $js .= " jInsertEditorText( str, editor); }"; + $js .= " Joomla.editors.instances[editor].replaceSelection(str); }"; $css = "";