$continent = '';
foreach ($timezone_identifiers as $value) {
$ex = explode("/", $value);
$continent = '';
foreach ($timezone_identifiers as $value) {
$ex = explode("/", $value);
* arguments follow convention as other field_* template array:
* 'name', 'label', $value, 'help'
*
* arguments follow convention as other field_* template array:
* 'name', 'label', $value, 'help'
*
*/
public static function getTimezoneField($name = 'timezone', $label = '', $current = 'America/Los_Angeles', $help = '')
{
*/
public static function getTimezoneField($name = 'timezone', $label = '', $current = 'America/Los_Angeles', $help = '')
{
$options = str_replace('<select id="timezone_select" name="timezone">', '', $options);
$options = str_replace('</select>', '', $options);
$options = str_replace('<select id="timezone_select" name="timezone">', '', $options);
$options = str_replace('</select>', '', $options);
- $tpl = get_markup_template('field_select_raw.tpl');
- return replace_macros($tpl, [
+ $tpl = Renderer::getMarkupTemplate('field_select_raw.tpl');
+ return Renderer::replaceMacros($tpl, [
'$field' => [$name, $label, $current, $help, $options],
]);
}
'$field' => [$name, $label, $current, $help, $options],
]);
}
* @brief Wrapper for date selector, tailored for use in birthday fields.
*
* @param string $dob Date of Birth
* @brief Wrapper for date selector, tailored for use in birthday fields.
*
* @param string $dob Date of Birth
list($year, $month, $day) = sscanf($dob, '%4d-%2d-%2d');
if ($dob < '0000-01-01') {
list($year, $month, $day) = sscanf($dob, '%4d-%2d-%2d');
if ($dob < '0000-01-01') {
- $tpl = get_markup_template("field_input.tpl");
- $o = replace_macros($tpl,
+ $tpl = Renderer::getMarkupTemplate("field_input.tpl");
+ $o = Renderer::replaceMacros($tpl,
- * @param string $min Unix timestamp of minimum date
- * @param string $max Unix timestap of maximum date
- * @param string $default Unix timestamp of default date
- * @param string $id ID and name of datetimepicker (defaults to "datetimepicker")
+ * @param DateTime $min Minimum date
+ * @param DateTime $max Maximum date
+ * @param DateTime $default Default date
+ * @param string $id ID and name of datetimepicker (defaults to "datetimepicker")
*/
public static function getDateField($min, $max, $default, $id = 'datepicker')
{
*/
public static function getDateField($min, $max, $default, $id = 'datepicker')
{
* @param string $id ID and name of datetimepicker (defaults to "timepicker")
*
* @return string Parsed HTML output.
* @param string $id ID and name of datetimepicker (defaults to "timepicker")
*
* @return string Parsed HTML output.
* @param DateTime $minDate Minimum date
* @param DateTime $maxDate Maximum date
* @param DateTime $defaultDate Default date
* @param DateTime $minDate Minimum date
* @param DateTime $maxDate Maximum date
* @param DateTime $defaultDate Default date
* @param string $id Id and name of datetimepicker (defaults to "datetimepicker")
* @param bool $pickdate true to show date picker (default)
* @param bool $picktime true to show time picker (default)
* @param string $id Id and name of datetimepicker (defaults to "datetimepicker")
* @param bool $pickdate true to show date picker (default)
* @param bool $picktime true to show time picker (default)
// First day of the week (0 = Sunday)
$firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week', 0);
// First day of the week (0 = Sunday)
$firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week', 0);
// Check if the detected language is supported by the picker
if (!in_array($lang,
["ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr",
"it", "da", "no", "ja", "vi", "sl", "cs", "hu"])) {
// Check if the detected language is supported by the picker
if (!in_array($lang,
["ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr",
"it", "da", "no", "ja", "vi", "sl", "cs", "hu"])) {
$readable_format = str_replace(['Y', 'm', 'd', 'H', 'i'], ['yyyy', 'mm', 'dd', 'HH', 'MM'], $dateformat);
$readable_format = str_replace(['Y', 'm', 'd', 'H', 'i'], ['yyyy', 'mm', 'dd', 'HH', 'MM'], $dateformat);
- $tpl = get_markup_template('field_datetime.tpl');
- $o .= replace_macros($tpl, [
+ $tpl = Renderer::getMarkupTemplate('field_datetime.tpl');
+ $o .= Renderer::replaceMacros($tpl, [
$a = [12 * 30 * 24 * 60 * 60 => [L10n::t('year'), L10n::t('years')],
30 * 24 * 60 * 60 => [L10n::t('month'), L10n::t('months')],
7 * 24 * 60 * 60 => [L10n::t('week'), L10n::t('weeks')],
$a = [12 * 30 * 24 * 60 * 60 => [L10n::t('year'), L10n::t('years')],
30 * 24 * 60 * 60 => [L10n::t('month'), L10n::t('months')],
7 * 24 * 60 * 60 => [L10n::t('week'), L10n::t('weeks')],
* and become a year older. If you wish me happy birthday on January 1
* (San Bruno time), you'll be a day late.
*
* and become a year older. If you wish me happy birthday on January 1
* (San Bruno time), you'll be a day late.
*
- * @param string $dob Date of Birth
- * @param string $owner_tz (optional) Timezone of the person of interest
+ * @param string $dob Date of Birth
+ * @param string $owner_tz (optional) Timezone of the person of interest
* @param int $m Month (1=January, 12=December)
*
* @return string day 0 = Sunday through 6 = Saturday
* @param int $m Month (1=January, 12=December)
*
* @return string day 0 = Sunday through 6 = Saturday
*/
public static function getCalendarTable($y = 0, $m = 0, $links = null, $class = '')
{
*/
public static function getCalendarTable($y = 0, $m = 0, $links = null, $class = '')
{
$o = '<table class="calendar' . $class . '">';
$o .= "<caption>$str_month $y</caption><tr>";
for ($a = 0; $a < 7; $a ++) {
$o = '<table class="calendar' . $class . '">';
$o .= "<caption>$str_month $y</caption><tr>";
for ($a = 0; $a < 7; $a ++) {
- $o .= '<th>' . mb_substr(day_translate($dn[$a]), 0, 3, 'UTF-8') . '</th>';
+ $o .= '<th>' . mb_substr(L10n::getDay($dn[$a]), 0, 3, 'UTF-8') . '</th>';
$o .= "<td $today>";
$day = str_replace(' ', ' ', sprintf('%2.2d', $d));
if ($started) {
$o .= "<td $today>";
$day = str_replace(' ', ' ', sprintf('%2.2d', $d));
if ($started) {