/** * Get the replaced start year of date element Year select, * with any placeholder tags replaced. Returns the default start * year if the year is not specified. */ function iphorm_get_date_years_ajax() { $startYear = isset($_POST['start_year']) ? $_POST['start_year'] : ''; $endYear = isset($_POST['end_year']) ? $_POST['end_year'] : ''; $response = array('type' => 'success', 'data' => array('start_year' => iphorm_get_start_year($startYear), 'end_year' => iphorm_get_end_year($endYear))); header('Content-Type: application/json'); echo iphorm_json_encode($response); exit; }
$element['month_heading'] = ''; } if (!isset($element['year_heading'])) { $element['year_heading'] = ''; } if (!isset($element['months_as_numbers'])) { $element['months_as_numbers'] = false; } if (!isset($element['field_order'])) { $element['field_order'] = 'eu'; } $dayHeading = strlen($element['day_heading']) ? $element['day_heading'] : _x('Day', 'select day of the month', 'iphorm'); $monthHeading = strlen($element['month_heading']) ? $element['month_heading'] : _x('Month', 'select month', 'iphorm'); $yearHeading = strlen($element['year_heading']) ? $element['year_heading'] : _x('Year', 'select year', 'iphorm'); $sy = iphorm_get_start_year($element['start_year']); $ey = iphorm_get_end_year($element['end_year']); $helpUrl = iphorm_help_link('element-date'); ?> <div id="ifb-element-wrap-<?php echo $id; ?> " class="ifb-element-wrap ifb-element-wrap-date <?php if (!$element['required']) { echo 'ifb-element-optional'; } ?> <?php echo "ifb-label-placement-{$form['label_placement']}"; ?> "> <div class="ifb-top-element-wrap qfb-cf">
/** * Get the end year * * Placeholder dates will be replaced * * @return int */ public function getEndYear() { return iphorm_get_end_year($this->_endYear); }