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


PHP DateTimeObj::getDateFormatsSelectOptions方法代码示例

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


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

示例1: viewConfiguration

 protected function viewConfiguration()
 {
     /* -----------------------------------------------
      * Populating fields array
      * -----------------------------------------------
      */
     $fields = isset($_POST['fields']) ? $_POST['fields'] : $this->_params['default-config'];
     /* -----------------------------------------------
      * Welcome
      * -----------------------------------------------
      */
     $div = new XMLElement('div');
     $div->appendChild(new XMLElement('h2', __('Find something sturdy to hold on to because things are about to get awesome.')));
     $div->appendChild(new XMLElement('p', __('Think of this as a pre-game warm up. You know you’re going to kick-ass, so you’re savouring every moment before the show. Welcome to the Symphony install page.')));
     $this->Form->appendChild($div);
     if (!empty($this->_params['errors'])) {
         $this->Form->appendChild(Widget::Error(new XMLElement('p'), __('Oops, a minor hurdle on your path to glory! There appears to be something wrong with the details entered below.')));
     }
     /* -----------------------------------------------
      * Environment settings
      * -----------------------------------------------
      */
     $fieldset = new XMLElement('fieldset');
     $div = new XMLElement('div');
     $this->__appendError(array('no-write-permission-root', 'no-write-permission-workspace'), $div);
     if ($div->getNumberOfChildren() > 0) {
         $fieldset->appendChild($div);
         $this->Form->appendChild($fieldset);
     }
     /* -----------------------------------------------
      * Website & Locale settings
      * -----------------------------------------------
      */
     $Environment = new XMLElement('fieldset');
     $Environment->appendChild(new XMLElement('legend', __('Website Preferences')));
     $label = Widget::Label(__('Name'), Widget::Input('fields[general][sitename]', $fields['general']['sitename']));
     $this->__appendError(array('general-no-sitename'), $label);
     $Environment->appendChild($label);
     $label = Widget::Label(__('Admin Path'), Widget::Input('fields[symphony][admin-path]', $fields['symphony']['admin-path']));
     $this->__appendError(array('no-symphony-path'), $label);
     $Environment->appendChild($label);
     $Fieldset = new XMLElement('fieldset', null, array('class' => 'frame'));
     $Fieldset->appendChild(new XMLElement('legend', __('Date and Time')));
     $Fieldset->appendChild(new XMLElement('p', __('Customise how Date and Time values are displayed throughout the Administration interface.')));
     // Timezones
     $options = DateTimeObj::getTimezonesSelectOptions(isset($fields['region']['timezone']) && !empty($fields['region']['timezone']) ? $fields['region']['timezone'] : date_default_timezone_get());
     $Fieldset->appendChild(Widget::Label(__('Region'), Widget::Select('fields[region][timezone]', $options)));
     // Date formats
     $options = DateTimeObj::getDateFormatsSelectOptions($fields['region']['date_format']);
     $Fieldset->appendChild(Widget::Label(__('Date Format'), Widget::Select('fields[region][date_format]', $options)));
     // Time formats
     $options = DateTimeObj::getTimeFormatsSelectOptions($fields['region']['time_format']);
     $Fieldset->appendChild(Widget::Label(__('Time Format'), Widget::Select('fields[region][time_format]', $options)));
     $Environment->appendChild($Fieldset);
     $this->Form->appendChild($Environment);
     /* -----------------------------------------------
      * Database settings
      * -----------------------------------------------
      */
     $Database = new XMLElement('fieldset');
     $Database->appendChild(new XMLElement('legend', __('Database Connection')));
     $Database->appendChild(new XMLElement('p', __('Please provide Symphony with access to a database.')));
     // Database name
     $label = Widget::Label(__('Database'), Widget::Input('fields[database][db]', $fields['database']['db']));
     $this->__appendError(array('database-incorrect-version', 'unknown-database'), $label);
     $Database->appendChild($label);
     // Database credentials
     $Div = new XMLElement('div', null, array('class' => 'two columns'));
     $Div->appendChild(Widget::Label(__('Username'), Widget::Input('fields[database][user]', $fields['database']['user']), 'column'));
     $Div->appendChild(Widget::Label(__('Password'), Widget::Input('fields[database][password]', $fields['database']['password'], 'password'), 'column'));
     $this->__appendError(array('database-invalid-credentials'), $Div);
     $Database->appendChild($Div);
     // Advanced configuration
     $Fieldset = new XMLElement('fieldset', null, array('class' => 'frame'));
     $Fieldset->appendChild(new XMLElement('legend', __('Advanced Configuration')));
     $Fieldset->appendChild(new XMLElement('p', __('Leave these fields unless you are sure they need to be changed.')));
     // Advanced configuration: Host, Port
     $Div = new XMLElement('div', null, array('class' => 'two columns'));
     $Div->appendChild(Widget::Label(__('Host'), Widget::Input('fields[database][host]', $fields['database']['host']), 'column'));
     $Div->appendChild(Widget::Label(__('Port'), Widget::Input('fields[database][port]', $fields['database']['port']), 'column'));
     $this->__appendError(array('no-database-connection'), $Div);
     $Fieldset->appendChild($Div);
     // Advanced configuration: Table Prefix
     $label = Widget::Label(__('Table Prefix'), Widget::Input('fields[database][tbl_prefix]', $fields['database']['tbl_prefix']));
     $this->__appendError(array('database-table-prefix'), $label);
     $Fieldset->appendChild($label);
     $Database->appendChild($Fieldset);
     $this->Form->appendChild($Database);
     /* -----------------------------------------------
      * Permission settings
      * -----------------------------------------------
      */
     $Permissions = new XMLElement('fieldset');
     $Permissions->appendChild(new XMLElement('legend', __('Permission Settings')));
     $Permissions->appendChild(new XMLElement('p', __('Set the permissions Symphony uses when saving files/directories.')));
     $Div = new XMLElement('div', null, array('class' => 'two columns'));
     $Div->appendChild(Widget::Label(__('Files'), Widget::Input('fields[file][write_mode]', $fields['file']['write_mode']), 'column'));
     $Div->appendChild(Widget::Label(__('Directories'), Widget::Input('fields[directory][write_mode]', $fields['directory']['write_mode']), 'column'));
     $Permissions->appendChild($Div);
     $this->Form->appendChild($Permissions);
//.........这里部分代码省略.........
开发者ID:jurajkapsz,项目名称:symphony-2,代码行数:101,代码来源:class.installerpage.php


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