/** * Process the page's parameters. This is used to extract the page id * and set the associated data source to the id of the Page Fields section * for it. * * @param array env The parameters. */ function processParameters($env = NULL) { // Get the handle of the PF section associated with the page. // $pageId = $env['param']['current-page-id']; $pageFieldsSectionHandle = Lang::createHandle(PF_SECTION_TITLE_PREFIX . $pageId); // Retrieve and store the Id of the section so we can return it from getSource() // $sectionManager = new SectionManager($this->_Parent); $this->pageFieldsSectionId = $sectionManager->fetchIDFromHandle($pageFieldsSectionHandle); // Initialise $dsParamINCLUDEDELEMENTS with the names of all fields for the section. // $fieldNames = $this->_Parent->Database->fetchCol('element_name', "SELECT `element_name` FROM `tbl_fields` WHERE `parent_section` = '{$this->pageFieldsSectionId}'"); $this->dsParamINCLUDEDELEMENTS = array(); if (is_array($fieldNames) && !empty($fieldNames)) { foreach ($fieldNames as $elementName) { $this->dsParamINCLUDEDELEMENTS[] = $elementName; } } // Call parent class implementation. // parent::processParameters($env); }