* @license PHP License * @package Wombat */ WBClass::load('WBDatasource_FormAttribute'); /** * Populate form element's values with month list * * * @version 0.1.0 * @package Wombat */ class WBDatasource_FormAttribute_Month extends WBDatasource_FormAttribute { /** * configuration parameter * @var array */ protected $config = array( 'class' => '' ); /** * Get attribute's value * * List of month * * @param mixed $current actual attribute value * @return array */ protected function getAttributeValue($current) { if (!is_array($current)) { $current = array(); } $current[] = array( 'value' => 1, 'label' => patI18n::dgettext('wombat', 'January'), 'class' => $this->config['class'] ); $current[] = array( 'value' => 2, 'label' => patI18n::dgettext('wombat', 'February'), 'class' => $this->config['class'] ); $current[] = array( 'value' => 3, 'label' => patI18n::dgettext('wombat', 'March'), 'class' => $this->config['class'] ); $current[] = array( 'value' => 4, 'label' => patI18n::dgettext('wombat', 'April'), 'class' => $this->config['class'] ); $current[] = array( 'value' => 5, 'label' => patI18n::dgettext('wombat', 'May'), 'class' => $this->config['class'] ); $current[] = array( 'value' => 6, 'label' => patI18n::dgettext('wombat', 'June'), 'class' => $this->config['class'] ); $current[] = array( 'value' => 7, 'label' => patI18n::dgettext('wombat', 'July'), 'class' => $this->config['class'] ); $current[] = array( 'value' => 8, 'label' => patI18n::dgettext('wombat', 'August'), 'class' => $this->config['class'] ); $current[] = array( 'value' => 9, 'label' => patI18n::dgettext('wombat', 'September'), 'class' => $this->config['class'] ); $current[] = array( 'value' => 10, 'label' => patI18n::dgettext('wombat', 'October'), 'class' => $this->config['class'] ); $current[] = array( 'value' => 11, 'label' => patI18n::dgettext('wombat', 'November'), 'class' => $this->config['class'] ); $current[] = array( 'value' => 12, 'label' => patI18n::dgettext('wombat', 'December'), 'class' => $this->config['class'] ); return $current; } }