From 08688b392dc053c3aa8dd8f5d2221c974ad1bfa9 Mon Sep 17 00:00:00 2001
From: mamoun othman <artofeclipse@gmail.com>
Date: Thu, 1 Nov 2012 18:56:28 +0200
Subject: [PATCH] convert theme_system_date_format_localize_form to twig.

---
 core/modules/system/system.module                  |   34 ++++++++++++++++++++
 .../system-date-format-localize-form.html.twig     |   15 +++++++++
 2 files changed, 49 insertions(+), 0 deletions(-)
 create mode 100644 core/themes/stark/templates/system/system-date-format-localize-form.html.twig

diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 3332e03..2c62f57 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -208,10 +208,44 @@ function system_theme() {
     ),
     'system_date_format_localize_form' => array(
       'render element' => 'form',
+      'template' => 'system-date-format-localize-form',
     ),
   ));
 }
 
+ /**
+  * Default theme implementation to display a locale date format form.
+  *
+  * $variables
+  *   An associative array containing:
+  *   - form: A render element representing the form.
+  *
+  * @see system-date-format-localize-form.html.twig
+  *
+  * @ingroup themeable
+  */
+function template_preprocess_system_date_format_localize_form(&$variables) {
+  $form = $variables['form'];
+  $header = array(
+    t('Date type'),
+    t('Format'),
+  );
+
+  foreach (element_children($form['date_formats']) as $key) {
+    $row = array();
+    $row[] = $form['date_formats'][$key]['#title'];
+    unset($form['date_formats'][$key]['#title']);
+    $row[] = array('data' => drupal_render($form['date_formats'][$key]));
+    $rows[] = $row;
+  }
+
+  $output = drupal_render($form['language']);
+  $output .= theme('table', array('header' => $header, 'rows' => $rows));
+  $output .= drupal_render_children($form);
+
+  $variables['content'] = $output;
+}
+
 /**
  * Default theme implementation to display the modules form.
  *
diff --git a/core/themes/stark/templates/system/system-date-format-localize-form.html.twig b/core/themes/stark/templates/system/system-date-format-localize-form.html.twig
new file mode 100644
index 0000000..e94ad80
--- /dev/null
+++ b/core/themes/stark/templates/system/system-date-format-localize-form.html.twig
@@ -0,0 +1,15 @@
+{#
+/**
+* @file
+* Default theme implementation to display a locale date format form.
+*
+* Available variables:
+* - content: A render element representing the locale date format form.
+*
+* @see template_preprocess
+* @see template_preprocess_system_date_format_localize_form
+*
+* @ingroup themeable
+*/
+#}
+{{ content }}
-- 
1.7.5.4

