public function displayArgs($mainNode, $transient_options, $action) { if (!parent::displayArgs($mainNode, $transient_options, $action)) { return false; } if (($relNode = $this->template->getElementByName('relationship', 0, $mainNode)) instanceof DOMNode) { $relationships = I2CE::getConfig()->getKeys("/modules/CustomReports/relationships"); $selected_rel = $this->getField('relationship'); foreach ($relationships as $relationship) { $attrs = array('value' => $relationship); if ($relationship == $selected_rel) { $attrs['selected'] = 'selected'; } $title = false; if (I2CE::getConfig()->setIfIsSet($title, "/modules/CustomReports/relationships/{$relationship}/display_name")) { $attrs['title'] = $title; } $relNode->appendChild($this->template->createElement('option', $attrs, $relationship)); } if ($selected_rel) { $this->template->setDisplayDataImmediate('has_relationship', 1, $mainNode); $this->template->setDisplayDataImmediate('relationship_link', "CustomReports/edit/relationships/" . $selected_rel, $mainNode); } else { $this->template->setDisplayDataImmediate('has_relationship', 0, $mainNode); } } $this->renameInputs(array('relationship'), $mainNode); return true; }
public function displayArgs($mainNode, $transient_options, $action) { // Call I2CE_Swiss_PageArgs->displayArgs() to display the page's title, tasks, and default html files if (!parent::displayArgs($mainNode, $transient_options, $action)) { //parent function failed return false; } $this->template->setDisplayDataImmediate('title', $this->getField('title'), $mainNode); $inputs = array('primary_form', 'form_display_name', 'title'); // Get the page's primary form and add all forms to choose from as a drop down $primaryForm = $this->getField('primary_form'); if (($formsNode = $this->template->getElementByName('primary_form', 0, $mainNode)) instanceof DOMNode) { $forms = I2CE_FormFactory::instance()->getForms(); foreach ($forms as $form) { $attr = array('value' => $form); // Select the primary form by default if there is one if ($form == $primaryForm) { $attr['selected'] = 'selected'; } $formsNode->appendChild($this->template->createElement('option', $attr, $form)); } } // Rename the inputs to include swiss instance path $this->renameInputs($inputs, $mainNode); return true; }
public function displayArgs($mainNode, $transient_options, $action) { // Call I2CE_Swiss_PageArgs->displayArgs() to display the page's title, tasks, and default html files if (!parent::displayArgs($mainNode, $transient_options, $action)) { //parent function failed return false; } $fields = array('il_hwr_host'); foreach ($fields as $field) { $this->template->setDisplayDataImmediate($field, $this->getField($field)); } $this->renameInputs($fields, $mainNode); return true; }