/** * Display the settings panel * * @param $wrapper * @param null $errors * * @return void */ public function displaySettingsPanel(XMLElement &$wrapper, $errors = NULL) { // Just load the regular settings panel: parent::displaySettingsPanel($wrapper, $errors); $fieldset = new XMLElement('div', null, array('class' => 'two columns')); // Parent created $label = Widget::Label(null, null, 'column'); $input = Widget::Input('fields[' . $this->get('sortorder') . '][show_created]', 'yes', 'checkbox'); if ($this->get('show_created') == 1) { $input->setAttribute('checked', 'checked'); } $label->setValue(__('<br />%s Only show entries created by the parent entry', array($input->generate()))); $fieldset->appendChild($label); // View picker $label = Widget::Label(__('View'), null, 'column'); $options = array(); $files = glob(EXTENSIONS . '/selectbox_link_field_image/views/view.*.php'); foreach ($files as $file) { require_once $file; $handle = str_replace(array('view.', '.php'), '', basename($file)); $class_name = 'SBLPView_' . ucfirst($handle); /** @var $view SBLPView */ $view = new $class_name(); $options[] = array($handle, $this->get('view') == $handle, $view->getName()); } $label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][view]', $options)); $fieldset->appendChild($label); $wrapper->insertChildAt(4, $fieldset); $fieldset = new XMLElement('div', null, array('class' => 'three columns')); // Create button $label = Widget::Label(null, null, 'column'); $input = Widget::Input('fields[' . $this->get('sortorder') . '][enable_create]', 'yes', 'checkbox'); if ($this->get('enable_create') == 1) { $input->setAttribute('checked', 'checked'); } $label->setValue(__('<br />%s Enable Create button', array($input->generate()))); $fieldset->appendChild($label); // Edit button $label = Widget::Label(null, null, 'column'); $input = Widget::Input('fields[' . $this->get('sortorder') . '][enable_edit]', 'yes', 'checkbox'); if ($this->get('enable_edit') == 1) { $input->setAttribute('checked', 'checked'); } $label->setValue(__('<br />%s Enable Edit button', array($input->generate()))); $fieldset->appendChild($label); // Delete button $label = Widget::Label(null, null, 'column'); $input = Widget::Input('fields[' . $this->get('sortorder') . '][enable_delete]', 'yes', 'checkbox'); if ($this->get('enable_delete') == 1) { $input->setAttribute('checked', 'checked'); } $label->setValue(__('<br />%s Enable Delete button', array($input->generate()))); $fieldset->appendChild($label); $wrapper->insertChildAt(5, $fieldset); }