| 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/saint-martin-lg/plugins/pagebuilderck/timeline/ |
Upload File : |
<?php
/**
* @copyright Copyright (C) 2022 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 plgPagebuilderckTimeline extends \Joomla\CMS\Plugin\CMSPlugin {
private $context = 'PLG_PAGEBUILDERCK_TIMELINE';
private $type = 'timeline';
protected $layout_params;
function __construct(&$subject, $params) {
parent::__construct($subject, $params);
}
public function callAssets() {
// load the files in the page in admin and front
PagebuilderckFrontHelper::addStylesheet(Pagebuilderck\CKUri::root(true) . '/plugins/pagebuilderck/timeline/assets/timeline.css');
}
/*
* Construct the Menu Item to drag into the interface
*
* Return Object with item data
*/
public function onPagebuilderckAddItemToMenu() {
$this->callAssets();
// 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 = Pagebuilderck\CKText::_($this->context . '_MENUITEM_TITLE');
$menuitem->description = Pagebuilderck\CKText::_($this->context . '_MENUITEM_DESC');
$menuitem->image = Pagebuilderck\CKUri::root(true) . '/plugins/pagebuilderck/timeline/assets/images/timeline.svg';
return $menuitem;
}
/*
* Display the html code for the item to be used into the interface
*
* Return String the html code
*/
public function onPagebuilderckLoadItemContentTimeline() {
$input = Pagebuilderck\CKFof::getInput();
$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="timeline">
<div class="ckstyle">
</div>
<div id="<?php echo $id; ?>_timeline" class="pbck_timelines">
<div class="pbck_timeline">
<div class="pbck_timeline_wrap">
<div class="pbck_timeline_dot"></div>
<div class="inner">
<h3><span class="itemtitleck">Section 1</span></h3>
<div class="itemcontentck">
<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>
<div class="pbck_timeline">
<div class="pbck_timeline_wrap">
<div class="pbck_timeline_dot"></div>
<div class="inner">
<h3><span class="itemtitleck">Section 2</span></h3>
<div class="itemcontentck">
<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 class="pbck_timeline">
<div class="pbck_timeline_wrap">
<div class="pbck_timeline_dot"></div>
<div class="inner">
<h3><span class="itemtitleck">Section 3</span></h3>
<div class="itemcontentck">
<p>
Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero
ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis
lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
}
/*
* Load the interface for the item edition
*
* Return String the html code
*/
public function onPagebuilderckLoadItemOptionsTimeline() {
// load the language files of the plugin
$this->loadLanguage();
// load the interface for the options
$tpl = JPATH_SITE . '/plugins/pagebuilderck/timeline/layouts/edit_timeline.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 onPagebuilderckRenderItemTimeline($item) {
$this->callAssets();
$html = $item->innertext;
$layout_attrs = $item->find('.tab_itemtimelinestyles');
$this->layout_params = PagebuilderckFrontHelper::createParamsFromElement($layout_attrs);
$styles = '@media only screen and (max-width:' . (int)$this->layout_params->get('responsiveresolution', '640') . 'px){
#'.$item->attr['id'].' .pbck_timeline {
padding: 65px 0 0 0;
}
#'.$item->attr['id'].' .pbck_timeline, #'.$item->attr['id'].' .pbck_timeline_wrap, #'.$item->attr['id'].' .pbck_timeline_wrap > .inner {
margin: 0;
}
#'.$item->attr['id'].' .pbck_timeline_wrap > .inner:before {
left: 50%;
top: -10px;
right: auto;
margin-left: -10px;
}
#'.$item->attr['id'].' .pbck_timeline_dot {
right: auto;
left: calc(50% + 1px);
margin-left: -8px;
top: -45px;
}
}';
$html = '<div class="ckstyle">
'. $styles . '
</div>'
. $html;
return $html;
}
}