function __dateInput($box, $fieldName, $value, $format = null) { global $wp_locale; $date = !empty($value) ? $value : time(); $day = mysql2date('d', $date); $month = mysql2date('m', $date); $year = mysql2date('Y', $date); $months = ''; for ($i = 1; $i < 13; $i = $i + 1) { $m = $wp_locale->get_month_abbrev($wp_locale->get_month($i)); $attr = array('value' => $i); if ($i == $month) { $attr['selected'] = 'selected'; } $months .= csml::entag($m, 'option', $attr); } echo csml::entag($months, 'select', array('name' => $fieldName . "[month]")); echo csml::tag('input[type="text"]', array('name' => $fieldName . "[day]", 'size' => "2", 'value' => $day)); echo ","; echo csml::tag('input[type="text"]', array('name' => $fieldName . "[year]", 'size' => "4", 'value' => $year)); return; }
function entag($content, $selector = "div", $params = '', $format = null, $comment = '') { return csml::entag($content, $selector, $params, $format, $comment); }
function en($content, $selector = "div", $params = '', $format = INLINE_WITH_TABS, $comment = '') { echo csml::entag($content, $selector, $params, $format, $comment); }
function section($title) { $h = csml::entag($title, 'h3') . "<hr/>"; $th = csml::entag($h, 'th', array('colspan' => '2')); return csml::entag($th, 'tr[valign="top"]'); }