Current File : /home/aventura/www/site/wp-content/plugins/victheme_timeline/shortcodes/timestart.php |
<?php
/**
* Class extending the Shortcodes base class
* for building the timestart element
*
* how to use :
* [timestart
* direction="top|left|right|bottom|center"
* ]Some text to represent major events[/timestart]
*
* This shortcode must be inside the timeline shortcode
* otherwise it will produce invalid HTML markup
*
* @author jason.xie@victheme.com
*
*/
class VTCore_Timeline_Shortcodes_TimeStart
extends VTCore_Wordpress_Models_Shortcodes
implements VTCore_Wordpress_Interfaces_Shortcodes {
public function buildObject() {
// Convert the bootstrap classes into vc compatible one
$this->convertVCGrid = !get_theme_support('bootstrap');
// Manually build the wrapper
$this->object = new VTCore_Html_Element(array(
'type' => 'li',
'attributes' => array(
'class' => array(
'timeline-items',
),
),
'data' => array(
'timeline' => 'items',
),
));
$object = new VTCore_Timeline_Element_Start($this->atts);
$this->object
->addChildren($object)
->lastChild()
->addChildren(do_shortcode($this->content));
if ($object->getContext('direction')) {
$this->object->addData('direction', $object->getContext('direction'));
}
if ($object->getContext('classtype')) {
$this->object->addData('type', $object->getContext('classtype'));
}
// Free Memory
unset($object);
$object = NULL;
}
}