Move the defaulttimzone setting to the new page.
authorRobert Sesek <rsesek@bluestatic.org>
Fri, 4 Apr 2014 04:02:49 +0000 (00:02 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Fri, 4 Apr 2014 04:02:49 +0000 (00:02 -0400)
admin/setting.php
admin/settings.php
admin/templates/admin_settings.tpl

index 9c77d99924e09264260f2a8aa761f3b91b1bbdfb..1ffb7891a9810994a5f2360dc3ecbce557d8968c 100644 (file)
@@ -94,10 +94,6 @@ if ($_REQUEST['do'] == 'modify')
        }
        $admin->row_list(T('The authentication class to use to validate cookie data and longins. You may need to edit the actual file for certain authentication systems.'), 'setting[authmethod]');
        
-       // defaulttimezone
-       $admin->row_span(T('Default Time Zone'), 'thead');
-       $admin->row_text(T('This controls the time zone that all unregistered users view the tracker with.'), construct_option_select('setting[defaulttimezone]', $bugsys->datef->fetch_timezone_list(), $bugsys->options['defaulttimezone']), $bugsys->options['defaulttimezone']);
-       
        // defaultlanguage
        $admin->row_span(T('Default Language'), 'thead');
        $admin->row_text(T('You can set the default language that all new users (and guests) will use.'), construct_option_select('setting[defaultlanguage]', Bugdar::$datastore['language'], $bugsys->options['defaultlanguage'], 'languageid', 'title'), $bugsys->options['defaultlanguage']);
index d2a4cb764b67f7daef3caa109e93eb734128bc30..fab1a8bcfd75ddb874f0fffb6977a19009707cf7 100644 (file)
@@ -36,9 +36,14 @@ class SettingsAction extends http\Action implements TemplatePreCaching
 
        public function Invoke(http\Request $request, http\Response $response)
        {
+               // TODO(port): global.
+               global $bugsys;
+
                $response->data['title'] = T('Settings');
                $response->context['template'] = 'admin_settings';
 
+               $response->data['timezone_list'] = $bugsys->datef->fetch_timezone_list();
+
                // Save settings on POST.
                if ($request->http_method == 'POST') {
                        $query_bits = array();
index 505f351607e03d5c0ae5b1269d98e43a61046f5b..020f0578added82b57b4c2c320617bfaf3b71b6b 100644 (file)
                        title="{%=T('Date Format')%}"
                        description="{%=T('Set the date format used for bug report and comment information. This is based on PHP\'s date() function.')%}"
                        value="{%= Bugdar::$options['dateformat'] %}">
-               <!-- defaulttimezone -->
+               <tr>
+                       <th>
+                               <label for="setting-defaulttimezone">{%=T('Default Time Zone')%}</label>
+                               <dfn>{%=T('This controls the time zone that all unregistered users view the tracker with.')%}</dfn>
+                       </th>
+                       <td>
+                               <select id="setting-defaulttimezone" name="settings[defaulttimezone]">
+                                       {% foreach ($timezone_list as $offset => $name): %}
+                                       <option value="{%= $offset %}" {%= ($offset == Bugdar::$options['defaulttimezone']) ? 'selected' : '' %}>{%= $name %}</option>
+                                       {% endforeach %}
+                               </select>
+                       </td>
+               </tr>
                <!-- defaultlanguage -->
                <tr setting-type="text"
                        name="syndicateditems"