Esempio n. 1
0
     } else {
         $item['transition_duration'] *= 1000;
     }
     /**
      * Here we set a SliderItem object with the information provided and
      * insert it into the Slider object previously created.
      */
     $sldItem = new \CEOS\Slider\SliderItem();
     if (isset($item['id']) && is_numeric($item['id'])) {
         $sldItem->loadFromDatabase($item['id']);
     }
     $sldItem->setPosition($pos);
     $sldItem->setTitle(@$item['title']);
     $sldItem->setDescription(@$item['desc']);
     $sldItem->setURL(@$item['url']);
     $sldItem->setTransitionName(@$item['transition']);
     if (isset($item['transition-dur']) && is_numeric($item['transition-dur'])) {
         $sldItem->setTransitionDuration($item['transition-dur'] * 1000);
     }
     if (isset($item['interval']) && is_numeric($item['interval'])) {
         $sldItem->setInterval($item['interval'] * 1000);
     }
     if (isset($item['img']['src']) && !empty($item['img']['src'])) {
         $sldItem->setImageSource($item['img']['src']);
     }
     if (isset($item['slider-id']) && is_numeric($item['slider-id'])) {
         $sldItem->setSliderID($item['slider-id']);
     }
     $slider->addItem($sldItem);
 }
 /**