/** * Get all elements linked to a specific section * * @param int $sectionId Id of the queried section. * @param int $langId Id of the current language. * @param bool $all If true then loading elements not creating a new one * * @return string $html The html format to display current element in section */ public function getElements($sectionId, $langId, $all = false) { $html = ''; $elements = $this->_selectelements($sectionId, true); $oQuestion = new FormQuestionObject(); $oText = new FormTextObject(); //Get associated data according to the type foreach ($elements as $index => $element) { //if Question if ($element['FE_TypeID'] == '2') { $question = $oQuestion->show($element[$this->_dataId], null, $langId, $element['FE_Seq']); // Include data into the element $elements[$index]['questions'] = $question; // or if text zone } elseif ($element['FE_TypeID'] == '1') { $textZone = $oText->getTexts($element['FE_ID'], $langId); // Include data into the element $elements[$index]['textzone'] = $textZone; } } return $elements; }