Exemplo n.º 1
0
/**
 * Renders a HTML <select> list of cities for timezone selection.
 *
 * Can be altered by plugins via the 'prefs_ui > gmtoffset'
 * pluggable UI callback event.
 *
 * @param  string $name HTML name of the list
 * @param  string $val  Initial (or current) selected option
 * @return string HTML
 */
function gmtoffset_select($name, $val)
{
    // Fetch *hidden* pref
    $key = get_pref('timezone_key', '', true);
    if ($key === '') {
        $key = (string) Txp::get('Textpattern_Date_Timezone')->getTimezone();
    }
    $tz = new timezone();
    $ui = $tz->selectInput('timezone_key', $key, false, '', 'gmtoffset');
    return pluggable_ui('prefs_ui', 'gmtoffset', $ui, $name, $val);
}
Exemplo n.º 2
0
function gmtoffset_select($name, $val)
{
    // Fetch *hidden* pref
    $key = safe_field('val', 'txp_prefs', "name='timezone_key'");
    $tz = new timezone();
    $ui = $tz->selectInput('timezone_key', $key, true, '', 'gmtoffset');
    return pluggable_ui('prefs_ui', 'gmtoffset', $ui, $name, $val);
}