input; $conf = JFactory::getConfig(); $css = ""; $user = JFactory::getUser(); // authorize only in article edition admin and front, if the page builder ck editor has been allowed, comes from the system plugin if ($conf->get('pagebuilderck_allowed') != '1') return; // loads the language files from the component frontend $lang = JFactory::getLanguage(); $lang->load('com_pagebuilderck', JPATH_SITE . '/components/com_pagebuilderck', $lang->getTag(), false); $lang->load('com_pagebuilderck', JPATH_SITE, $lang->getTag(), false); // for 3rd party integration $thirdPartyIntegrations = PagebuilderckHelper::getThirdPartyIntegrations(); $attribsVar = $thirdPartyIntegrations['attribs']; $adminForm = $thirdPartyIntegrations['adminForm']; $fieldsname = $thirdPartyIntegrations['fieldsname']; if ($input->get('option', '') !== 'com_content' && $input->get('option', '') !== 'com_flexicontent' ) { // if the field is not allowed in the list, don't show the button if ($name !== 'jform_' . $fieldsname) return; // if the integration params of PBCK does not allow, don't show the button if ($conf->get('pagebuilderck_allowed_' . $fieldsname, '1') == '0') return; } // if the page builder ck editor must be used if ($input->get('pbck', '0') == '1') { $short_name = str_replace('jform_', '', $name); if ($conf->get('pagebuilderck_allowed_' . $short_name) != '1') return; $conf = JFactory::getConfig(); // Get the text filter data $params = JComponentHelper::getParams('com_config'); $filters = CKFof::convertObjectToArray($params->get('filters')); // check if the user has the correct rights on the filters to save the article if (! in_array('8', $user->groups)) { // checks for super user group foreach($user->groups as $g) { if (isset($filters[$g])) { $filters[$g] = CKFof::convertObjectToArray($filters[$g]); if ($filters[$g]['filter_type'] === 'BL') $app->enqueueMessage('PAGE BUILDER CK : ' . JText::_('CK_WARNING_USERGROUP_FILTERTYPE_BLACKLIST'), 'error'); } // if ($filters[$g]['filter_type'] === 'WL' && strpos($filters[$g]['filter_tags'], 'style') === false) $app->enqueueMessage('PAGE BUILDER CK : ' . JText::_('CK_WARNING_USERGROUP_FILTERTYPE_WHITELIST_NOSTYLE'), 'error'); } } include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/menustyles.php'; include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/stylescss.php'; // include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/ckeditor.php'; include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/pagebuilderck.php'; include_once JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/helpers/ckmodel.php'; // get instance of the editor to load the css / js in the page // $this->ckeditor = PagebuilderckHelper::loadEditor(); // need the tinymce instance for the items edition // Load the editor Tinymce or JCE $editor = $conf->get('pagebuilderck_replaced_editor') == 'jce' ? 'jce' : 'tinymce'; $editor = JEditor::getInstance($editor); $editor->display('ckeditor', $html = '', $width = '', $height = '200px', $col='', $row='', $buttons = true, $id = 'ckeditor'); // Get an instance of the model // JModelLegacy::addIncludePath(JPATH_SITE . '/administrator/components/com_pagebuilderck/models', 'PagebuilderckModel'); $model = Pagebuilderck\CKModel::getInstance('Elements', 'Pagebuilderck'); // $model = $this->getModel('Elements', '', array()); $this->elements = $model->getItems(); str_replace('"', '\"', include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/include.php')); str_replace('"', '\"', include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/submitform.php')); str_replace('"', '\"', include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/menu.php')); str_replace('"', '\"', include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/toolbar.php')); str_replace('"', '\"', include_once(JPATH_ADMINISTRATOR . '/components/com_pagebuilderck/views/page/tmpl/contextmenu.php')); // force the inclusion of the field with the value 1 echo ''; // section specific to content types $iscontenttype = $input->get('iscontenttype', 0, 'int'); // force state with url variable, for debugging purposes $iscontenttype = isset($_GET['iscontenttype']) ? $_GET['iscontenttype'] : $iscontenttype; echo ''; $contenttype = $input->get('contenttype', '', 'string'); /*if ($iscontenttype === 1) { JPluginHelper::importPlugin( 'pagebuilderck' ); ob_start(); Pagebuilderck\CKFof::triggerEvent( 'onPagebuilderckLoadItemContent' . ucfirst($contenttype) ); $contenttypehtml = ob_get_contents(); ob_end_clean(); $contenttypehtml = str_replace("'", "\'", $contenttypehtml); $contenttypehtml = str_replace("\n", "", $contenttypehtml); $contenttypehtml = str_replace("\r", "", $contenttypehtml); } else { $contenttypehtml = ''; }*/ $js1 = " function pbckeditorLoadEditor(name) { var cont = jQuery(name).parent(); // cont.css('display', 'none'); var html = '