当前位置: 首页>>代码示例>>PHP>>正文


PHP field::displaySettingsPanel方法代码示例

本文整理汇总了PHP中field::displaySettingsPanel方法的典型用法代码示例。如果您正苦于以下问题:PHP field::displaySettingsPanel方法的具体用法?PHP field::displaySettingsPanel怎么用?PHP field::displaySettingsPanel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在field的用法示例。


在下文中一共展示了field::displaySettingsPanel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displaySettingsPanel

 public function displaySettingsPanel(&$wrapper, $errors = null)
 {
     field::displaySettingsPanel($wrapper, $errors);
     // ## bucket Folder
     // $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(__('Bucket'));
     try {
         $buckets = $this->S3->listBuckets();
     } catch (Exception $e) {
     }
     $options = array();
     if (!empty($buckets) && is_array($buckets)) {
         foreach ($buckets as $b) {
             $options[] = array($b, $this->get('bucket') == $b, $b);
         }
     }
     $label->appendChild(Widget::Select('fields[' . $this->get('sortorder') . '][bucket]', $options));
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     if (isset($errors['bucket'])) {
         $div->appendChild(Widget::Error($label, $errors['bucket']));
     } else {
         $div->appendChild($label);
     }
     $label = Widget::Label(__('CNAME'));
     $label->appendChild(new XMLElement('i', __('Optional')));
     $label->appendChild(Widget::Input('fields[' . $this->get('sortorder') . '][cname]', htmlspecialchars($this->get('cname'))));
     if (isset($errors['cname'])) {
         $div->appendChild(Widget::Error($label, $errors['cname']));
     } else {
         $div->appendChild($label);
     }
     $wrapper->appendChild($div);
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     $this->buildValidationSelect($wrapper, $this->get('validator'), 'fields[' . $this->get('sortorder') . '][validator]', 'upload');
     $setting = new XMLElement('label', '<input name="fields[' . $this->get('sortorder') . '][ssl_option]" value="1" type="checkbox"' . ($this->get('ssl_option') != 0 || $this->get('ssl_option') == null ? ' checked="checked"' : '') . '/> ' . __('Build links using https://'));
     $div->appendChild($setting);
     $setting = new XMLElement('label', '<input name="fields[' . $this->get('sortorder') . '][unique_filename]" value="1" type="checkbox"' . ($this->get('unique_filename') != 0 || $this->get('unique_filename') == null ? ' checked="checked"' : '') . '/> ' . __('Automatically give the files a unique filename'));
     $div->appendChild($setting);
     $wrapper->appendChild($div);
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     $setting = new XMLElement('label', '<input name="fields[' . $this->get('sortorder') . '][remove_from_bucket]" value="1" type="checkbox"' . ($this->get('remove_from_bucket') != 0 || $this->get('remove_from_bucket') == null ? ' checked="checked"' : '') . '/> ' . __('Remove file from S3 upon deletion of entry'));
     $div->appendChild($setting);
     $this->appendRequiredCheckbox($div);
     $wrapper->appendChild($div);
     $div = new XMLElement('div', NULL, array('class' => 'group'));
     $this->appendShowColumnCheckbox($div);
     $wrapper->appendChild($div);
 }
开发者ID:jdsimcoe,项目名称:s3upload_field,代码行数:55,代码来源:field.s3upload.php

示例2: displaySettingsPanel

 function displaySettingsPanel(XMLElement &$wrapper, $errors = null)
 {
     // Initialize field settings based on class defaults (name, placement)
     field::displaySettingsPanel($wrapper, $errors);
     /*-----------------------------------------------------------------------*/
     $columns = new XMLElement('div', null, array('class' => 'two columns'));
     $wrapper->appendChild($columns);
     // Prepopulation
     $checkbox = Widget::Input('fields[' . $this->get('sortorder') . '][prepopulate]', 'yes', 'checkbox');
     if ((int) $this->get('prepopulate') === 1) {
         $checkbox->setAttribute('checked', 'checked');
     }
     $setting = new XMLElement('label', __('%s Pre-populate with current date', array($checkbox->generate())), array('class' => 'column'));
     $columns->appendChild($setting);
     // Time
     $checkbox = Widget::Input('fields[' . $this->get('sortorder') . '][time]', 'yes', 'checkbox');
     if ((int) $this->get('time') === 1) {
         $checkbox->setAttribute('checked', 'checked');
     }
     $setting = new XMLElement('label', __('%s Display time', array($checkbox->generate())), array('class' => 'column'));
     $columns->appendChild($setting);
     // Multiple dates
     $checkbox = Widget::Input('fields[' . $this->get('sortorder') . '][multiple]', 'yes', 'checkbox');
     if ((int) $this->get('multiple') === 1) {
         $checkbox->setAttribute('checked', 'checked');
     }
     $setting = new XMLElement('label', __('%s Allow multiple dates', array($checkbox->generate())), array('class' => 'column'));
     $columns->appendChild($setting);
     // Date ranges
     $checkbox = Widget::Input('fields[' . $this->get('sortorder') . '][range]', 'yes', 'checkbox');
     if ((int) $this->get('range') === 1) {
         $checkbox->setAttribute('checked', 'checked');
     }
     $setting = new XMLElement('label', __('%s Enable date ranges', array($checkbox->generate())), array('class' => 'column'));
     $columns->appendChild($setting);
     /*-----------------------------------------------------------------------*/
     // General
     $fieldset = new XMLElement('fieldset');
     $group = new XMLElement('div', NULL, array('class' => 'two columns'));
     $this->appendRequiredCheckbox($group);
     $this->appendShowColumnCheckbox($group);
     $fieldset->appendChild($group);
     $wrapper->appendChild($fieldset);
 }
开发者ID:Vandenberg,项目名称:datetime,代码行数:44,代码来源:field.datetime.php


注:本文中的field::displaySettingsPanel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。