本文整理汇总了PHP中Field::displaySettingsPanel方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::displaySettingsPanel方法的具体用法?PHP Field::displaySettingsPanel怎么用?PHP Field::displaySettingsPanel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field::displaySettingsPanel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displaySettingsPanel
function displaySettingsPanel(&$wrapper, $errors = NULL)
{
parent::displaySettingsPanel($wrapper, $errors);
$label = Widget::Label(__('URL Expression'));
$label->appendChild(Widget::Input('fields[' . $this->get('sortorder') . '][url_expression]', $this->get('url_expression')));
$wrapper->appendChild($label);
}
示例2: displaySettingsPanel
function displaySettingsPanel(&$wrapper, $errors = NULL)
{
// Initialize field settings based on class defaults (name, placement)
parent::displaySettingsPanel($wrapper, $errors);
// Field Number Chooser
$fieldset = new XMLElement('fieldset');
if (!$this->get('id') && $errors == NULL) {
$this->set('fieldcount', 2);
$group = new XMLElement('label', 'Number of text inputs per row<i>IMPORTANT: This cannot be changed once you save!</i><input name="fields[' . $this->get('sortorder') . '][fieldcount]" type="text" value="' . $this->get('fieldcount') . '" />');
} else {
$this->get('fieldcount');
$group = new XMLElement('label', 'Number of text inputs per row<i>Database table created. This value can no longer be changed.</i><input name="fields[' . $this->get('sortorder') . '][fielddisplay]" type="text" disabled="disabled" value="' . $this->get('fieldcount') . '" /><input name="fields[' . $this->get('sortorder') . '][fieldcount]" type="hidden" value="' . $this->get('fieldcount') . '" />');
}
$fieldset->appendChild($group);
$wrapper->appendChild($fieldset);
// Behaviour
$fieldset = Stage::displaySettings($this->get('id'), $this->get('sortorder'), __('Behaviour'), array('constructable', 'draggable'));
$group = $fieldset->getChildren();
$wrapper->appendChild($fieldset);
// Add Custom Schema option
$fieldset = new XMLElement('fieldset', '<legend>Advanced</legend>');
$group = new XMLElement('label', 'Custom Schema<i>Optional. Read the documentation before putting anything here!</i>');
$group->appendChild(Widget::Input('fields[' . $this->get('sortorder') . '][schema]', $this->get('schema')));
$fieldset->appendChild($group);
$wrapper->appendChild($fieldset);
// General
$fieldset = new XMLElement('fieldset');
$group = new XMLElement('div', NULL, array('class' => 'group'));
$this->appendRequiredCheckbox($group);
$this->appendShowColumnCheckbox($group);
$fieldset->appendChild($group);
$wrapper->appendChild($fieldset);
}
示例3: displaySettingsPanel
public function displaySettingsPanel(&$wrapper, $errors = null)
{
parent::displaySettingsPanel($wrapper, $errors);
## Destination Folder
$ignore = array('/workspace/events', '/workspace/data-sources', '/workspace/text-formatters', '/workspace/pages', '/workspace/utilities');
$directories = General::listDirStructure(WORKSPACE, null, true, DOCROOT, $ignore);
$label = Widget::Label(__('Destination Directory'));
$options = array();
$options[] = array('/workspace', false, '/workspace');
if (!empty($directories) && is_array($directories)) {
foreach ($directories as $d) {
$d = '/' . trim($d, '/');
if (!in_array($d, $ignore)) {
$options[] = array($d, $this->get('destination') == $d, $d);
}
}
}
$label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][destination]', $options));
if (isset($errors['destination'])) {
$wrapper->appendChild(Widget::wrapFormElementWithError($label, $errors['destination']));
} else {
$wrapper->appendChild($label);
}
$this->buildValidationSelect($wrapper, $this->get('validator'), 'fields[' . $this->get('sortorder') . '][validator]', 'upload');
$div = new XMLElement('div', NULL, array('class' => 'compact'));
$this->appendRequiredCheckbox($div);
$this->appendShowColumnCheckbox($div);
$wrapper->appendChild($div);
}
示例4: displaySettingsPanel
public function displaySettingsPanel(&$wrapper, $errors = null)
{
parent::displaySettingsPanel($wrapper, $errors);
$order = $this->get('sortorder');
// Expression
$div = new XMLElement('div');
$label = Widget::Label(__('Expression'));
$label->appendChild(Widget::Input("fields[{$order}][expression]", $this->get('expression')));
$help = new XMLElement('p');
$help->setAttribute('class', 'help');
$help->setValue(__('To access the other fields, use XPath: <code>{entry/field-one} static text {entry/field-two}</code>.'));
$div->appendChild($label);
$div->appendChild($help);
$wrapper->appendChild($div);
// Visibility settings
$group = new XMLElement('div');
$group->setAttribute('class', 'two columns');
$label = Widget::Label();
$label->setAttribute('class', 'column');
$input = Widget::Input("fields[{$order}][hide]", 'yes', 'checkbox');
if ($this->get('hide') == 'yes') {
$input->setAttribute('checked', 'checked');
}
$label->setValue($input->generate() . __(' Hide this field on publish page'));
$group->appendChild($label);
$this->appendShowColumnCheckbox($group);
$wrapper->appendChild($group);
}
示例5: displaySettingsPanel
/**
* Displays setting panel in section editor.
*
* @param XMLElement $wrapper - parent element wrapping the field
* @param array $errors - array with field errors, $errors['name-of-field-element']
*/
function displaySettingsPanel(&$wrapper, $errors = NULL)
{
// initialize field settings based on class defaults (name, placement)
parent::displaySettingsPanel($wrapper, $errors);
$this->appendShowColumnCheckbox($wrapper);
// format
$label = new XMLElement('label', __('Date format') . '<i>' . __('Use comma to separate date and time') . '</i>');
$label->appendChild(Widget::Input('fields[' . $this->get('sortorder') . '][format]', $this->get('format') ? $this->get('format') : 'd MMMM yyyy, HH:mm'));
$wrapper->appendChild($label);
// prepopulate
$label = Widget::Label();
$input = Widget::Input('fields[' . $this->get('sortorder') . '][prepopulate]', 'yes', 'checkbox');
if ($this->get('prepopulate') != 'no') {
$input->setAttribute('checked', 'checked');
}
$label->setValue(__('%s Pre-populate this field with today\'s date', array($input->generate())));
$wrapper->appendChild($label);
// allow multiple
$label = Widget::Label();
$input = Widget::Input('fields[' . $this->get('sortorder') . '][allow_multiple_dates]', 'yes', 'checkbox');
if ($this->get('allow_multiple_dates') != 'no') {
$input->setAttribute('checked', 'checked');
}
$label->setValue(__('%s Allow multiple dates', array($input->generate())));
$wrapper->appendChild($label);
}
示例6: displaySettingsPanel
public function displaySettingsPanel(XMLElement &$wrapper, $errors = null)
{
parent::displaySettingsPanel($wrapper, $errors);
// Destination Folder
$ignore = array('/workspace/events', '/workspace/data-sources', '/workspace/text-formatters', '/workspace/pages', '/workspace/utilities');
$directories = General::listDirStructure(WORKSPACE, null, true, DOCROOT, $ignore);
$label = Widget::Label(__('Destination Directory'));
$options = array();
$options[] = array('/workspace', false, '/workspace');
if (!empty($directories) && is_array($directories)) {
foreach ($directories as $d) {
$d = '/' . trim($d, '/');
if (!in_array($d, $ignore)) {
$options[] = array($d, $this->get('destination') == $d, $d);
}
}
}
$label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][destination]', $options));
if (isset($errors['destination'])) {
$wrapper->appendChild(Widget::Error($label, $errors['destination']));
} else {
$wrapper->appendChild($label);
}
// Validation rule
$this->buildValidationSelect($wrapper, $this->get('validator'), 'fields[' . $this->get('sortorder') . '][validator]', 'upload', $errors);
// Requirements and table display
$this->appendStatusFooter($wrapper);
}
示例7: displaySettingsPanel
public function displaySettingsPanel(&$wrapper, $errors = NULL)
{
parent::displaySettingsPanel($wrapper, $errors);
$sectionManager = new SectionManager($this->_engine);
$sections = $sectionManager->fetch(NULL, 'ASC', 'sortorder');
$options = array();
// iterate over sections to build list of fields
if (is_array($sections) && !empty($sections)) {
foreach ($sections as $section) {
$section_fields = $section->fetchFields();
if (!is_array($section_fields)) {
continue;
}
$fields = array();
foreach ($section_fields as $f) {
// only show select box link fields
if ($f->get('type') == 'selectbox_link') {
$fields[] = array($f->get('id'), $this->get('related_sbl_id') == $f->get('id'), $f->get('label'));
}
}
if (!empty($fields)) {
$options[] = array('label' => $section->get('name'), 'options' => $fields);
}
}
}
$group = new XMLElement('div', NULL, array('class' => 'group'));
$label = Widget::Label(__('Child Select Box Link'));
$label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][related_sbl_id]', $options));
if (isset($errors['related_sbl_id'])) {
$group->appendChild(Widget::wrapFormElementWithError($label, $errors['related_sbl_id']));
} else {
$group->appendChild($label);
}
$wrapper->appendChild($group);
}
示例8: displaySettingsPanel
function displaySettingsPanel(&$wrapper, $errors = NULL)
{
Field::displaySettingsPanel($wrapper, $errors);
$div = new XMLElement('div', NULL, array('class' => 'group'));
$ignore = array('/workspace/events', '/workspace/data-sources', '/workspace/text-formatters', '/workspace/pages', '/workspace/utilities');
$directories = General::listDirStructure(WORKSPACE, NULL, 'asc', DOCROOT, $ignore);
$label = Widget::Label(__('Destination Directory'));
$options = array();
$options[] = array('/workspace', false, '/workspace');
if (!empty($directories) && is_array($directories)) {
foreach ($directories as $d) {
$d = '/' . trim($d, '/');
if (!in_array($d, $ignore)) {
$options[] = array($d, $this->get('destination') == $d, $d);
}
}
}
$label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][destination]', $options));
if (isset($errors['destination'])) {
$wrapper->appendChild(Widget::wrapFormElementWithError($label, $errors['destination']));
} else {
$wrapper->appendChild($label);
}
$this->appendRequiredCheckbox($wrapper);
$label = Widget::Label();
$input = Widget::Input('fields[' . $this->get('sortorder') . '][allow_multiple_selection]', 'yes', 'checkbox');
if ($this->get('allow_multiple_selection') == 'yes') {
$input->setAttribute('checked', 'checked');
}
$label->setValue(__('%s Allow selection of multiple options', array($input->generate())));
$wrapper->appendChild($label);
$this->appendShowColumnCheckbox($wrapper);
}
示例9: displaySettingsPanel
public function displaySettingsPanel(&$wrapper, $errors = null)
{
parent::displaySettingsPanel($wrapper, $errors);
$document = $wrapper->ownerDocument;
$options_list = $document->createElement('ul');
$options_list->setAttribute('class', 'options-list');
$this->appendShowColumnCheckbox($options_list);
$this->appendRequiredCheckbox($options_list);
## Allow multiple selection
$label = Widget::Label(__('Allow selection of multiple users'));
$input = Widget::Input('allow-multiple-selection', 'yes', 'checkbox');
if ($this->{'allow-multiple-selection'} == 'yes') {
$input->setAttribute('checked', 'checked');
}
$label->prependChild($input);
$item = $document->createElement('li');
$item->appendChild($label);
$options_list->appendChild($item);
## Default to current logged in user
$label = Widget::Label(__('Select current user by default'));
$input = Widget::Input('default-to-current-user', 'yes', 'checkbox');
if ($this->{'default-to-current-user'} == 'yes') {
$input->setAttribute('checked', 'checked');
}
$label->prependChild($input);
$item = $document->createElement('li');
$item->appendChild($label);
$options_list->appendChild($item);
$wrapper->appendChild($options_list);
}
示例10: displaySettingsPanel
/**
* @see http://symphony-cms.com/learn/api/2.2/toolkit/field/#displaySettingsPanel
*/
function displaySettingsPanel(&$wrapper, $errors = NULL)
{
// Initialize field settings based on class defaults (name, placement)
parent::displaySettingsPanel($wrapper, $errors);
/*-----------------------------------------------------------------------*/
// Behaviour
$fieldset = Stage::displaySettings($this->get('id'), $this->get('sortorder'), __('Behaviour'), array('constructable', 'draggable'));
$group = $fieldset->getChildren();
// Handle missing settings
if (!$this->get('id') && $errors == NULL) {
$this->set('prepopulate', 1);
$this->set('time', 1);
$this->set('range', 1);
}
// Time
$setting = new XMLElement('label', '<input name="fields[' . $this->get('sortorder') . '][time]" value="yes" type="checkbox"' . ($this->get('time') == 0 ? '' : ' checked="checked"') . '/> ' . __('Allow time editing') . ' <i>' . __('This will display date and time in the interface') . '</i>');
$group[0]->appendChild($setting);
// Ranges
$setting = new XMLElement('label', '<input name="fields[' . $this->get('sortorder') . '][range]" value="yes" type="checkbox"' . ($this->get('range') == 0 ? '' : ' checked="checked"') . '/> ' . __('Allow date ranges') . ' <i>' . __('This will enable range editing') . '</i>');
$group[0]->appendChild($setting);
// Prepopulate
$setting = new XMLElement('label', '<input name="fields[' . $this->get('sortorder') . '][prepopulate]" value="yes" type="checkbox"' . ($this->get('prepopulate') == 0 ? '' : ' checked="checked"') . '/> ' . __('Pre-populate field') . ' <i>' . __('This will automatically add the current date to new entries') . '</i>');
$group[0]->appendChild($setting);
// Append behaviour settings
$wrapper->appendChild($fieldset);
/*-----------------------------------------------------------------------*/
// General
$fieldset = new XMLElement('fieldset');
$group = new XMLElement('div', NULL, array('class' => 'group'));
$this->appendRequiredCheckbox($group);
$this->appendShowColumnCheckbox($group);
$fieldset->appendChild($group);
$wrapper->appendChild($fieldset);
}
示例11: displaySettingsPanel
public function displaySettingsPanel(&$wrapper, $errors = null)
{
parent::displaySettingsPanel($wrapper, $errors);
$order = $this->get('sortorder');
// Destination --------------------------------------------------------
$ignore = array('events', 'data-sources', 'text-formatters', 'pages', 'utilities');
$directories = General::listDirStructure(WORKSPACE, true, 'asc', DOCROOT, $ignore);
$label = Widget::Label('Destination Directory');
$options = array(array('/workspace', false, '/workspace'));
if (!empty($directories) and is_array($directories)) {
foreach ($directories as $d) {
$d = '/' . trim($d, '/');
if (!in_array($d, $ignore)) {
$options[] = array($d, $this->get('destination') == $d, $d);
}
}
}
$label->appendChild(Widget::Select("fields[{$order}][destination]", $options));
if (isset($errors['destination'])) {
$label = Widget::wrapFormElementWithError($label, $errors['destination']);
}
$wrapper->appendChild($label);
// Validator ----------------------------------------------------------
$this->buildValidationSelect($wrapper, $this->get('validator'), "fields[{$order}][validator]", 'upload');
$this->appendRequiredCheckbox($wrapper);
$this->appendShowColumnCheckbox($wrapper);
}
示例12: displaySettingsPanel
public function displaySettingsPanel(&$wrapper, $errors = null)
{
parent::displaySettingsPanel($wrapper, $errors);
$order = $this->get('sortorder');
$label = Widget::Label('Anchor URL (XPath expression)');
$label->appendChild(Widget::Input("fields[{$order}][expression]", $this->get('expression')));
$help = new XMLElement('p', 'To access the other fields, use XPath: <code>{entry/field-one} static text {entry/field-two}</code>.');
$help->setAttribute('class', 'help');
$wrapper->appendChild($label);
$label = Widget::Label();
$input = Widget::Input("fields[{$order}][new_window]", 'yes', 'checkbox');
if ($this->get('new_window') == 'yes') {
$input->setAttribute('checked', 'checked');
}
$label->setValue($input->generate() . ' Open links in a new window');
$wrapper->appendChild($label);
$label = Widget::Label();
$input = Widget::Input("fields[{$order}][hide]", 'yes', 'checkbox');
if ($this->get('hide') == 'yes') {
$input->setAttribute('checked', 'checked');
}
$label->setValue($input->generate() . ' Hide this field on publish page');
$wrapper->appendChild($label);
$this->appendShowColumnCheckbox($wrapper);
}
示例13: displaySettingsPanel
public function displaySettingsPanel(SymphonyDOMElement $wrapper, MessageStack $errors)
{
parent::displaySettingsPanel($wrapper, $errors);
$document = $wrapper->ownerDocument;
/*---------------------------------------------------------------------
Text Formatter
---------------------------------------------------------------------*/
$this->appendFormatterSelect($wrapper, $this->{'text-formatter'}, 'text-formatter');
/*---------------------------------------------------------------------
Validator
---------------------------------------------------------------------*/
$this->appendValidationSelect($wrapper, $this->{'text-validator'}, 'text-validator');
/*---------------------------------------------------------------------
Options
---------------------------------------------------------------------*/
$options_list = $document->createElement('ul');
$options_list->setAttribute('class', 'options-list');
$this->appendShowColumnCheckbox($options_list);
$this->appendRequiredCheckbox($options_list);
$label = Widget::Label(__('Output with handles'));
$input = Widget::Input('text-handle', 'yes', 'checkbox');
if ($this->{'text-handle'} == 'yes') {
$input->setAttribute('checked', 'checked');
}
$label->prependChild($input);
$item = $document->createElement('li');
$item->appendChild($label);
$options_list->appendChild($item);
$wrapper->appendChild($options_list);
}
示例14: displaySettingsPanel
public function displaySettingsPanel(&$wrapper, $errors = NULL)
{
parent::displaySettingsPanel($wrapper, $errors);
$label = Widget::Label(__('Start Number'));
$label->appendChild(WIDGET::Input('fields[' . $this->get('sortorder') . '][start_number]', $this->get('start_number')));
$wrapper->appendChild($label);
$this->appendShowColumnCheckbox($wrapper);
}
示例15: displaySettingsPanel
public function displaySettingsPanel(XMLElement &$wrapper, $errors = null)
{
parent::displaySettingsPanel($wrapper, $errors);
// Validation rule
$this->buildValidationSelect($wrapper, $this->get('validator'), 'fields[' . $this->get('sortorder') . '][validator]', 'input', $errors);
// Requirements and table display
$this->appendStatusFooter($wrapper);
}