示例#1
0
 /**
  * Returns the time in local and GMT.
  */
 public function timeAction()
 {
     $this->setCacheLifetime(0);
     // Re-enable session management for this API function.
     \DF\Session::enable();
     $tz_info = \PVL\Timezone::getInfo();
     return $this->returnSuccess(array('timestamp' => time(), 'gmt_datetime' => $tz_info['now_utc']->format('Y-m-d g:i:s'), 'gmt_date' => $tz_info['now_utc']->format('F j, Y'), 'gmt_time' => $tz_info['now_utc']->format('g:ia'), 'gmt_timezone' => 'GMT', 'gmt_timezone_abbr' => 'GMT', 'local_datetime' => $tz_info['now']->format('Y-m-d g:i:s'), 'local_date' => $tz_info['now']->format('F j, Y'), 'local_time' => $tz_info['now']->format('g:ia'), 'local_timezone' => $tz_info['code'], 'local_timezone_abbr' => $tz_info['abbr']));
 }
示例#2
0
<?php

/**
 * Profile Form
 */
$di = \Phalcon\Di::getDefault();
$config = $di->get('config');
$general_config = $config->general->toArray();
return array('method' => 'post', 'groups' => array('account_info' => array('legend' => 'Account Information', 'elements' => array('name' => array('text', array('label' => 'Your Name', 'class' => 'half-width', 'required' => true)), 'email' => array('text', array('label' => 'E-mail Address', 'class' => 'half-width', 'required' => true, 'autocomplete' => 'off')), 'auth_password' => array('password', array('label' => 'Reset Password', 'description' => 'To change your password, enter the new password in the field below.', 'autocomplete' => 'off')))), 'customization_details' => array('legend' => 'Site Customization', 'elements' => array('theme' => array('radio', array('label' => 'Site Theme', 'belongsTo' => 'customization', 'multiOptions' => array('light' => 'Light Theme', 'dark' => 'Dark Theme'), 'default' => 'light')), 'timezone' => array('select', array('label' => 'Time Zone', 'belongsTo' => 'customization', 'multiOptions' => \PVL\Timezone::fetchSelect(), 'default' => 'UTC')))), 'submit' => array('elements' => array('submit' => array('submit', array('type' => 'submit', 'label' => 'Save Profile', 'helper' => 'formButton', 'class' => 'ui-button'))))));