/**
  * @param $uidList
  *
  * @return array|NULL
  */
 protected function loadSlides($uidList)
 {
     /** @var \WMDB\WmdbBaseEwh\DatabaseLayer\Tables\tx_wmdbbaseewh_slide $table */
     $table = DatabaseFactory::getTable('tx_wmdbbaseewh_slide', 'WMDB\\WmdbBaseEwh\\DatabaseLayer\\Tables\\');
     $items = $table->findByUidList($uidList);
     foreach ($items as &$item) {
         $item['image'] = $this->pObj->loadFalData($item, 'image', 'tx_wmdbbaseewh_slide');
         if ($item['style'] == 2) {
             $descriptionParts = GeneralUtility::trimExplode(LF, $item['description'], 1);
             $tmp = array();
             $leftCnt = $rightCnt = 190;
             $itemOffset = 800;
             foreach ($descriptionParts as $key => $part) {
                 $tmp[$key % 2 == 0 ? 'left' : 'right'][] = array('text' => $part, 'offset' => $key % 2 == 0 ? $leftCnt : $rightCnt, 'timeOffset' => $itemOffset);
                 if ($key % 2 == 0) {
                     $leftCnt += 55;
                 } else {
                     $rightCnt += 55;
                 }
                 $itemOffset += 150;
             }
             $item['split'] = $tmp;
         }
     }
     return $items;
 }
 /**
  * This method will be called by the plugin and must return the html-code
  * Use the method "$this->getPObj()->renderContent($data);" to interact with fluid
  *
  * @return string
  */
 public function render()
 {
     $this->pObj->pi_initPIflexForm();
     // Data-array from the content element
     $data = $this->getPObj()->cObj->data;
     $this->table = DatabaseFactory::getTable('tx_wmdbbaseewh_courses', 'WMDB\\WmdbBaseEwh\\DatabaseLayer\\Tables\\');
     $this->sysCategory = DatabaseFactory::getTable('sys_category', 'WMDB\\WmdbBaseEwh\\DatabaseLayer\\Tables\\');
     $this->speaker = DatabaseFactory::getTable('tx_wmdbbaseewh_speaker', 'WMDB\\WmdbBaseEwh\\DatabaseLayer\\Tables\\');
     $this->speakerMileStones = DatabaseFactory::getTable('tx_wmdbbaseewh_speaker_milestones', 'WMDB\\WmdbBaseEwh\\DatabaseLayer\\Tables\\');
     switch ($this->pObj->pi_getFFvalue($data['pi_flexform'], 'what_to_display')) {
         case 0:
             // Teaser
             $data['teaser'] = $this->getDataForTeaser();
             break;
         case 1:
             // List
             $data['list'] = $this->getDataForList();
             break;
         case 2:
             // Meta Information
             $data['meta'] = $this->getDataForMetaInformation();
             break;
         default:
             return $this->getPObj()->renderFlashMessage('Invalid dislay mode detected!', 'The selected display mode "' . htmlspecialchars($this->pObj->pi_getFFvalue($data['pi_flexform'], 'what_to_display')) . '" is not supported!', FlashMessage::ERROR);
     }
     return $this->getPObj()->renderContent($data);
 }
 /**
  * @return array|NULL
  */
 protected function getSpeaker()
 {
     /** @var \WMDB\WmdbBaseEwh\DatabaseLayer\Tables\tx_wmdbbaseewh_speaker $table */
     $table = DatabaseFactory::getTable('tx_wmdbbaseewh_speaker', 'WMDB\\WmdbBaseEwh\\DatabaseLayer\\Tables\\');
     $speakerArray = $table->findAll();
     foreach ($speakerArray as &$speaker) {
         $speaker['image'] = $this->pObj->loadFalData($speaker, 'image', 'tx_wmdbbaseewh_speaker');
     }
     return $speakerArray;
 }
 /**
  * This method will be called by the plugin and must return the html-code
  * Use the method "$this->getPObj()->renderContent($data);" to interact with fluid
  *
  * @return string
  */
 public function render()
 {
     $this->getPObj()->pi_initPIflexForm();
     // Data-array from the content element
     $data = $this->getPObj()->cObj->data;
     $this->ttContent = DatabaseFactory::getTable('tt_content', 'WMDB\\WmdbBaseEwh\\DatabaseLayer\\Tables\\');
     foreach (explode(',', $data['records']) as $recordID) {
         $data['items'][] = $this->getOutput(str_replace('tt_content_', '', $recordID));
     }
     $data['mode'] = $this->getPObj()->pi_getFFvalue($data['pi_flexform'], 'what_to_display');
     return $this->getPObj()->renderContent($data);
 }
 /**
  * @param $uidList
  *
  * @return array|NULL
  * @throws \Exception
  */
 protected function getLinks($uidList)
 {
     /** @var \WMDB\WmdbBaseEwh\DatabaseLayer\Tables\tx_wmdbbaseewh_links $table */
     $table = DatabaseFactory::getTable('tx_wmdbbaseewh_links', 'WMDB\\WmdbBaseEwh\\DatabaseLayer\\Tables\\');
     return $table->findByUidList($uidList);
 }