28 $this->_template=include
'templates/tplCarousel.php';
30 if (\is_array($images)) {
41 foreach ($this->slides as $slide){
42 $imgSrc=$slide->getImageSrc();
43 $slide->setImageSrc(str_replace($this->_base.$imgSrc,
$_base.$imgSrc, $imgSrc));
50 $this->_bsComponent=$js->
bootstrap()->carousel(
"#".$this->identifier);
68 $control->setClass($sens.
" carousel-control");
69 $control->setProperty(
"data-slide", substr($caption, 0, 4));
70 $control->setHref(
"#".$this->identifier);
71 $control->setRole(
"button");
72 $control->setCaption(ucfirst($caption));
73 $control->setGlyphIcon($this->
getGlyph($sens));
78 if (array_key_exists($sens, $this->_glyphs))
79 return $this->_glyphs [$sens];
80 return "glyphicon-chevron-".$sens;
84 $glyphs=CssRef::glyphIcons();
85 if (array_search($glyphicon, $glyphs)!==
false)
86 $this->_glyphs [
"right"]=$glyphicon;
90 $glyphs=CssRef::glyphIcons();
91 if (array_search($glyphicon, $glyphs)!==
false)
92 $this->_glyphs [
"left"]=$glyphicon;
95 public function addImage($imageSrc, $imageAlt=
"", $caption=NULL, $description=NULL) {
96 if(\is_array($imageSrc)){
97 $this->
addImage($imageSrc[0],@$imageSrc[1],@$imageSrc[2],@$imageSrc[3]);
100 $image->setImageSrc($this->_base.$imageSrc);
101 $image->setImageAlt($imageAlt);
102 $image->setClass(
"item");
103 if (isset($caption)) {
104 $optCaption=
"<h3>".$caption.
"</h3>";
105 if (isset($description)) {
106 $optCaption.=
"<p>".$description.
"</p>";
108 $image->setCaption($optCaption);
110 $this->slides []=$image;
120 if (\is_array($array) &&
sizeof($array)>0) {
121 foreach ( $array as $value ) {
122 if (\is_array($value)) {
123 $this->
addImage($value [
"src"], @$value [
"alt"], @$value [
"caption"], @$value [
"description"]);
134 $indicator->setProperty(
"data-target",
"#".$this->identifier);
135 $indicator->setProperty(
"data-slide-to",
sizeof($this->indicators));
136 $indicator->setTagName(
"li");
137 $this->indicators []=$indicator;
145 $this->slides [0]->setClass(
"item active");
146 $this->indicators [0]->setClass(
"active");
148 return parent::compile($js, $view);
156 $this->
addImage($function($object));
bootstrap(Bootstrap $bootstrap=NULL)
getter or setter of the Twitter Bootstrap variable
Composant Twitter Bootstrap Carousel.
setRightGlyph($glyphicon)
compile(JsUtils $js=NULL, &$view=NULL)
__construct($identifier, $images=NULL)
addImage($imageSrc, $imageAlt="", $caption=NULL, $description=NULL)
createControl($caption="next", $sens="left")
fromDatabaseObject($object, $function)
Default HTML values for Twitter Bootstrap HTML components.
BaseHtml for HTML components.
addEventsOnRun(JsUtils $js=NULL)