summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPol Dellaiera2017-02-24 22:00:06 +0100
committerPol Dellaiera2017-02-28 13:13:52 +0100
commit8e957f2e266897e89300e1da66d906310c95f0cc (patch)
treea49001b1cefccf4d6f56b5fff7736fdc8eb3a93e
Initial prototype.
-rw-r--r--assets/images/logo.pngbin0 -> 17845 bytes
-rw-r--r--assets/images/logo.svg23
-rw-r--r--assets/images/logo_original.pngbin0 -> 155313 bytes
-rw-r--r--assets/images/screenshot.pngbin0 -> 14131 bytes
-rw-r--r--atomium.info30
-rw-r--r--composer.json36
-rw-r--r--includes/alter/css.inc46
-rw-r--r--includes/alter/field_widget_form.inc32
-rw-r--r--includes/alter/form.inc52
-rw-r--r--includes/alter/html_head.inc23
-rw-r--r--includes/alter/js.inc13
-rw-r--r--includes/alter/page.inc33
-rw-r--r--includes/common.inc194
-rw-r--r--includes/preprocess.inc16
-rw-r--r--includes/preprocess/admin_block.inc18
-rw-r--r--includes/preprocess/bean.inc16
-rw-r--r--includes/preprocess/block.inc116
-rw-r--r--includes/preprocess/breadcrumb.inc13
-rw-r--r--includes/preprocess/button.inc22
-rw-r--r--includes/preprocess/checkbox.inc28
-rw-r--r--includes/preprocess/checkboxes.inc25
-rw-r--r--includes/preprocess/comment.inc38
-rw-r--r--includes/preprocess/container.inc27
-rw-r--r--includes/preprocess/date.inc23
-rw-r--r--includes/preprocess/field.inc16
-rw-r--r--includes/preprocess/fieldset.inc26
-rw-r--r--includes/preprocess/file.inc18
-rw-r--r--includes/preprocess/form.inc13
-rw-r--r--includes/preprocess/form_required_marker.inc24
-rw-r--r--includes/preprocess/hidden.inc17
-rw-r--r--includes/preprocess/html.inc114
-rw-r--r--includes/preprocess/html_tag.inc31
-rw-r--r--includes/preprocess/image.inc28
-rw-r--r--includes/preprocess/image_button.inc28
-rw-r--r--includes/preprocess/link.inc15
-rw-r--r--includes/preprocess/menu_link.inc27
-rw-r--r--includes/preprocess/menu_tree.inc13
-rw-r--r--includes/preprocess/more_link.inc13
-rw-r--r--includes/preprocess/node.inc103
-rw-r--r--includes/preprocess/page.inc60
-rw-r--r--includes/preprocess/password.inc18
-rw-r--r--includes/preprocess/radio.inc28
-rw-r--r--includes/preprocess/region.inc14
-rw-r--r--includes/preprocess/select.inc31
-rw-r--r--includes/preprocess/textarea.inc46
-rw-r--r--includes/preprocess/textfield.inc60
-rw-r--r--includes/preprocess/user.inc15
-rw-r--r--includes/preprocess/username.inc18
-rw-r--r--includes/preprocess/vertical_tabs.inc13
-rw-r--r--includes/process.inc60
-rw-r--r--includes/process/block.inc13
-rw-r--r--includes/process/breadcrumb.inc18
-rw-r--r--includes/process/date.inc14
-rw-r--r--includes/process/field.inc18
-rw-r--r--includes/process/fieldset.inc16
-rw-r--r--includes/process/form.inc22
-rw-r--r--includes/process/form_required_marker.inc13
-rw-r--r--includes/process/html.inc53
-rw-r--r--includes/process/html_tag.inc21
-rw-r--r--includes/process/select.inc13
-rw-r--r--includes/process/textarea.inc13
-rw-r--r--includes/process/username.inc15
-rw-r--r--includes/registry.inc569
-rw-r--r--includes/theme/field_multiple_value_form.inc88
-rw-r--r--includes/theme/form_element.inc83
-rw-r--r--includes/theme/form_element_label.inc76
-rw-r--r--includes/theme/item_list.inc65
-rw-r--r--includes/theme/link_field.inc35
-rw-r--r--logo.pngbin0 -> 17845 bytes
-rw-r--r--template.php52
-rw-r--r--templates/block/block.tpl.php20
-rw-r--r--templates/comment/comment-wrapper.tpl.php19
-rw-r--r--templates/comment/comment.tpl.php47
-rw-r--r--templates/field/field.tpl.php17
-rw-r--r--templates/menu/menu-link.tpl.php8
-rw-r--r--templates/menu/menu-tree.tpl.php8
-rw-r--r--templates/node/node.tpl.php52
-rw-r--r--templates/system/admin-block.tpl.php18
-rw-r--r--templates/system/breadcrumb.tpl.php8
-rw-r--r--templates/system/button.tpl.php8
-rw-r--r--templates/system/checkbox.tpl.php8
-rw-r--r--templates/system/checkboxes.tpl.php8
-rw-r--r--templates/system/container.tpl.php8
-rw-r--r--templates/system/date.tpl.php8
-rw-r--r--templates/system/fieldset.tpl.php19
-rw-r--r--templates/system/file.tpl.php8
-rw-r--r--templates/system/form-required-marker.tpl.php8
-rw-r--r--templates/system/form.tpl.php10
-rw-r--r--templates/system/hidden.tpl.php8
-rw-r--r--templates/system/html-tag.tpl.php8
-rw-r--r--templates/system/html.tpl.php21
-rw-r--r--templates/system/image-button.tpl.php8
-rw-r--r--templates/system/image.tpl.php1
-rw-r--r--templates/system/link.tpl.php8
-rw-r--r--templates/system/more-link.tpl.php8
-rw-r--r--templates/system/page.tpl.php33
-rw-r--r--templates/system/password.tpl.php8
-rw-r--r--templates/system/radio.tpl.php8
-rw-r--r--templates/system/region.tpl.php8
-rw-r--r--templates/system/select.tpl.php8
-rw-r--r--templates/system/textarea.tpl.php10
-rw-r--r--templates/system/textfield.tpl.php8
-rw-r--r--templates/system/username.tpl.php8
-rw-r--r--templates/system/vertical-tabs.tpl.php9
-rw-r--r--templates/user/user-profile.tpl.php10
-rw-r--r--tests/scripts/pre-push.sh9
-rw-r--r--themes/atomium_bootstrap/assets/css/override.css10
-rw-r--r--themes/atomium_bootstrap/atomium_bootstrap.info31
-rw-r--r--themes/atomium_bootstrap/includes/alter/form.inc86
-rw-r--r--themes/atomium_bootstrap/includes/alter/menu.inc19
-rw-r--r--themes/atomium_bootstrap/includes/preprocess/breadcrumb.inc17
-rw-r--r--themes/atomium_bootstrap/includes/preprocess/fieldset.inc71
-rw-r--r--themes/atomium_bootstrap/includes/preprocess/form_required_marker.inc23
-rw-r--r--themes/atomium_bootstrap/includes/preprocess/html.inc14
-rw-r--r--themes/atomium_bootstrap/includes/preprocess/links.inc17
-rw-r--r--themes/atomium_bootstrap/includes/preprocess/region.inc15
-rw-r--r--themes/atomium_bootstrap/includes/preprocess/table.inc17
-rw-r--r--themes/atomium_bootstrap/includes/process/fieldset.inc18
-rw-r--r--themes/atomium_bootstrap/includes/theme/menu.inc65
-rw-r--r--themes/atomium_bootstrap/includes/theme/status_messages.inc53
-rw-r--r--themes/atomium_bootstrap/template.php9
-rw-r--r--themes/atomium_bootstrap/templates/system/breadcrumb.tpl.php8
-rw-r--r--themes/atomium_bootstrap/templates/system/fieldset.tpl.php31
-rw-r--r--themes/atomium_bootstrap/templates/system/page.tpl.php61
-rw-r--r--themes/atomium_foundation/atomium_foundation.info30
-rw-r--r--themes/atomium_foundation/includes/alter/form.inc63
-rw-r--r--themes/atomium_foundation/includes/preprocess/block.inc13
-rw-r--r--themes/atomium_foundation/includes/preprocess/breadcrumb.inc17
-rw-r--r--themes/atomium_foundation/includes/preprocess/fieldset.inc16
-rw-r--r--themes/atomium_foundation/includes/preprocess/form_required_marker.inc24
-rw-r--r--themes/atomium_foundation/includes/preprocess/html.inc14
-rw-r--r--themes/atomium_foundation/includes/preprocess/links.inc20
-rw-r--r--themes/atomium_foundation/includes/preprocess/menu_tree.inc13
-rw-r--r--themes/atomium_foundation/includes/theme/links.inc166
-rw-r--r--themes/atomium_foundation/includes/theme/menu.inc58
-rw-r--r--themes/atomium_foundation/includes/theme/status_messages.inc62
-rw-r--r--themes/atomium_foundation/template.php11
-rw-r--r--themes/atomium_foundation/templates/system/breadcrumb.tpl.php8
-rw-r--r--themes/atomium_foundation/templates/system/page.tpl.php46
-rw-r--r--themes/avogadro/assets/images/logo.pngbin0 -> 17845 bytes
-rw-r--r--themes/avogadro/assets/images/logo.svg23
-rw-r--r--themes/avogadro/assets/images/logo_original.pngbin0 -> 155313 bytes
-rw-r--r--themes/avogadro/assets/images/screenshot.pngbin0 -> 14131 bytes
-rw-r--r--themes/avogadro/avogadro.info31
-rw-r--r--themes/avogadro/logo.pngbin0 -> 17845 bytes
-rw-r--r--themes/avogadro/template.php6
146 files changed, 4519 insertions, 0 deletions
diff --git a/assets/images/logo.png b/assets/images/logo.png
new file mode 100644
index 0000000..645e13c
--- /dev/null
+++ b/assets/images/logo.png
Binary files differ
diff --git a/assets/images/logo.svg b/assets/images/logo.svg
new file mode 100644
index 0000000..0f62c4a
--- /dev/null
+++ b/assets/images/logo.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="131"
+ height="120">
+ <path
+ d="M 103.96875,29.43727 C 106.08143,18.684552 104.89996,10.523975 99.90625,7.2810201 98.241679,6.2000351 96.24602,5.7270015 94,5.8122701 81.871494,6.2727205 62.301679,22.972344 46.3125,47.59352 27.362362,76.774173 20.627996,106.01897 31.28125,112.93727 c 5.056946,3.28402 13.115147,0.95604 22.21875,-5.53125"
+ style="fill:none;stroke:#66595c;stroke-width:5;stroke-linecap:round" />
+ <path
+ d="m 113.6875,77.15602 c 8.99437,-3.489189 14.52504,-8.265012 14.8125,-13.75 0.6648,-12.685141 -26.94124,-24.429026 -61.6875,-26.25 -3.257461,-0.170716 -6.460588,-0.260544 -9.59375,-0.25 -30.287234,0.101927 -53.9287749,8.410341 -54.53125,19.90625 -0.286892,5.474225 4.7004836,10.782383 13.25,15.1875"
+ style="fill:none;stroke:#66595c;stroke-width:5;stroke-linecap:round" />
+ <path
+ d="M 57,10.53102 C 50.846125,5.4251295 45.074552,2.683237 40.4375,3.0310201 39.20289,3.123617 38.061068,3.4278792 37,3.9685201 25.681946,9.7353567 29.297632,39.560643 45.09375,70.56227 c 15.796118,31.00163 37.775696,51.45434 49.09375,45.6875 10.8844,-5.54588 7.94666,-33.337754 -6.34375,-63.03125"
+ style="fill:none;stroke:#66595c;stroke-width:5;stroke-linecap:round" />
+ <path
+ d="m 73.5,61 a 7.5,7.5 0 0 1 -15,0 7.5,7.5 0 1 1 15,0 z"
+ style="fill:#66595c" />
+</svg> \ No newline at end of file
diff --git a/assets/images/logo_original.png b/assets/images/logo_original.png
new file mode 100644
index 0000000..f8e22f3
--- /dev/null
+++ b/assets/images/logo_original.png
Binary files differ
diff --git a/assets/images/screenshot.png b/assets/images/screenshot.png
new file mode 100644
index 0000000..b31af47
--- /dev/null
+++ b/assets/images/screenshot.png
Binary files differ
diff --git a/atomium.info b/atomium.info
new file mode 100644
index 0000000..c0b6830
--- /dev/null
+++ b/atomium.info
@@ -0,0 +1,30 @@
+name = Atomium
+description = The NextEuropa base theme
+screenshot = assets/images/screenshot.png
+engine = phptemplate
+core = 7.x
+php = 5.2
+
+;-------------- F E A T U R E S -------------
+features[] = logo
+features[] = name
+features[] = slogan
+features[] = favicon
+
+;-------------- R E G I O N S -------------
+regions[header] = "Header"
+regions[highlighted] = "Highlighted"
+regions[help] = "Help"
+regions[content] = "Content"
+regions[sidebar_first] = "Sidebar first"
+regions[sidebar_second] = "Sidebar second"
+regions[footer] = "Footer"
+
+;-------------- P A N E L S -------------
+
+;-------------- C S S -------------
+
+;-------------- JS -------------
+
+;-------------- Default Settings for theme-settings.php -------------
+settings[toggle_logo] = 0
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..6111776
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,36 @@
+{
+ "name": "drupal/atomium",
+ "description": "The NextEuropa clean base theme.",
+ "type": "drupal-theme",
+ "license": "GPL-2.0",
+ "homepage": "https://drupal.org/project/atomium",
+ "authors": [
+ {
+ "name": "Pol Dellaiera (Pol)",
+ "homepage": "https://www.drupal.org/u/pol",
+ "role": "Author"
+ }
+ ],
+ "support": {
+ "docs": "https://drupal.org/project/atomium",
+ "issues": "https://drupal.org/project/issues/atomium",
+ "source": "https://drupal.org/project/atomium"
+ },
+ "require-dev": {
+ "drupal/coder": "^8.2"
+ },
+ "scripts": {
+ "post-install-cmd": [
+ "./vendor/bin/phpcs --config-set installed_paths ../../drupal/coder/coder_sniffer",
+ "./vendor/bin/phpcs --config-set show_progress 1",
+ "cp ./tests/scripts/pre-push.sh .git/hooks/pre-push && chmod +x .git/hooks/pre-push"
+ ],
+ "post-update-cmd": [
+ "./vendor/bin/phpcs --config-set installed_paths ../../drupal/coder/coder_sniffer",
+ "./vendor/bin/phpcs --config-set show_progress 1",
+ "cp ./tests/scripts/pre-push.sh .git/hooks/pre-push && chmod +x .git/hooks/pre-push"
+ ],
+ "phpcs": "./vendor/bin/phpcs --standard=Drupal,DrupalPractice ./includes ./themes ./templates ./assets",
+ "phpcbf": "./vendor/bin/phpcbf --standard=Drupal,DrupalPractice ./includes ./themes ./templates ./assets"
+ }
+}
diff --git a/includes/alter/css.inc b/includes/alter/css.inc
new file mode 100644
index 0000000..30c2f8c
--- /dev/null
+++ b/includes/alter/css.inc
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @file
+ * css.inc
+ */
+
+/**
+ * Implements hook_css_alter().
+ */
+function atomium_css_alter(&$css) {
+ $exclude = array(
+ // 'misc/vertical-tabs.css' => FALSE,.
+ 'modules/aggregator/aggregator.css' => FALSE,
+ 'modules/block/block.css' => FALSE,
+ 'modules/book/book.css' => FALSE,
+ 'modules/comment/comment.css' => FALSE,
+ // 'modules/dblog/dblog.css' => FALSE,
+ // 'modules/file/file.css' => FALSE,.
+ 'modules/filter/filter.css' => FALSE,
+ // 'modules/forum/forum.css' => FALSE,
+ // 'modules/help/help.css' => FALSE,.
+ 'modules/menu/menu.css' => FALSE,
+ 'modules/node/node.css' => FALSE,
+ // 'modules/openid/openid.css' => FALSE,.
+ 'modules/poll/poll.css' => FALSE,
+ 'modules/profile/profile.css' => FALSE,
+ 'modules/search/search.css' => FALSE,
+ // 'modules/statistics/statistics.css' => FALSE,
+ // 'modules/syslog/syslog.css' => FALSE,
+ // 'modules/system/admin.css' => FALSE,
+ // 'modules/system/maintenance.css' => FALSE,
+ // 'modules/system/system.css' => FALSE,
+ // 'modules/system/system.admin.css' => FALSE,
+ // 'modules/system/system.base.css' => FALSE,
+ // 'modules/system/system.maintenance.css' => FALSE,.
+ 'modules/system/system.menus.css' => FALSE,
+ 'modules/system/system.messages.css' => FALSE,
+ 'modules/system/system.theme.css' => FALSE,
+ 'modules/taxonomy/taxonomy.css' => FALSE,
+ 'modules/tracker/tracker.css' => FALSE,
+ // 'modules/update/update.css' => FALSE,.
+ 'modules/user/user.css' => FALSE,
+ );
+ $css = array_diff_key($css, $exclude);
+}
diff --git a/includes/alter/field_widget_form.inc b/includes/alter/field_widget_form.inc
new file mode 100644
index 0000000..4c82aaa
--- /dev/null
+++ b/includes/alter/field_widget_form.inc
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * @file
+ * field_widget_form.inc
+ */
+
+/**
+ * Implements hook_field_widget_form_alter().
+ */
+function atomium_field_widget_form_alter(&$element, &$form_state, $context) {
+ $element['#description'] = '';
+
+ if (isset($element['#description'])) {
+ $description = array(
+ '#type' => 'html_tag',
+ '#tag' => 'p',
+ '#attributes' => array(
+ 'class' => array(
+ 'help-text',
+ ),
+ ),
+ 'text' => array(
+ '#type' => 'markup',
+ '#markup' => $element['#description'],
+ ),
+ );
+
+ $element['#description'] = render($description);
+ }
+
+}
diff --git a/includes/alter/form.inc b/includes/alter/form.inc
new file mode 100644
index 0000000..3a62ea0
--- /dev/null
+++ b/includes/alter/form.inc
@@ -0,0 +1,52 @@
+<?php
+
+/**
+ * @file
+ * form.inc
+ */
+
+/**
+ * Implements hook_form_alter().
+ */
+function atomium_form_alter(&$form, &$form_state, $form_id) {
+ // This could be removed.
+}
+
+/**
+ * Implements hook_form_FORM_ID_alter().
+ */
+function atomium_form_search_block_form_alter(&$form, &$form_state, $form_id) {
+ $form['search_block_form']['#attributes']['placeholder'] = t('Search');
+ $form['search_block_form']['#attributes']['type'] = 'search';
+}
+
+/**
+ * Implements hook_form_FORM_ID_alter().
+ */
+function atomium_form_user_login_block_alter(&$form, &$form_state, $form_id) {
+ $form['name']['#attributes']['placeholder'] = $form['name']['#title'];
+ $form['pass']['#attributes']['placeholder'] = $form['pass']['#title'];
+}
+
+/**
+ * Implements hook_form_FORM_ID_alter().
+ */
+function atomium_form_user_register_form_alter(&$form, &$form_state, $form_id) {
+ $form['account']['name']['#attributes']['placeholder'] = $form['account']['name']['#title'];
+ $form['account']['mail']['#attributes']['placeholder'] = $form['account']['mail']['#title'];
+}
+
+/**
+ * Implements hook_form_FORM_ID_alter().
+ */
+function atomium_form_user_login_alter(&$form, &$form_state, $form_id) {
+ $form['name']['#attributes']['placeholder'] = $form['name']['#title'];
+ $form['pass']['#attributes']['placeholder'] = $form['pass']['#title'];
+}
+
+/**
+ * Implements hook_form_FORM_ID_alter().
+ */
+function atomium_form_user_pass_alter(&$form, &$form_state, $form_id) {
+ $form['name']['#attributes']['placeholder'] = $form['name']['#title'];
+}
diff --git a/includes/alter/html_head.inc b/includes/alter/html_head.inc
new file mode 100644
index 0000000..97fd652
--- /dev/null
+++ b/includes/alter/html_head.inc
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * @file
+ * html_head.inc
+ */
+
+/**
+ * Implements hook_html_head_alter().
+ */
+function atomium_html_head_alter(&$head_elements) {
+ // Remove the generator meta.
+ unset($head_elements['system_meta_generator']);
+ if (isset($head_elements['system_meta_content_type']['#attributes']['content'])) {
+ $head_elements['system_meta_content_type']['#attributes'] = array(
+ 'charset' => str_replace(
+ 'text/html; charset=',
+ '',
+ $head_elements['system_meta_content_type']['#attributes']['content']
+ ),
+ );
+ }
+}
diff --git a/includes/alter/js.inc b/includes/alter/js.inc
new file mode 100644
index 0000000..333057b
--- /dev/null
+++ b/includes/alter/js.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * js.inc
+ */
+
+/**
+ * Implements hook_js_alter().
+ */
+function atomium_js_alter(&$js) {
+ // This could be removed.
+}
diff --git a/includes/alter/page.inc b/includes/alter/page.inc
new file mode 100644
index 0000000..54d1f1e
--- /dev/null
+++ b/includes/alter/page.inc
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * @file
+ * page.inc
+ */
+
+/**
+ * Implements hook_page_alter().
+ */
+function atomium_page_alter(&$page) {
+ foreach (system_region_list($GLOBALS['theme'], REGIONS_VISIBLE) as $region => $name) {
+ if (empty($page[$region])) {
+ continue;
+ }
+ $count = 0;
+ $blocks = element_children($page[$region]);
+ $block_count = count($blocks);
+ foreach ($blocks as $block) {
+ if ($count == 0) {
+ $page[$region][$block]['#block']->classes[] = 'first';
+ }
+
+ if (isset($page[$region][$block]['#block']) && is_object($page[$region][$block]['#block'])) {
+ $page[$region][$block]['#block']->order = $count++;
+ }
+
+ if ($count == $block_count) {
+ $page[$region][$block]['#block']->classes[] = 'last';
+ }
+ }
+ }
+}
diff --git a/includes/common.inc b/includes/common.inc
new file mode 100644
index 0000000..fc99884
--- /dev/null
+++ b/includes/common.inc
@@ -0,0 +1,194 @@
+<?php
+
+/**
+ * @file
+ * common.inc
+ */
+
+/**
+ * Includes a theme file.
+ *
+ * @param string $theme
+ * Name of the theme to use for base path.
+ * @param string $path
+ * Path relative to $theme.
+ *
+ * @return bool
+ * TRUE if file has been included, FALSE otherwise.
+ */
+function atomium_include($theme, $path) {
+ static $themes = array();
+
+ if (!isset($themes[$theme])) {
+ $themes[$theme] = drupal_get_path('theme', $theme);
+ }
+
+ if ($themes[$theme] && ($file = DRUPAL_ROOT . '/' . $themes[$theme] . '/' . $path) && file_exists($file)) {
+ if (is_dir($file)) {
+ foreach (glob($file . '/*.{inc}', GLOB_BRACE) as $file_to_include) {
+ include_once $file_to_include;
+ }
+ }
+ if (is_file($file)) {
+ include_once $file;
+ }
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/**
+ * Returns a list of base themes for active or provided theme.
+ *
+ * @param string $theme_key
+ * The machine name of the theme to check, if not set the active theme name
+ * will be used.
+ * @param bool $include_theme_key
+ * Whether to append the returned list with $theme_key.
+ *
+ * @return array
+ * An indexed array of base themes.
+ */
+function _atomium_get_base_themes($theme_key = NULL, $include_theme_key = FALSE) {
+ static $themes;
+ if (!isset($theme_key)) {
+ $theme_key = $GLOBALS['theme_key'];
+ }
+ if (!isset($themes[$theme_key])) {
+ $themes[$theme_key] = array_unique(array_filter((array) atomium_get_theme_info($theme_key, 'base theme')));
+ }
+ if ($include_theme_key) {
+ $themes[$theme_key][] = $theme_key;
+ }
+ return $themes[$theme_key];
+}
+
+/**
+ * Return information from the .info file of a theme (and possible base themes).
+ *
+ * @param string $theme_key
+ * The machine name of the theme.
+ * @param string $key
+ * The key name of the item to return from the .info file. This value can
+ * include "][" to automatically attempt to traverse any arrays.
+ * @param bool $base_themes
+ * Recursively search base themes, defaults to TRUE.
+ *
+ * @return string|array|false
+ * A string or array depending on the type of value and if a base theme also
+ * contains the same $key, FALSE if no $key is found.
+ */
+function atomium_get_theme_info($theme_key = NULL, $key = NULL, $base_themes = TRUE) {
+ // If no $theme_key is given, use the current theme if we can determine it.
+ if (!isset($theme_key)) {
+ $theme_key = !empty($GLOBALS['theme_key']) ? $GLOBALS['theme_key'] : FALSE;
+ }
+ if ($theme_key) {
+ $themes = list_themes();
+ if (!empty($themes[$theme_key])) {
+ $theme = $themes[$theme_key];
+ // If a key name was specified, return just that array.
+ if ($key) {
+ $value = FALSE;
+ // Recursively add base theme values.
+ if ($base_themes && isset($theme->base_themes)) {
+ foreach (array_keys($theme->base_themes) as $base_theme) {
+ $value = atomium_get_theme_info($base_theme, $key);
+ }
+ }
+ if (!empty($themes[$theme_key])) {
+ $info = $themes[$theme_key]->info;
+ // Allow array traversal.
+ $keys = explode('][', $key);
+ foreach ($keys as $parent) {
+ if (isset($info[$parent])) {
+ $info = $info[$parent];
+ }
+ else {
+ $info = FALSE;
+ }
+ }
+ if (is_array($value)) {
+ if (!empty($info)) {
+ if (!is_array($info)) {
+ $info = array($info);
+ }
+ $value = drupal_array_merge_deep($value, $info);
+ }
+ }
+ else {
+ if (!empty($info)) {
+ if (empty($value)) {
+ $value = $info;
+ }
+ else {
+ if (!is_array($value)) {
+ $value = array($value);
+ }
+ if (!is_array($info)) {
+ $info = array($info);
+ }
+ $value = drupal_array_merge_deep($value, $info);
+ }
+ }
+ }
+ }
+ return $value;
+ }
+ // If no info $key was specified, just return the entire info array.
+ return $theme->info;
+ }
+ }
+ return FALSE;
+}
+
+/**
+ * Retrieves an element's "attributes" array.
+ *
+ * @param array $element
+ * The individual renderable array element. It is possible to also pass the
+ * $variables parameter in [pre]process functions and it will logically
+ * determine the correct path to that particular theme hook's attribute array.
+ * Passed by reference.
+ * @param string $property
+ * Determines which attributes array to retrieve. By default, this is the
+ * normal attributes, but can be "wrapper_attributes" or
+ * "input_group_attributes".
+ *
+ * @return array
+ * The attributes array. Passed by reference.
+ */
+function &_atomium_get_attributes(array &$element, $property = 'attributes') {
+ // Attempt to retrieve a renderable element attributes first.
+ if (
+ isset($element['#type']) ||
+ isset($element['#theme']) ||
+ isset($element['#pre_render']) ||
+ isset($element['#markup']) ||
+ isset($element['#theme_wrappers']) ||
+ isset($element["#$property"])
+ ) {
+ if (!isset($element["#$property"])) {
+ $element["#$property"] = array();
+ }
+ return $element["#$property"];
+ }
+ // Treat $element as if it were a [pre]process function $variables parameter
+ // and look for a renderable "element".
+ elseif (isset($element['element'])) {
+ if (!isset($element['element']["#$property"])) {
+ $element['element']["#$property"] = array();
+ }
+ return $element['element']["#$property"];
+ }
+
+ // If all else fails, create (if needed) a default "attributes" array. This
+ // will, at the very least, either work or cause an error that can be tracked.
+ if (!isset($element[$property])) {
+ $element[$property] = array();
+ }
+
+ return $element[$property];
+}
diff --git a/includes/preprocess.inc b/includes/preprocess.inc
new file mode 100644
index 0000000..b539a6e
--- /dev/null
+++ b/includes/preprocess.inc
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * @file
+ * preprocess.inc
+ */
+
+/**
+ * Implements hook_preprocess().
+ */
+function atomium_preprocess(&$variables, $hook) {
+ // See how we can extend this properly.
+ if ($suggestions = theme_get_suggestions(arg(), $hook)) {
+ $variables['theme_hook_suggestions'] = $suggestions;
+ }
+}
diff --git a/includes/preprocess/admin_block.inc b/includes/preprocess/admin_block.inc
new file mode 100644
index 0000000..fd67dfa
--- /dev/null
+++ b/includes/preprocess/admin_block.inc
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @file
+ * admin_block.inc
+ */
+
+/**
+ * Implements hook_preprocess_admin_block().
+ */
+function atomium_preprocess_admin_block(&$variables) {
+ $variables['attributes_array']['class'][] = 'admin-panel';
+ $variables['attributes_array']['class'][] = $variables['block']['title'];
+
+ if (isset($variables['block']['title'])) {
+ $variables['theme_hook_suggestions'][] = 'admin_block__' . drupal_html_class($variables['block']['title']);
+ }
+}
diff --git a/includes/preprocess/bean.inc b/includes/preprocess/bean.inc
new file mode 100644
index 0000000..50fcf80
--- /dev/null
+++ b/includes/preprocess/bean.inc
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * @file
+ * bean.inc
+ */
+
+/**
+ * Implements hook_preprocess_bean().
+ */
+function atomium_preprocess_bean(&$variables) {
+ // Add a theme hook suggestion to the bean so its combinated with its region.
+ if ($variables['elements']['#block']->module == "bean" and $variables['elements']['bean']) {
+ $variables['theme_hook_suggestions'][] = 'block__bean_' . $variables['elements']['#block']->region;
+ }
+}
diff --git a/includes/preprocess/block.inc b/includes/preprocess/block.inc
new file mode 100644
index 0000000..b753df4
--- /dev/null
+++ b/includes/preprocess/block.inc
@@ -0,0 +1,116 @@
+<?php
+
+/**
+ * @file
+ * block.inc
+ */
+
+/**
+ * Implements hook_preprocess_block().
+ */
+function atomium_preprocess_block(&$variables) {
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('block')));
+ $variables['classes_array'] = preg_grep('/^block-/', $variables['classes_array'], PREG_GREP_INVERT);
+ $variables['id_block'] = ' id="' . $variables['block_html_id'] . '"';
+ $variables['classes_array'][] = $variables['block_html_id'];
+ $variables['classes_array'][] = $variables['block_zebra'];
+ $variables['classes_array'][] = 'order-' . $variables['block']->order;
+
+ if (isset($variables['block']->classes) && is_array($variables['block']->classes)) {
+ $variables['classes_array'] = array_merge($variables['classes_array'], (array) $variables['block']->classes);
+ }
+
+ $variables['title_attributes_array']['class'][] = 'title';
+ $variables['content_attributes_array']['class'][] = 'block-content';
+
+ if (
+ ($variables['elements']['#block']->module == "system" and $variables['elements']['#block']->delta == "navigation") or
+ ($variables['elements']['#block']->module == "system" and $variables['elements']['#block']->delta == "main-menu") or
+ ($variables['elements']['#block']->module == "system" and $variables['elements']['#block']->delta == "user-menu") or
+ ($variables['elements']['#block']->module == "admin" and $variables['elements']['#block']->delta == "menu") or
+ $variables['elements']['#block']->module == "menu_block"
+ ) {
+ $variables['theme_hook_suggestions'][] = 'block__menu';
+ }
+
+ $variables['attributes_array']['class'] = $variables['classes_array'];
+ $variables['attributes_array']['id'] = $variables['block_html_id'];
+
+ // Add Aria Roles via attributes.
+ switch ($variables['block']->module) {
+ case 'system':
+ switch ($variables['block']->delta) {
+ case 'main':
+ // Note: the "main" role goes in the page.tpl, not here.
+ break;
+
+ case 'help':
+ case 'powered-by':
+ $variables['attributes_array']['role'] = 'complementary';
+ break;
+
+ default:
+ // Any other "system" block is a menu block.
+ $variables['attributes_array']['role'] = 'navigation';
+ break;
+ }
+ break;
+
+ case 'menu':
+ case 'menu_block':
+ case 'blog':
+ case 'book':
+ case 'comment':
+ case 'forum':
+ case 'shortcut':
+ case 'statistics':
+ $variables['attributes_array']['role'] = 'navigation';
+ break;
+
+ case 'search':
+ $variables['attributes_array']['role'] = 'search';
+ break;
+
+ case 'help':
+ case 'aggregator':
+ case 'locale':
+ case 'poll':
+ case 'profile':
+ $variables['attributes_array']['role'] = 'complementary';
+ break;
+
+ case 'node':
+ switch ($variables['block']->delta) {
+ case 'syndicate':
+ $variables['attributes_array']['role'] = 'complementary';
+ break;
+
+ case 'recent':
+ $variables['attributes_array']['role'] = 'navigation';
+ break;
+ }
+ break;
+
+ case 'user':
+ switch ($variables['block']->delta) {
+ case 'login':
+ $variables['attributes_array']['role'] = 'form';
+ break;
+
+ case 'new':
+ case 'online':
+ $variables['attributes_array']['role'] = 'complementary';
+ break;
+ }
+ break;
+ }
+
+ $variables['classes_array'][] = drupal_html_class('block-' . $variables['block']->module);
+
+ $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->region;
+ $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->module;
+ $variables['theme_hook_suggestions'][] = 'block__' . $variables['block']->module . '__' . strtr($variables['block']->delta, '-', '_');
+
+ // Create a valid HTML ID and make sure it is unique.
+ $variables['block_html_id'] = drupal_html_id('block-' . $variables['block']->module . '-' . $variables['block']->delta);
+}
diff --git a/includes/preprocess/breadcrumb.inc b/includes/preprocess/breadcrumb.inc
new file mode 100644
index 0000000..2017bb4
--- /dev/null
+++ b/includes/preprocess/breadcrumb.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * breadcrumb.inc
+ */
+
+/**
+ * Implements hook_preprocess_breadcrumb().
+ */
+function atomium_preprocess_breadcrumb(&$variables) {
+ // This could be removed.
+}
diff --git a/includes/preprocess/button.inc b/includes/preprocess/button.inc
new file mode 100644
index 0000000..defe2c2
--- /dev/null
+++ b/includes/preprocess/button.inc
@@ -0,0 +1,22 @@
+<?php
+
+/**
+ * @file
+ * button.inc
+ */
+
+/**
+ * Implements hook_preprocess_button().
+ */
+function atomium_preprocess_button(&$variables) {
+ $element = $variables['element'];
+ $element['#attributes']['type'] = 'submit';
+ element_set_attributes($element, array('id', 'name', 'value'));
+
+ $element['#attributes']['class'][] = 'form-' . $element['#button_type'];
+ if (!empty($element['#attributes']['disabled'])) {
+ $element['#attributes']['class'][] = 'form-button-disabled';
+ }
+
+ $variables['attributes_array'] = $element['#attributes'];
+}
diff --git a/includes/preprocess/checkbox.inc b/includes/preprocess/checkbox.inc
new file mode 100644
index 0000000..b6ec695
--- /dev/null
+++ b/includes/preprocess/checkbox.inc
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * @file
+ * checkbox.inc
+ */
+
+/**
+ * Implements hook_preprocess_select().
+ */
+function atomium_preprocess_checkbox(&$variables) {
+ $element = $variables['element'];
+ $element['#attributes']['type'] = 'checkbox';
+ element_set_attributes(
+ $element,
+ array(
+ 'id',
+ 'name',
+ '#return_value' => 'value',
+ )
+ );
+
+ if (!empty($element['#checked'])) {
+ $element['#attributes']['checked'] = 'checked';
+ }
+ _form_set_class($element, array('form-radio'));
+ $variables['attributes_array'] = $element['#attributes'];
+}
diff --git a/includes/preprocess/checkboxes.inc b/includes/preprocess/checkboxes.inc
new file mode 100644
index 0000000..7567fa1
--- /dev/null
+++ b/includes/preprocess/checkboxes.inc
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * @file
+ * checkboxes.inc
+ */
+
+/**
+ * Implements hook_preprocess_checkboxes().
+ */
+function atomium_preprocess_checkboxes(&$variables) {
+ $element = $variables['element'];
+ $attributes = array();
+ if (isset($element['#id'])) {
+ $attributes['id'] = $element['#id'];
+ }
+ $attributes['class'][] = 'form-checkboxes';
+ if (!empty($element['#attributes']['class'])) {
+ $attributes['class'] = array_merge($attributes['class'], $element['#attributes']['class']);
+ }
+ if (isset($element['#attributes']['title'])) {
+ $attributes['title'] = $element['#attributes']['title'];
+ }
+ $variables['attributes_array'] = $attributes;
+}
diff --git a/includes/preprocess/comment.inc b/includes/preprocess/comment.inc
new file mode 100644
index 0000000..529dbe7
--- /dev/null
+++ b/includes/preprocess/comment.inc
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * @file
+ * comment.inc
+ */
+
+/**
+ * Implements hook_preprocess_comment().
+ */
+function atomium_preprocess_comment(&$variables) {
+ if (isset($variables['elements']['#comment']->new) && $variables['elements']['#comment']->new) {
+ $variables['classes_array'][] = 'new';
+ }
+
+ if ($variables['status'] == "comment-unpublished") {
+ $variables['classes_array'][] = 'unpublished';
+ }
+
+ $variables['classes_array'][] = 'comment-' . $variables['id'];
+ $variables['classes_array'][] = $variables['zebra'];
+
+ // Remove inline class from the ul links.
+ $variables['content']['links']['#attributes']['class'] = array_values(array_diff($variables['content']['links']['#attributes']['class'], array('inline')));
+
+ $variables['attributes_array']['class'] = $variables['classes_array'];
+}
+
+/**
+ * Implements hook_preprocess_comment_wrapper().
+ */
+function atomium_preprocess_comment_wrapper(&$variables) {
+ $variables['attributes_array'] += array('class' => array());
+ $variables += array('classes_array' => array());
+
+ $variables['attributes_array']['class'] = array_merge($variables['attributes_array']['class'], $variables['classes_array']);
+ $variables['attributes_array']['id'] = 'comments-wrapper-' . $variables['node']->nid;
+}
diff --git a/includes/preprocess/container.inc b/includes/preprocess/container.inc
new file mode 100644
index 0000000..a5764d6
--- /dev/null
+++ b/includes/preprocess/container.inc
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * @file
+ * container.inc
+ */
+
+/**
+ * Implements hook_preprocess_container().
+ */
+function atomium_preprocess_container(&$variables) {
+ $element = $variables['element'];
+ // Ensure #attributes is set.
+ $element += array('#attributes' => array());
+
+ // Special handling for form elements.
+ if (isset($element['#array_parents'])) {
+ // Assign an html ID.
+ if (!isset($element['#attributes']['id'])) {
+ $element['#attributes']['id'] = $element['#id'];
+ }
+ // Add the 'form-wrapper' class.
+ $element['#attributes']['class'][] = 'form-wrapper';
+ }
+
+ $variables['attributes_array'] = $element['#attributes'];
+}
diff --git a/includes/preprocess/date.inc b/includes/preprocess/date.inc
new file mode 100644
index 0000000..3138d59
--- /dev/null
+++ b/includes/preprocess/date.inc
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * @file
+ * date.inc
+ */
+
+/**
+ * Implements hook_preprocess_select().
+ */
+function atomium_preprocess_date(&$variables) {
+ $element = $variables['element'];
+
+ $attributes = array();
+ if (isset($element['#id'])) {
+ $attributes['id'] = $element['#id'];
+ }
+ if (!empty($element['#attributes']['class'])) {
+ $attributes['class'] = (array) $element['#attributes']['class'];
+ }
+ $attributes['class'][] = 'container-inline';
+ $variables['attributes_array'] = $attributes;
+}
diff --git a/includes/preprocess/field.inc b/includes/preprocess/field.inc
new file mode 100644
index 0000000..0e346c0
--- /dev/null
+++ b/includes/preprocess/field.inc
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * @file
+ * field.inc
+ */
+
+/**
+ * Implements hook_preprocess_field().
+ */
+function atomium_preprocess_field(&$variables) {
+ $variables += array('attributes_array' => array());
+ $variables['attributes_array'] += array('class' => array());
+ $variables['attributes_array']['class'] = array_merge($variables['attributes_array']['class'], $variables['classes_array']);
+ $variables['content_attributes_array']['class'][] = 'field-items';
+}
diff --git a/includes/preprocess/fieldset.inc b/includes/preprocess/fieldset.inc
new file mode 100644
index 0000000..a1fb3b4
--- /dev/null
+++ b/includes/preprocess/fieldset.inc
@@ -0,0 +1,26 @@
+<?php
+
+/**
+ * @file
+ * fieldset.inc
+ */
+
+/**
+ * Implements hook_preprocess_fieldset().
+ */
+function atomium_preprocess_fieldset(&$variables) {
+ $element = &$variables['element'];
+ element_set_attributes($element, array('id'));
+
+ $element += array(
+ '#attributes' => array(),
+ '#description' => NULL,
+ '#title' => NULL,
+ );
+
+ $variables += array(
+ 'attributes_array' => array(),
+ );
+
+ $variables['attributes_array'] = array_merge($element['#attributes'], (array) $variables['attributes_array']);
+}
diff --git a/includes/preprocess/file.inc b/includes/preprocess/file.inc
new file mode 100644
index 0000000..e0b4389
--- /dev/null
+++ b/includes/preprocess/file.inc
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @file
+ * file.inc
+ */
+
+/**
+ * Implements hook_preprocess_file().
+ */
+function atomium_preprocess_file(&$variables) {
+ $element = $variables['element'];
+ $element['#attributes']['type'] = 'file';
+ element_set_attributes($element, array('id', 'name', 'size'));
+ _form_set_class($element, array('form-file'));
+
+ $variables['attributes_array'] = $element['#attributes'];
+}
diff --git a/includes/preprocess/form.inc b/includes/preprocess/form.inc
new file mode 100644
index 0000000..257ce2a
--- /dev/null
+++ b/includes/preprocess/form.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * form.inc
+ */
+
+/**
+ * Implements hook_preprocess_form().
+ */
+function atomium_preprocess_form(&$variables) {
+ // This file could be removed.
+}
diff --git a/includes/preprocess/form_required_marker.inc b/includes/preprocess/form_required_marker.inc
new file mode 100644
index 0000000..a3f573e
--- /dev/null
+++ b/includes/preprocess/form_required_marker.inc
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * @file
+ * form_required_marker.inc
+ */
+
+/**
+ * Implements hook_preprocess_form_required_marker().
+ */
+function atomium_preprocess_form_required_marker(&$variables) {
+ $t = get_t();
+
+ $attributes = array(
+ 'class' => 'form-required',
+ 'title' => $t('This field is required.'),
+ );
+
+ $variables['attributes_array'] = $attributes;
+ $variables['title'] = '*';
+ if (isset($variables['element']['#field_name'])) {
+ $variables['theme_hook_suggestions'][] = 'form_required_marker__' . $variables['element']['#field_name'];
+ }
+}
diff --git a/includes/preprocess/hidden.inc b/includes/preprocess/hidden.inc
new file mode 100644
index 0000000..422ca4c
--- /dev/null
+++ b/includes/preprocess/hidden.inc
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @file
+ * hidden.inc
+ */
+
+/**
+ * Implements hook_preprocess_hidden().
+ */
+function atomium_preprocess_hidden(&$variables) {
+ $element = $variables['element'];
+ $element['#attributes']['type'] = 'hidden';
+ element_set_attributes($element, array('name', 'value'));
+
+ $variables['attributes_array'] = $element['#attributes'];
+}
diff --git a/includes/preprocess/html.inc b/includes/preprocess/html.inc
new file mode 100644
index 0000000..8d532aa
--- /dev/null
+++ b/includes/preprocess/html.inc
@@ -0,0 +1,114 @@
+<?php
+
+/**
+ * @file
+ * html.inc
+ */
+
+/**
+ * Implements hook_preprocess_html().
+ */
+function atomium_preprocess_html(&$variables, $hook) {
+ // Add variables and paths needed for HTML5 and responsive support.
+ $variables['base_path'] = base_path();
+
+ // Attributes for html element.
+ $variables['html_attributes_array'] = array(
+ 'lang' => $variables['language']->language,
+ 'dir' => $variables['language']->dir,
+ );
+
+ // Return early, so the maintenance page does not call any of the code below.
+ if ('html' != $hook) {
+ return;
+ }
+
+ // Serialize RDF Namespaces into an RDFa 1.1 prefix attribute.
+ if ($variables['rdf_namespaces']) {
+ $prefixes = array();
+ foreach (explode("\n ", ltrim($variables['rdf_namespaces'])) as $namespace) {
+ // Remove xlmns: and ending quote and fix prefix formatting.
+ $prefixes[] = str_replace('="', ': ', substr($namespace, 6, -1));
+ }
+ $variables['rdf_namespaces'] = ' prefix="' . implode(' ', $prefixes) . '"';
+ }
+
+ // Classes for body element. Allows advanced theming based on context
+ // (home page, node of certain type, etc.)
+ if (!$variables['is_front']) {
+ // Add unique class for each page.
+ $path = drupal_get_path_alias($_GET['q']);
+ // Add unique class for each website section.
+ list($section,) = explode('/', $path, 2);
+ $arg = explode('/', $_GET['q']);
+ if ($arg[0] == 'node' && isset($arg[1])) {
+ if ($arg[1] == 'add') {
+ $section = 'node-add';
+ }
+ elseif (isset($arg[2]) && is_numeric($arg[1]) && ($arg[2] == 'edit' || $arg[2] == 'delete')) {
+ $section = 'node-' . $arg[2];
+ }
+ }
+ $variables['classes_array'][] = 'section-' . $section;
+ }
+
+ // Store the menu item since it has some useful information.
+ $variables['menu_item'] = menu_get_item();
+ if ($variables['menu_item']) {
+ switch ($variables['menu_item']['page_callback']) {
+ case 'views_page':
+ // Is this a Views page?
+ $variables['classes_array'][] = 'page-views';
+ break;
+
+ case 'page_manager_blog':
+ case 'page_manager_blog_user':
+ case 'page_manager_contact_site':
+ case 'page_manager_contact_user':
+ case 'page_manager_node_add':
+ case 'page_manager_node_edit':
+ case 'page_manager_node_view_page':
+ case 'page_manager_page_execute':
+ case 'page_manager_poll':
+ case 'page_manager_search_page':
+ case 'page_manager_term_view_page':
+ case 'page_manager_user_edit_page':
+ case 'page_manager_user_view_page':
+ // Is this a Panels page?
+ $variables['classes_array'][] = 'page-panels';
+ break;
+ }
+ }
+
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('html')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('not-front')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('front')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('logged-in')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('not-logged-in')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('two-sidebars')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('one-sidebar sidebar-first')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('one-sidebar sidebar-second')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('no-sidebars')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('toolbar')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('toolbar-drawer')));
+ $variables['classes_array'] = preg_grep('/^page-node/', $variables['classes_array'], PREG_GREP_INVERT);
+ $variables['classes_array'] = preg_grep('/^node-type/', $variables['classes_array'], PREG_GREP_INVERT);
+ $path_all = drupal_get_path_alias($_GET['q']);
+ $variables['classes_array'][] = 'path-' . $path_all;
+ $path = explode('/', $_SERVER['REQUEST_URI']);
+ if ($path['1']) {
+ $variables['classes_array'][] = 'pathone-' . $path['1'];
+ }
+
+ $headers = drupal_get_http_header();
+ if (isset($headers['status'])) {
+ $variables['classes_array'][] = "status-" . $headers['status'];
+ if ($headers['status'] == '404 Not Found') {
+ $variables['theme_hook_suggestions'][] = 'html__404';
+ }
+ }
+
+ $variables['html_attributes_array'] += array('class' => array());
+ $variables['attributes_array'] += array('class' => array());
+ $variables['attributes_array']['class'] = array_merge($variables['attributes_array']['class'], $variables['classes_array']);
+}
diff --git a/includes/preprocess/html_tag.inc b/includes/preprocess/html_tag.inc
new file mode 100644
index 0000000..fff4dc2
--- /dev/null
+++ b/includes/preprocess/html_tag.inc
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * @file
+ * html_tag.inc
+ */
+
+/**
+ * Implements hook_preprocess_html_tag().
+ */
+function atomium_preprocess_html_tag(&$variables) {
+ $element = &$variables['element'];
+
+ // Loop over element children, render them, and add them to the #value string.
+ foreach (element_children($variables['element']) as $key) {
+ if ($variables['element']['#value'] === NULL) {
+ // Set this to string to avoid E_NOTICE error when concatenating to NULL.
+ $variables['element']['#value'] = '';
+ }
+ // Concatenate the rendered child onto the element #value.
+ $variables['element']['#value'] .= drupal_render($variables['element'][$key]);
+ }
+
+ $variables['attributes_array'] = $variables['element']['#attributes'];
+
+ if (isset($variables['element']['#tag'])) {
+ $variables['theme_hook_suggestions'][] = 'html_tag__' . $variables['element']['#tag'];
+ }
+
+ $element += array('#value' => '');
+}
diff --git a/includes/preprocess/image.inc b/includes/preprocess/image.inc
new file mode 100644
index 0000000..b98c888
--- /dev/null
+++ b/includes/preprocess/image.inc
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * @file
+ * image.inc
+ */
+
+/**
+ * Implements hook_preprocess_image().
+ */
+function atomium_preprocess_image(&$variables) {
+ $attributes = $variables['attributes'];
+ $attributes['src'] = file_create_url($variables['path']);
+
+ foreach (array('width', 'height', 'alt', 'title') as $key) {
+
+ if (isset($variables[$key])) {
+ $attributes[$key] = $variables[$key];
+ }
+ }
+
+ if (isset($variables['style_name'])) {
+ $variables['theme_hook_suggestions'][] = 'image__' . $variables['style_name'];
+ }
+
+ $variables['attributes_array'] = $attributes;
+
+}
diff --git a/includes/preprocess/image_button.inc b/includes/preprocess/image_button.inc
new file mode 100644
index 0000000..7a94205
--- /dev/null
+++ b/includes/preprocess/image_button.inc
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * @file
+ * image_button.inc
+ */
+
+/**
+ * Implements hook_preprocess_image_button().
+ */
+function atomium_preprocess_image_button(&$variables) {
+ $element = $variables['element'];
+ $element['#attributes']['type'] = 'image';
+ element_set_attributes($element, array('id', 'name', 'value'));
+
+ $element['#attributes']['src'] = file_create_url($element['#src']);
+ if (!empty($element['#title'])) {
+ $element['#attributes']['alt'] = $element['#title'];
+ $element['#attributes']['title'] = $element['#title'];
+ }
+
+ $element['#attributes']['class'][] = 'form-' . $element['#button_type'];
+ if (!empty($element['#attributes']['disabled'])) {
+ $element['#attributes']['class'][] = 'form-button-disabled';
+ }
+
+ $variables['attributes_array'] = $element['#attributes'];
+}
diff --git a/includes/preprocess/link.inc b/includes/preprocess/link.inc
new file mode 100644
index 0000000..0d8b2fa
--- /dev/null
+++ b/includes/preprocess/link.inc
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * @file
+ * link.inc
+ */
+
+/**
+ * Implements hook_preprocess_link().
+ */
+function atomium_preprocess_link(&$variables) {
+ $variables['attributes_array'] = $variables['options']['attributes'];
+ $variables['url'] = check_plain(url($variables['path'], $variables['options']));
+ $variables['text'] = ($variables['options']['html'] ? $variables['text'] : check_plain($variables['text']));
+}
diff --git a/includes/preprocess/menu_link.inc b/includes/preprocess/menu_link.inc
new file mode 100644
index 0000000..22c8cc0
--- /dev/null
+++ b/includes/preprocess/menu_link.inc
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * @file
+ * menu_link.inc
+ */
+
+/**
+ * Implements hook_preprocess_menu_link().
+ */
+function atomium_preprocess_menu_link(&$variables) {
+ $element = $variables['element'];
+ $sub_menu = '';
+
+ if ($element['#below']) {
+ $sub_menu = drupal_render($element['#below']);
+ }
+ $output = l($element['#title'], $element['#href'], $element['#localized_options']);
+
+ $variables['attributes_array'] = $element['#attributes'];
+ $variables['sub_menu'] = $sub_menu;
+ $variables['output'] = $output;
+
+ if (isset($variables['element']['#original_link']['mlid'])) {
+ $variables['theme_hook_suggestions'][] = 'menu_link__' . $variables['element']['#original_link']['mlid'];
+ }
+}
diff --git a/includes/preprocess/menu_tree.inc b/includes/preprocess/menu_tree.inc
new file mode 100644
index 0000000..39442bd
--- /dev/null
+++ b/includes/preprocess/menu_tree.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * menu_tree.inc
+ */
+
+/**
+ * Implements hook_preprocess_menu_tree().
+ */
+function atomium_preprocess_menu_tree(&$variables) {
+ $variables['attributes_array']['class'][] = 'menu';
+}
diff --git a/includes/preprocess/more_link.inc b/includes/preprocess/more_link.inc
new file mode 100644
index 0000000..b880e79
--- /dev/null
+++ b/includes/preprocess/more_link.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * more_link.inc
+ */
+
+/**
+ * Implements hook_preprocess_more_link().
+ */
+function atomium_preprocess_more_link(&$variables) {
+ $variables['link'] = l(t('More'), $variables['url'], array('attributes' => array('title' => $variables['title'])));
+}
diff --git a/includes/preprocess/node.inc b/includes/preprocess/node.inc
new file mode 100644
index 0000000..98d2231
--- /dev/null
+++ b/includes/preprocess/node.inc
@@ -0,0 +1,103 @@
+<?php
+
+/**
+ * @file
+ * node.inc
+ */
+
+/**
+ * Implements hook_preprocess_node().
+ */
+function atomium_preprocess_node(&$variables) {
+ // One unified node teaser template.
+ if ($variables['view_mode'] == "teaser") {
+ $variables['theme_hook_suggestions'][] = 'node__nodeteaser';
+ }
+
+ if ($variables['view_mode'] == "teaser" and $variables['promote']) {
+ $variables['theme_hook_suggestions'][] = 'node__nodeteaser__promote';
+ }
+
+ if ($variables['view_mode'] == "teaser" and $variables['sticky']) {
+ $variables['theme_hook_suggestions'][] = 'node__nodeteaser__sticky';
+ }
+
+ if ($variables['view_mode'] == "teaser" and $variables['is_front']) {
+ $variables['theme_hook_suggestions'][] = 'node__nodeteaser__front';
+ }
+
+ $variables['theme_hook_suggestions'][] = 'node__' . $variables['type'] . '__' . $variables['view_mode'];
+
+ // Add a noderef to the list.
+ if (isset($variables['referencing_field'])) {
+ $variables['theme_hook_suggestions'][] = 'node__noderef';
+ $variables['theme_hook_suggestions'][] = 'node__noderef__' . $variables['type'];
+ $variables['theme_hook_suggestions'][] = 'node__noderef__' . $variables['type'] . '__' . $variables['view_mode'];
+ }
+
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('node')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('node-sticky')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('node-unpublished')));
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('node-promoted')));
+
+ // Change node-xxx to a more generalised name so we can use the same class
+ // other places in the comments.
+ $variables['classes_array'] = array_values(
+ array_diff(
+ $variables['classes_array'],
+ array('node-sticky', 'node-unpublished', 'node-promoted')
+ )
+ );
+
+ if ($variables['promote']) {
+ $variables['classes_array'][] = 'promote';
+ }
+ if ($variables['sticky']) {
+ $variables['classes_array'][] = 'sticky';
+ }
+ if ('0' == $variables['status']) {
+ $variables['classes_array'][] = 'unpublished';
+ }
+
+ if (isset($variables['preview'])) {
+ $variables['classes_array'][] = 'node-preview';
+ }
+
+ $variables['id_node'] = 'node-' . $variables['nid'];
+
+ // Remove class from the ul that holds the links <ul class="inline links">.
+ // This is generated in the node_build_content() function in the node.module.
+ $variables['content']['links']['#attributes']['class'] = array_values(array_diff($variables['content']['links']['#attributes']['class'], array('inline')));
+ $variables['content']['links']['#attributes']['class'] = array_values(array_diff($variables['content']['links']['#attributes']['class'], array('links')));
+
+ // Remove the class attribute it its empty.
+ if (isset($variables['content']['links']['#attributes']['class']) && empty($variables['content']['links']['#attributes']['class'])) {
+ unset($variables['content']['links']['#attributes']['class']);
+ }
+
+ // Add $unpublished variable.
+ $variables['unpublished'] = (!$variables['status']) ? TRUE : FALSE;
+
+ // Set preview variable to FALSE if it doesn't exist.
+ $variables['preview'] = isset($variables['preview']) ? $variables['preview'] : FALSE;
+
+ // Add pubdate to submitted variable.
+ $variables['pubdate'] = '<time pubdate datetime="' . format_date($variables['node']->created, 'custom', 'c') . '">' . $variables['date'] . '</time>';
+ if ($variables['display_submitted']) {
+ $variables['submitted'] = t('Submitted by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['pubdate']));
+ }
+
+ // Add a class for the view mode.
+ $variables['classes_array'][] = 'view-mode-' . $variables['view_mode'];
+
+ // Add a class to show node is authored by current user.
+ if ($variables['uid'] && $variables['uid'] == $GLOBALS['user']->uid) {
+ $variables['classes_array'][] = 'node-by-viewer';
+ }
+
+ $variables['classes_array'][] = 'node-' . $variables['nid'];
+ $variables['attributes_array']['class'] = $variables['classes_array'];
+ $variables['attributes_array']['role'] = 'article';
+ $variables['attributes_array']['id'] = 'node-' . $variables['nid'];
+
+}
diff --git a/includes/preprocess/page.inc b/includes/preprocess/page.inc
new file mode 100644
index 0000000..af79cb3
--- /dev/null
+++ b/includes/preprocess/page.inc
@@ -0,0 +1,60 @@
+<?php
+
+/**
+ * @file
+ * page.inc
+ */
+
+/**
+ * Implements hook_preprocess_page().
+ */
+function atomium_preprocess_page(&$variables, $hook) {
+ $variables['page_manager_control'] = NULL;
+ if (isset($variables['node'])) {
+ // Tell the template whether the node is panelizer-controlled.
+ $variables['page_manager_control'] = isset($variables['node']->panelizer_view_mode) ? $variables['node']->panelizer_view_mode : NULL;
+ }
+
+ // page--nodetype.tpl.php.
+ if (isset($variables['node'])) {
+ $variables['theme_hook_suggestions'][] = 'page__' . $variables['node']->type;
+ }
+
+ // Custom 404.
+ $headers = drupal_get_http_header();
+ if (isset($headers['status']) && $headers['status'] == '404 Not Found') {
+ $variables['theme_hook_suggestions'][] = 'page__404';
+ }
+
+ // Remove the "theres no content default yadi yada" from the frontpage.
+ unset($variables['page']['content']['system_main']['default_message']);
+
+ // Remove the block template wrapper from the main content block.
+ $variables['page']['content']['system_main']['#theme_wrappers'] = array_diff($variables['page']['content']['system_main']['#theme_wrappers'], array('block'));
+
+ /*-
+ USER ACCOUNT TABS
+ Removes the tabs from user login, register & password
+ fixes the titles to so no more "user account" all over
+ */
+ switch (current_path()) {
+ case 'user':
+ $variables['title'] = t('Login');
+ unset($variables['tabs']);
+ break;
+
+ case 'user/register':
+ $variables['title'] = t('New account');
+ unset($variables['tabs']);
+ break;
+
+ case 'user/password':
+ $variables['title'] = t('I forgot my password');
+ unset($variables['tabs']);
+ break;
+
+ default:
+ // code...
+ break;
+ }
+}
diff --git a/includes/preprocess/password.inc b/includes/preprocess/password.inc
new file mode 100644
index 0000000..968564b
--- /dev/null
+++ b/includes/preprocess/password.inc
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @file
+ * password.inc
+ */
+
+/**
+ * Implements hook_preprocess_password().
+ */
+function atomium_preprocess_password(&$variables) {
+ $element = $variables['element'];
+ $element['#attributes']['type'] = 'password';
+ element_set_attributes($element, array('id', 'name', 'size', 'maxlength'));
+ _form_set_class($element, array('form-text'));
+
+ $variables['attributes_array'] = $element['#attributes'];
+}
diff --git a/includes/preprocess/radio.inc b/includes/preprocess/radio.inc
new file mode 100644
index 0000000..51664f6
--- /dev/null
+++ b/includes/preprocess/radio.inc
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * @file
+ * radio.inc
+ */
+
+/**
+ * Implements hook_preprocess_select().
+ */
+function atomium_preprocess_radio(&$variables) {
+ $element = $variables['element'];
+ $element['#attributes']['type'] = 'radio';
+ element_set_attributes(
+ $element,
+ array(
+ 'id',
+ 'name',
+ '#return_value' => 'value',
+ )
+ );
+
+ if (isset($element['#return_value']) && $element['#value'] !== FALSE && $element['#value'] == $element['#return_value']) {
+ $element['#attributes']['checked'] = 'checked';
+ }
+ _form_set_class($element, array('form-radio'));
+ $variables['attributes_array'] = $element['#attributes'];
+}
diff --git a/includes/preprocess/region.inc b/includes/preprocess/region.inc
new file mode 100644
index 0000000..257b064
--- /dev/null
+++ b/includes/preprocess/region.inc
@@ -0,0 +1,14 @@
+<?php
+
+/**
+ * @file
+ * region.inc
+ */
+
+/**
+ * Implements hook_preprocess_region().
+ */
+function atomium_preprocess_region(&$variables) {
+ $variables['classes_array'] = array_values(array_diff($variables['classes_array'], array('region')));
+ $variables['attributes_array']['class'] = $variables['classes_array'];
+}
diff --git a/includes/preprocess/select.inc b/includes/preprocess/select.inc
new file mode 100644
index 0000000..5d85c4b
--- /dev/null
+++ b/includes/preprocess/select.inc
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * @file
+ * select.inc
+ */
+
+/**
+ * Implements hook_preprocess_select().
+ */
+function atomium_preprocess_select(&$variables) {
+ $element = &$variables['element'];
+ element_set_attributes($element, array('id', 'name', 'size'));
+ _form_set_class($element, array('form-select'));
+
+ if (isset($element['#field_name'])) {
+ $variables['theme_hook_suggestions'][] = 'select__' . $element['#field_name'];
+ }
+ if (isset($element['#entity_type'])) {
+ $variables['theme_hook_suggestions'][] = 'select__' . $element['#entity_type'];
+ if (isset($element['#field_name'])) {
+ $variables['theme_hook_suggestions'][] = 'select__' . $element['#entity_type'] . '__' . $element['#field_name'];
+ }
+ if (isset($element['#bundle'])) {
+ $variables['theme_hook_suggestions'][] = 'select__' . $element['#entity_type'] . '__' . $element['#bundle'];
+ }
+ }
+
+ $variables['attributes_array'] = $variables['element']['#attributes'];
+ $variables['options'] = form_select_options($variables['element']);
+}
diff --git a/includes/preprocess/textarea.inc b/includes/preprocess/textarea.inc
new file mode 100644
index 0000000..b30ddd5
--- /dev/null
+++ b/includes/preprocess/textarea.inc
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @file
+ * textarea.inc
+ */
+
+/**
+ * Implements hook_preprocess_textarea().
+ */
+function atomium_preprocess_textarea(&$variables) {
+ $element = &$variables['element'];
+
+ element_set_attributes($element, array('id', 'name', 'cols', 'rows'));
+ _form_set_class($element, array('form-textarea'));
+
+ if (isset($element['#title']) && !empty($element['#title'])) {
+ $element['#attributes']['placeholder'] = $element['#title'];
+ }
+
+ $wrapper_attributes = array(
+ 'class' => array('form-textarea-wrapper'),
+ );
+
+ // Add resizable behavior.
+ if (!empty($element['#resizable'])) {
+ drupal_add_library('system', 'drupal.textarea');
+ $wrapper_attributes['class'][] = 'resizable';
+ }
+
+ if (isset($element['#field_name'])) {
+ $variables['theme_hook_suggestions'][] = 'textarea__' . $element['#field_name'];
+ }
+ if (isset($element['#entity_type'])) {
+ $variables['theme_hook_suggestions'][] = 'textarea__' . $element['#entity_type'];
+ if (isset($element['#field_name'])) {
+ $variables['theme_hook_suggestions'][] = 'textarea__' . $element['#entity_type'] . '__' . $element['#field_name'];
+ }
+ if (isset($element['#bundle'])) {
+ $variables['theme_hook_suggestions'][] = 'textarea__' . $element['#entity_type'] . '__' . $element['#bundle'];
+ }
+ }
+
+ $variables['attributes_array'] = $element['#attributes'];
+ $variables['wrapper_attributes_array'] = $wrapper_attributes;
+}
diff --git a/includes/preprocess/textfield.inc b/includes/preprocess/textfield.inc
new file mode 100644
index 0000000..6eff6ed
--- /dev/null
+++ b/includes/preprocess/textfield.inc
@@ -0,0 +1,60 @@
+<?php
+
+/**
+ * @file
+ * textfield.inc
+ */
+
+/**
+ * Implements hook_preprocess_textfield().
+ */
+function atomium_preprocess_textfield(&$variables) {
+ $element = &$variables['element'];
+
+ if (isset($element['#title']) && !empty($element['#title'])) {
+ $element['#attributes']['placeholder'] = $element['#title'];
+ }
+
+ $element['#attributes']['type'] = 'text';
+ element_set_attributes(
+ $element,
+ array(
+ 'id',
+ 'name',
+ 'value',
+ 'size',
+ 'maxlength',
+ )
+ );
+ _form_set_class($element, array('form-text'));
+
+ $extra = '';
+ if ($element['#autocomplete_path'] && !empty($element['#autocomplete_input'])) {
+ drupal_add_library('system', 'drupal.autocomplete');
+ $element['#attributes']['class'][] = 'form-autocomplete';
+
+ $attributes = array();
+ $attributes['type'] = 'hidden';
+ $attributes['id'] = $element['#autocomplete_input']['#id'];
+ $attributes['value'] = $element['#autocomplete_input']['#url_value'];
+ $attributes['disabled'] = 'disabled';
+ $attributes['class'][] = 'autocomplete';
+ $extra = '<input' . drupal_attributes($attributes) . ' />';
+ }
+
+ if (isset($element['#field_name'])) {
+ $variables['theme_hook_suggestions'][] = 'textfield__' . $element['#field_name'];
+ }
+ if (isset($element['#entity_type'])) {
+ $variables['theme_hook_suggestions'][] = 'textfield__' . $element['#entity_type'];
+ if (isset($element['#field_name'])) {
+ $variables['theme_hook_suggestions'][] = 'textfield__' . $element['#entity_type'] . '__' . $element['#field_name'];
+ }
+ if (isset($element['#bundle'])) {
+ $variables['theme_hook_suggestions'][] = 'textfield__' . $element['#entity_type'] . '__' . $element['#bundle'];
+ }
+ }
+
+ $variables['attributes_array'] = $element['#attributes'];
+ $variables['extra'] = $extra;
+}
diff --git a/includes/preprocess/user.inc b/includes/preprocess/user.inc
new file mode 100644
index 0000000..68c6bad
--- /dev/null
+++ b/includes/preprocess/user.inc
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * @file
+ * user.inc
+ */
+
+/**
+ * Implements hook_preprocess_user_profile().
+ */
+function atomium_preprocess_user_profile(&$variables) {
+ $variables['classes_array'][] = 'profile';
+ $variables['attributes_array'] += array('class' => array());
+ $variables['attributes_array']['class'] = array_merge($variables['attributes_array']['class'], $variables['classes_array']);
+}
diff --git a/includes/preprocess/username.inc b/includes/preprocess/username.inc
new file mode 100644
index 0000000..c330abd
--- /dev/null
+++ b/includes/preprocess/username.inc
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @file
+ * username.inc
+ */
+
+/**
+ * Implements hook_preprocess_username().
+ */
+function atomium_preprocess_username(&$variables) {
+ if (isset($variables['uid'])) {
+ $variables['theme_hook_suggestions'][] = 'username__uid_' . $variables['uid'];
+ }
+ if (isset($variables['name'])) {
+ $variables['theme_hook_suggestions'][] = 'username__name_' . $variables['name'];
+ }
+}
diff --git a/includes/preprocess/vertical_tabs.inc b/includes/preprocess/vertical_tabs.inc
new file mode 100644
index 0000000..a72117b
--- /dev/null
+++ b/includes/preprocess/vertical_tabs.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * vertical_tabs.inc
+ */
+
+/**
+ * Implements hook_preprocess_vertical_tabs().
+ */
+function atomium_preprocess_vertical_tabs(&$variables) {
+ drupal_add_library('system', 'drupal.vertical-tabs');
+}
diff --git a/includes/process.inc b/includes/process.inc
new file mode 100644
index 0000000..180ef75
--- /dev/null
+++ b/includes/process.inc
@@ -0,0 +1,60 @@
+<?php
+
+/**
+ * @file
+ * process.inc
+ */
+
+/**
+ * Implements hook_process().
+ */
+function atomium_process(&$variables, $hook) {
+ // Trim each variables that goes into the templates.
+ // This needs to be done before the attributes processing because
+ // drupal_attributes() adds en extra space on purpose.
+ array_walk($variables, function (&$value) {
+ if (is_string($value)) {
+ $value = trim($value);
+ }
+ });
+
+ /* Attributes processing */
+ // Initialize some keys to avoid warnings later.
+ $variables += array(
+ 'classes_array' => array(),
+ 'attributes_array' => array(),
+ 'title_attributes_array' => array(),
+ 'content_attributes_array' => array(),
+ 'wrapper_attributes_array' => array(),
+ );
+
+ // Convert all variables '*_attributes_array' into a valid
+ // '*_attributes' variable.
+ foreach ($variables as $variable_name => $variable_content) {
+ if (strpos($variable_name, 'attributes_array') !== FALSE) {
+ $variable_content = array_filter($variable_content, function($value) {
+ return ($value !== null && $value !== false && $value !== '');
+ });
+ $new_variable = substr($variable_name, 0, -6);
+ $variables[$new_variable] = NULL;
+ if (!empty($variable_content) && is_array($variable_content)) {
+ if (isset($variable_content['class'])) {
+ $variable_content['class'] = array_map('drupal_html_class', (array) $variable_content['class']);
+ }
+ if (isset($variable_content['placeholder'])) {
+ $variable_content['placeholder'] = strip_tags($variable_content['placeholder']);
+ }
+ $variables[$new_variable] = drupal_attributes($variable_content);
+ }
+ }
+ }
+ /* End of attributes processing */
+
+ // Convert 'classes_array' into 'classes'.
+ if (isset($variables['classes_array']) && is_array($variables['classes_array'])) {
+ $classes_array = $variables['classes_array'];
+ array_walk($classes_array, 'drupal_html_class');
+ $variables['classes'] = implode(' ', $classes_array);
+ }
+
+}
diff --git a/includes/process/block.inc b/includes/process/block.inc
new file mode 100644
index 0000000..7e5b5b8
--- /dev/null
+++ b/includes/process/block.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * block.inc
+ */
+
+/**
+ * Implements hook_process_block().
+ */
+function atomium_process_block(&$variables) {
+
+}
diff --git a/includes/process/breadcrumb.inc b/includes/process/breadcrumb.inc
new file mode 100644
index 0000000..73966a7
--- /dev/null
+++ b/includes/process/breadcrumb.inc
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @file
+ * breadcrumb.inc
+ */
+
+/**
+ * Implements hook_process_breadcrumb().
+ */
+function atomium_process_breadcrumb(&$variables) {
+ $variables['links'] = array(
+ '#theme' => 'item_list',
+ '#items' => $variables['breadcrumb'],
+ '#type' => 'ul',
+ '#attributes' => $variables['attributes_array'],
+ );
+}
diff --git a/includes/process/date.inc b/includes/process/date.inc
new file mode 100644
index 0000000..e122ec5
--- /dev/null
+++ b/includes/process/date.inc
@@ -0,0 +1,14 @@
+<?php
+
+/**
+ * @file
+ * date.inc
+ */
+
+/**
+ * Implements hook_process_date().
+ */
+function atomium_process_date(&$variables) {
+ $element = $variables['element'];
+ $variables['date'] = drupal_render_children($element);
+}
diff --git a/includes/process/field.inc b/includes/process/field.inc
new file mode 100644
index 0000000..d51abe5
--- /dev/null
+++ b/includes/process/field.inc
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @file
+ * field.inc
+ */
+
+/**
+ * Implements hook_process_field().
+ */
+function atomium_process_field(&$variables, $hook) {
+ foreach ($variables['items'] as $delta => $item) {
+ $variables['item_attributes_array'][$delta] = array('class' => array());
+ $variables['item_attributes_array'][$delta]['class'][] = 'field-item';
+ $variables['item_attributes_array'][$delta]['class'][] = $delta % 2 ? 'even' : 'odd';
+ $variables['item_attributes'][$delta] = empty($variables['item_attributes_array'][$delta]) ? '' : drupal_attributes($variables['item_attributes_array'][$delta]);
+ }
+}
diff --git a/includes/process/fieldset.inc b/includes/process/fieldset.inc
new file mode 100644
index 0000000..cceaca2
--- /dev/null
+++ b/includes/process/fieldset.inc
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * @file
+ * fieldset.inc
+ */
+
+/**
+ * Implements hook_process_fieldset().
+ */
+function atomium_process_fieldset(&$variables) {
+ $element = &$variables['element'];
+
+ $variables['title'] = $element['#title'];
+ $variables['description'] = $element['#description'];
+}
diff --git a/includes/process/form.inc b/includes/process/form.inc
new file mode 100644
index 0000000..428b022
--- /dev/null
+++ b/includes/process/form.inc
@@ -0,0 +1,22 @@
+<?php
+
+/**
+ * @file
+ * form.inc
+ */
+
+/**
+ * Implements hook_process_form().
+ */
+function atomium_process_form(&$variables) {
+ $element = $variables['element'];
+ if (isset($element['#action'])) {
+ $element['#attributes']['action'] = drupal_strip_dangerous_protocols($element['#action']);
+ }
+ element_set_attributes($element, array('method', 'id'));
+ if (empty($element['#attributes']['accept-charset'])) {
+ $element['#attributes']['accept-charset'] = "UTF-8";
+ }
+
+ $variables['attributes'] = drupal_attributes($element['#attributes']);
+}
diff --git a/includes/process/form_required_marker.inc b/includes/process/form_required_marker.inc
new file mode 100644
index 0000000..b939e7b
--- /dev/null
+++ b/includes/process/form_required_marker.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * form_required_marker.inc
+ */
+
+/**
+ * Implements hook_process_form_required_marker().
+ */
+function atomium_process_form_required_marker(&$variables) {
+ // This file is useless and can be removed.
+}
diff --git a/includes/process/html.inc b/includes/process/html.inc
new file mode 100644
index 0000000..a48b0f8
--- /dev/null
+++ b/includes/process/html.inc
@@ -0,0 +1,53 @@
+<?php
+
+/**
+ * @file
+ * html.inc
+ */
+
+/**
+ * Implements hook_process_html().
+ */
+function atomium_process_html(&$variables, $hook) {
+ preg_match_all('/<script(?![^>]+src).*?>([\s\S]*?)<\/script>/s', $variables['scripts'], $matches, PREG_SET_ORDER);
+ foreach ($matches as $match) {
+ if ($newtag = _atomium_convert_js_inline_to_file($match[1])) {
+ $variables['scripts'] = str_replace($match[0], $newtag, $variables['scripts']);
+ }
+ }
+}
+
+/**
+ * Custom callback.
+ */
+function _atomium_convert_js_inline_to_file($data) {
+ $directory = "public://js";
+ $path = $directory . '/' . sha1($data) . '.js';
+
+ if (!is_dir($directory) || !is_writable($directory)) {
+ if (file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS)) {
+ }
+ }
+
+ $query_string = REQUEST_TIME;
+
+ $element = array(
+ '#tag' => 'script',
+ '#value' => '',
+ '#attributes' => array(
+ 'type' => 'text/javascript',
+ ),
+ );
+
+ if (file_exists($path)) {
+ $element['#attributes']['src'] = file_create_url($path) . '?' . $query_string;
+ return theme('html_tag', array('element' => $element));
+ }
+
+ if ($path = file_unmanaged_save_data($data, $path, FILE_EXISTS_REPLACE)) {
+ $element['#attributes']['src'] = file_create_url($path) . '?' . $query_string;
+ return theme('html_tag', array('element' => $element));
+ }
+
+ return FALSE;
+}
diff --git a/includes/process/html_tag.inc b/includes/process/html_tag.inc
new file mode 100644
index 0000000..7ab95dc
--- /dev/null
+++ b/includes/process/html_tag.inc
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * @file
+ * html_tag.inc
+ */
+
+/**
+ * Implements hook_process_html_tag().
+ */
+function atomium_process_html_tag(&$variables) {
+ $el = &$variables['element'];
+
+ // Remove type="..." and CDATA prefix/suffix.
+ unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);
+
+ // Remove media="all" but leave others unaffected.
+ if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {
+ unset($el['#attributes']['media']);
+ }
+}
diff --git a/includes/process/select.inc b/includes/process/select.inc
new file mode 100644
index 0000000..88a9db8
--- /dev/null
+++ b/includes/process/select.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * select.inc
+ */
+
+/**
+ * Implements hook_process_select().
+ */
+function atomium_process_select(&$variables) {
+ // This file could be deleted.
+}
diff --git a/includes/process/textarea.inc b/includes/process/textarea.inc
new file mode 100644
index 0000000..b3f2c38
--- /dev/null
+++ b/includes/process/textarea.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * textarea.inc
+ */
+
+/**
+ * Implements hook_process_textarea().
+ */
+function atomium_process_textarea(&$variables) {
+ // This file could be removed.
+}
diff --git a/includes/process/username.inc b/includes/process/username.inc
new file mode 100644
index 0000000..b720754
--- /dev/null
+++ b/includes/process/username.inc
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * @file
+ * username.inc
+ */
+
+/**
+ * Implements hook_process_username().
+ */
+function atomium_process_username(&$variables) {
+ if (isset($variables['link_path'])) {
+ $variables['name'] = l($variables['name'] . $variables['extra'], $variables['link_path'], $variables['link_options']);
+ }
+}
diff --git a/includes/registry.inc b/includes/registry.inc
new file mode 100644
index 0000000..a9a6a47
--- /dev/null
+++ b/includes/registry.inc
@@ -0,0 +1,569 @@
+<?php
+
+/**
+ * @file
+ * List of functions used to alter the theme registry in Atomium based themes.
+ */
+
+/**
+ * @addtogroup registry
+ * @{
+ */
+
+// Define additional sub-groups for creating lists for all the theme files.
+/**
+ * @defgroup theme_functions Theme Functions (.func.php)
+ *
+ * List of theme functions used in the Drupal Atomium base theme.
+ *
+ * View the parent topic for additional documentation.
+ */
+/**
+ * @defgroup theme_preprocess Theme Preprocess Functions (.vars.php)
+ *
+ * List of theme preprocess functions used in the Drupal Atomium base theme.
+ *
+ * View the parent topic for additional documentation.
+ */
+/**
+ * @defgroup theme_process Theme Process Functions (.vars.php)
+ *
+ * List of theme process functions used in the Drupal Atomium base theme.
+ *
+ * View the parent topic for additional documentation.
+ */
+/**
+ * @defgroup templates Theme Templates (.tpl.php)
+ *
+ * List of theme templates used in the Drupal Atomium base theme.
+ *
+ * View the parent topic for additional documentation.
+ */
+
+/**
+ * Stub implementation for atomium_theme().
+ *
+ * This base-theme's custom theme hook implementations. Never define "path"
+ * or "template" as these are detected and automatically added.
+ *
+ * @see atomium_theme_registry_alter()
+ * @see atomium_theme()
+ * @see hook_theme()
+ */
+function _atomium_theme(&$existing, $type, $theme, $path) {
+ $hooks['fieldset'] = array(
+ 'render element' => 'element',
+ 'template' => 'fieldset',
+ );
+
+ $hooks['breadcrumb'] = array(
+ 'variables' => array('breadcrumb' => NULL),
+ 'template' => 'breadcrumb',
+ );
+
+ $hooks['form_required_marker'] = array(
+ 'render element' => 'element',
+ 'template' => 'form-required-marker',
+ );
+
+ $hooks['form'] = array(
+ 'render element' => 'element',
+ 'template' => 'form',
+ );
+
+ $hooks['block'] = array(
+ 'render element' => 'elements',
+ 'template' => 'block',
+ );
+
+ $hooks['textfield'] = array(
+ 'render element' => 'element',
+ 'template' => 'textfield',
+ );
+
+ $hooks['html_tag'] = array(
+ 'render element' => 'element',
+ 'template' => 'html-tag',
+ );
+
+ $hooks['select'] = array(
+ 'render element' => 'element',
+ 'template' => 'select',
+ );
+
+ $hooks['radio'] = array(
+ 'render element' => 'element',
+ 'template' => 'radio',
+ );
+
+ $hooks['checkbox'] = array(
+ 'render element' => 'element',
+ 'template' => 'checkbox',
+ );
+
+ $hooks['checkboxes'] = array(
+ 'render element' => 'element',
+ 'template' => 'checkboxes',
+ );
+
+ $hooks['date'] = array(
+ 'render element' => 'element',
+ 'template' => 'date',
+ );
+
+ $hooks['vertical_tabs'] = array(
+ 'render element' => 'element',
+ 'template' => 'vertical_tabs',
+ );
+
+ $hooks['button'] = array(
+ 'render element' => 'element',
+ 'template' => 'button',
+ );
+
+ $hooks['image_button'] = array(
+ 'render element' => 'element',
+ 'template' => 'image_button',
+ );
+
+ $hooks['hidden'] = array(
+ 'render element' => 'element',
+ 'template' => 'hidden',
+ );
+
+ $hooks['container'] = array(
+ 'render element' => 'element',
+ 'template' => 'container',
+ );
+
+ $hooks['file'] = array(
+ 'render element' => 'element',
+ 'template' => 'file',
+ );
+
+ $hooks['menu_tree'] = array(
+ 'template' => 'menu_tree',
+ );
+
+ $hooks['menu_link'] = array(
+ 'render element' => 'element',
+ 'template' => 'menu-link',
+ );
+
+ $hooks['link'] = array(
+ 'render element' => 'element',
+ 'template' => 'link',
+ );
+
+ $hooks['username'] = array(
+ 'render element' => 'element',
+ 'template' => 'username',
+ );
+
+ $hooks['username_link'] = array(
+ 'render element' => 'element',
+ 'template' => 'username-link',
+ );
+
+ $hooks['more_link'] = array(
+ 'render element' => 'element',
+ 'template' => 'more-link',
+ );
+
+ $hooks['admin_block'] = array(
+ 'template' => 'admin-block',
+ );
+
+ $hooks['image'] = array(
+ 'template' => 'image',
+ );
+
+ return $hooks;
+}
+
+/**
+ * Implements hook_theme_registry_alter().
+ */
+function atomium_theme_registry_alter(&$registry) {
+ // Retrieve the active theme names.
+ $themes = _atomium_get_base_themes(NULL, TRUE);
+
+ // Return the theme registry unaltered if it is not Atomium based.
+ if (!in_array('atomium', $themes)) {
+ return;
+ }
+
+ // Inject the "footer" variable default in the existing "table" hook.
+ // @see https://drupal.org/node/806982
+ // @todo Make this discoverable in some way instead of a manual injection.
+ $registry['table']['variables']['footer'] = NULL;
+
+ // Process registered hooks in the theme registry.
+ _atomium_process_theme_registry($registry, $themes);
+
+ // Process registered hooks in the theme registry to add necessary theme hook
+ // suggestion phased function invocations. This must be run after separately
+ // and after all includes have been loaded.
+ _atomium_process_theme_registry_suggestions($registry, $themes);
+
+ // Post-process theme registry. This happens after all altering has occurred.
+ foreach ($registry as $hook => $info) {
+ // Ensure uniqueness.
+ if (!empty($registry[$hook]['includes'])) {
+ $registry[$hook]['includes'] = array_unique($info['includes']);
+ }
+ if (!empty($registry[$hook]['preprocess functions'])) {
+ $registry[$hook]['preprocess functions'] = array_unique($info['preprocess functions']);
+ }
+ if (!empty($registry[$hook]['process functions'])) {
+ $registry[$hook]['process functions'] = array_unique($info['process functions']);
+ }
+
+ // Ensure "theme path" is set.
+ if (!isset($registry[$hook]['theme path'])) {
+ $registry[$hook]['theme path'] = $GLOBALS['theme_path'];
+ }
+ }
+}
+
+/**
+ * Processes registered hooks in the theme registry against list of themes.
+ *
+ * Discovers and fills missing elements in the theme registry. This is similar
+ * to _theme_process_registry(), however severely modified for Atomium based
+ * themes.
+ *
+ * All additions or modifications must live in `./templates`, relative to the
+ * base theme or sub-theme's base folder. These files can be organized in any
+ * order using sub-folders as it searches recursively.
+ *
+ * Adds or modifies the following theme hook keys:
+ * - `includes`: When a variables file `*.vars.php` is found.
+ * - `includes`: When a function file `*.func.php` is found.
+ * - `function`: When a specific theme hook function override is found.
+ * - `template`: When a template file `*.tpl.php` is found in. Note, if both
+ * a function and a template are defined, a template implementation will
+ * always be used and the `function` will be unset.
+ * - `path`: When a template file `*.tpl.php` is found.
+ * - `preprocess functions`: When a specific theme hook suggestion function
+ * `hook_preprocess_HOOK__SUGGESTION` is found.
+ * - `process functions` When a specific theme hook suggestion function
+ * `hook_process_HOOK__SUGGESTION` is found.
+ *
+ * @param array $registry
+ * The theme registry array, passed by reference.
+ * @param string|array $themes
+ * The name of the theme or list of theme names to process.
+ *
+ * @see atomium_theme_registry_alter()
+ * @see _theme_process_registry()
+ * @see _theme_build_registry()
+ */
+function _atomium_process_theme_registry(array &$registry, $themes) {
+ // Convert to an array if needed.
+ if (is_string($themes)) {
+ $themes = array();
+ }
+
+ // Processor functions work in two distinct phases with the process
+ // functions always being executed after the preprocess functions.
+ $variable_process_phases = array(
+ 'preprocess functions' => 'preprocess',
+ 'process functions' => 'process',
+ );
+
+ // Iterate over each theme passed.
+ // Iterate over the [pre]process phases.
+ foreach ($variable_process_phases as $phase_key => $phase) {
+ foreach ($themes as $theme) {
+ // Get the theme's base path.
+ $path = drupal_get_path('theme', $theme);
+
+ // Find theme function overrides.
+ foreach (drupal_system_listing("/\.inc$/", $path . '/includes/' . $phase, 'name', 0) as $name => $file) {
+ // Strip off the extension.
+ if (($pos = strpos($name, '.')) !== FALSE) {
+ $name = substr($name, 0, $pos);
+ }
+
+ // Transform "-" in file names to "_" to match theme hook naming scheme.
+ $hook = strtr($name, '-', '_');
+
+ // File to be included by core's theme function when a theme hook is
+ // invoked.
+ if (isset($registry[$hook])) {
+ if (!isset($registry[$hook][$phase_key])) {
+ $registry[$hook][$phase_key] = array();
+ }
+ if (!isset($registry[$hook]['includes'])) {
+ $registry[$hook]['includes'] = array();
+ }
+
+ // Include the file now so functions can be discovered below.
+ include_once DRUPAL_ROOT . '/' . $file->uri;
+ if (!in_array($file->uri, $registry[$hook]['includes'])) {
+ $registry[$hook]['includes'][] = $file->uri;
+ }
+ }
+ }
+
+ // Process core's normal functionality.
+ _theme_process_registry($registry, $theme, $GLOBALS['theme_key'] === $theme ? 'theme' : 'base_theme', $theme, $path);
+
+ // Find necessary templates in the theme.
+ $registry = drupal_array_merge_deep($registry, drupal_find_theme_templates($registry, '.tpl.php', $path));
+
+ // Iterate over each registered hook.
+ foreach ($registry as $hook => $info) {
+ // Remove function callbacks if a template was found.
+ if (isset($info['function']) && isset($info['template'])) {
+ unset($registry[$hook]['function']);
+ }
+
+ // Correct template theme paths.
+ if (!isset($info['theme path'])) {
+ $registry[$hook]['theme path'] = $path;
+ }
+
+ // Correct the type that is implementing this override.
+ $registry[$hook]['type'] = $GLOBALS['theme_path'] === $registry[$hook]['theme path'] ? 'theme' : 'base_theme';
+
+ // Sort the phase functions.
+ // @see https://www.drupal.org/node/2098551
+ _atomium_registry_sort_phase_functions($registry[$hook][$phase_key], $hook, $phase, $themes);
+
+ // Setup a default "context" variable. This allows #context to be passed
+ // to every template and theme function.
+ // @see https://drupal.org/node/2035055
+ if (isset($info['variables']) && !isset($info['variables']['context'])) {
+ $registry[$hook]['variables']['context'] = array();
+ }
+
+ // Setup a default "icon" variable. This allows #icon to be passed
+ // to every template and theme function.
+ // @see https://drupal.org/node/2219965
+ if (isset($info['variables']) && !isset($info['variables']['icon'])) {
+ $registry[$hook]['variables']['icon'] = NULL;
+ }
+ if (isset($info['variables']) && !isset($info['variables']['icon_position'])) {
+ $registry[$hook]['variables']['icon_position'] = 'before';
+ }
+ }
+ }
+ }
+}
+
+/**
+ * Ensures the phase functions are invoked in the correct order.
+ *
+ * @param array $functions
+ * The phase functions to iterate over.
+ * @param string $hook
+ * The current hook being processed.
+ * @param string $phase
+ * The current phase being processed.
+ * @param array $themes
+ * An indexed array of current themes.
+ *
+ * @see https://www.drupal.org/node/2098551
+ */
+function _atomium_registry_sort_phase_functions(array &$functions, $hook, $phase, array $themes) {
+ // Immediately return if there is nothing to sort.
+ if (count($functions) < 2) {
+ return;
+ }
+
+ // Create an associative array of theme functions to ensure sort order.
+ $theme_functions = array_fill_keys($themes, array());
+
+ // Iterate over all the themes.
+ foreach ($themes as $theme) {
+ // Only add the function to the array of theme functions if it currently
+ // exists in the $functions array.
+ $function = $theme . '_' . $phase . '_' . $hook;
+ $key = array_search($function, $functions);
+ if ($key !== FALSE) {
+ // Save the theme function to be added later, but sorted.
+ $theme_functions[$theme][] = $function;
+
+ // Remove it from the current $functions array.
+ unset($functions[$key]);
+ }
+ }
+
+ // Iterate over all the captured theme functions and place them back into
+ // the phase functions array.
+ foreach ($theme_functions as $array) {
+ $functions = array_merge($functions, $array);
+ }
+}
+
+/**
+ * Processes registered hooks in the theme registry against list of themes.
+ *
+ * This is used to add the necessary phased functions to theme hook suggestions.
+ * Because it uses get_defined_functions(), it must be invoked after all
+ * includes have been detected and loaded. This is similar to
+ * drupal_find_theme_functions(), however severely modified for Atomium based
+ * themes.
+ *
+ * @param array $registry
+ * The theme registry array, passed by reference.
+ * @param string|array $themes
+ * The name of the theme or list of theme names to process.
+ *
+ * @see https://drupal.org/node/939462
+ * @see drupal_find_theme_functions()
+ */
+function _atomium_process_theme_registry_suggestions(array &$registry, $themes) {
+ // Convert to an array if needed.
+ if (is_string($themes)) {
+ $themes = array();
+ }
+
+ // Merge in normal core detections first.
+ $registry = drupal_array_merge_deep($registry, drupal_find_theme_functions($registry, $themes));
+
+ // Processor functions work in two distinct phases with the process
+ // functions always being executed after the preprocess functions.
+ $variable_process_phases = array(
+ 'preprocess functions' => 'preprocess',
+ 'process functions' => 'process',
+ );
+
+ $grouped_functions = drupal_group_functions_by_prefix();
+
+ // Iterate over each theme passed.
+ foreach ($themes as $theme) {
+ // Iterate over each registered hook.
+ foreach ($registry as $hook => $info) {
+ // The pattern to match.
+ $pattern = isset($info['pattern']) ? $info['pattern'] : ($hook . '__');
+
+ // Only process hooks that have not explicitly "turned off" patterns.
+ if (empty($pattern)) {
+ continue;
+ }
+
+ // Iterate over the [pre]process phases.
+ foreach ($variable_process_phases as $phase_key => $phase) {
+ // Find functions matching the specific theme and phase prefix.
+ $prefix = $theme . '_' . $phase;
+
+ // Grep only the functions which are within the prefix group.
+ list($first_prefix,) = explode('_', $prefix, 2);
+ if (isset($grouped_functions[$first_prefix]) && ($matches = preg_grep('/^' . $prefix . '_' . $pattern . '/', $grouped_functions[$first_prefix]))) {
+ foreach ($matches as $match) {
+ // Determine the current theme implementation.
+ $hook = substr($match, strlen($prefix) + 1);
+ $base_hook = $hook;
+
+ // If there's no current theme implementation, keep checking for
+ // more generic base hooks. If there's still no implementation,
+ // one must be created using the last found implementation
+ // information.
+ if (!isset($registry[$base_hook]) || isset($registry[$base_hook]['base hook'])) {
+ // Iteratively strip everything after the last '__' delimiter,
+ // until an implementation is found.
+ while ($pos = strrpos($base_hook, '__')) {
+ $base_hook = substr($base_hook, 0, $pos);
+ if (isset($registry[$base_hook])) {
+ break;
+ }
+ }
+
+ // No base hook was found, this allows the implementation to be
+ // ignored in the next steps.
+ if (!isset($registry[$base_hook])) {
+ $base_hook = FALSE;
+ }
+ }
+
+ // Process specific base hook implementations if necessary.
+ if ($base_hook) {
+ // The matched theme implementation does not exist in the
+ // registry, one must be created if base hook information was
+ // found, otherwise it will be ignored.
+ if (!isset($registry[$hook])) {
+ $registry[$base_hook] += array(
+ 'type' => 'theme',
+ 'preprocess functions' => array(),
+ 'process functions' => array(),
+ );
+ $hook_type = isset($registry[$base_hook]['function']) ? 'function' : 'template';
+ $arg_name = isset($registry[$base_hook]['variables']) ? 'variables' : 'render element';
+ $registry[$hook] = array(
+ $hook_type => $registry[$base_hook][$hook_type],
+ $arg_name => $registry[$base_hook][$arg_name],
+ 'base hook' => $base_hook,
+ 'type' => $registry[$base_hook]['type'],
+ 'preprocess functions' => array(),
+ 'process functions' => array(),
+ );
+ if (isset($registry[$base_hook]['path'])) {
+ $registry[$hook]['path'] = $registry[$base_hook]['path'];
+ }
+ if (isset($registry[$base_hook]['theme path'])) {
+ $registry[$hook]['theme path'] = $registry[$base_hook]['theme path'];
+ }
+ }
+ }
+
+ // If the hook exists, merge in the functions. Otherwise ignore it
+ // since there was no base hook found and a new implementation
+ // could not be created.
+ if (isset($registry[$hook])) {
+ $registry[$hook] = drupal_array_merge_deep($registry[$hook], array(
+ $phase_key => array($match),
+ ));
+
+ // Due to how theme() functions, if a base hook implements
+ // preprocess or process functions, then the base hook info is
+ // used to invoke the necessary phase functions instead of the
+ // suggestion hook info. To get around this, a helper function
+ // must be appended to the base hook info so it can call the
+ // theme suggestion implementation's phase function.
+ $function = '_atomium_' . $phase . '_theme_suggestion';
+ if (!in_array($function, $registry[$base_hook][$phase_key])) {
+ $registry[$base_hook][$phase_key][] = $function;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+/**
+ * Performance gain.
+ *
+ * Do not remove from 7.x. This function is not available in every core version.
+ *
+ * @see https://www.drupal.org/node/2339447
+ */
+if (!function_exists('drupal_group_functions_by_prefix')) {
+ /**
+ * Group all user functions by word before first underscore.
+ *
+ * @return array
+ * Functions grouped by the first prefix.
+ */
+ function drupal_group_functions_by_prefix() {
+ $functions = get_defined_functions();
+ $grouped_functions = array();
+
+ // Splitting user defined functions into groups by the first prefix.
+ foreach ($functions['user'] as $function) {
+ list($first_prefix,) = explode('_', $function, 2);
+ $grouped_functions[$first_prefix][] = $function;
+ }
+
+ return $grouped_functions;
+ }
+
+}
+
+/**
+ * @} End of "addtogroup registry".
+ */
diff --git a/includes/theme/field_multiple_value_form.inc b/includes/theme/field_multiple_value_form.inc
new file mode 100644
index 0000000..68fe0e1
--- /dev/null
+++ b/includes/theme/field_multiple_value_form.inc
@@ -0,0 +1,88 @@
+<?php
+
+/**
+ * @file
+ * field_multiple_value_form.inc
+ */
+
+/**
+ * Implements hook_field_multiple_value_form().
+ */
+function atomium_field_multiple_value_form($variables) {
+ $element = $variables['element'];
+ $output = '';
+
+ if ($element['#cardinality'] > 1 || $element['#cardinality'] == FIELD_CARDINALITY_UNLIMITED) {
+ $table_id = drupal_html_id($element['#field_name'] . '_values');
+ $order_class = $element['#field_name'] . '-delta-order';
+ $required = !empty($element['#required']) ? theme('form_required_marker', $variables) : '';
+
+ $header_text = t('!title: !required', array('!title' => $element['#title'], '!required' => $required));
+ $header = array(
+ array(
+ 'data' => '<label>' . $header_text . '</label>',
+ 'colspan' => 2,
+ 'class' => array('field-label'),
+ ),
+ t('Order'),
+ );
+ $rows = array();
+
+ // Sort items according to '_weight' (needed when the form comes back after
+ // preview or failed validation)
+ $items = array();
+ foreach (element_children($element) as $key) {
+ if ($key === 'add_more') {
+ $add_more_button = &$element[$key];
+ }
+ else {
+ $items[] = &$element[$key];
+ }
+ }
+ usort($items, '_field_sort_items_value_helper');
+
+ // Add the items as table rows.
+ foreach ($items as $key => $item) {
+ $item['_weight']['#attributes']['class'] = array($order_class);
+ $delta_element = drupal_render($item['_weight']);
+ $cells = array(
+ array('data' => '', 'class' => array('field-multiple-drag')),
+ drupal_render($item),
+ array('data' => $delta_element, 'class' => array('delta-order')),
+ );
+ $rows[] = array(
+ 'data' => $cells,
+ 'class' => array('draggable'),
+ );
+ }
+ /*
+ adds form-item-multiple
+ */
+ $output .= '<div class="form-item form-item-multiple">';
+ $output .= theme(
+ 'table',
+ array(
+ 'header' => $header,
+ 'rows' => $rows,
+ 'attributes' => array(
+ 'id' => $table_id,
+ 'class' => array(
+ 'field-multiple-table',
+ ),
+ ),
+ )
+ );
+ $output .= $element['#description'] ? '<div class="description">' . $element['#description'] . '</div>' : '';
+ $output .= drupal_render($add_more_button);
+ $output .= '</div>';
+
+ drupal_add_tabledrag($table_id, 'order', 'sibling', $order_class);
+ }
+ else {
+ foreach (element_children($element) as $key) {
+ $output .= drupal_render($element[$key]);
+ }
+ }
+
+ return $output;
+}
diff --git a/includes/theme/form_element.inc b/includes/theme/form_element.inc
new file mode 100644
index 0000000..d59e44c
--- /dev/null
+++ b/includes/theme/form_element.inc
@@ -0,0 +1,83 @@
+<?php
+
+/**
+ * @file
+ * form_element.inc
+ */
+
+/**
+ * Implements hook_form_element().
+ */
+function atomium_form_element($variables) {
+ $element = &$variables['element'];
+
+ // This function is invoked as theme wrapper, but the rendered form element
+ // may not necessarily have been processed by form_builder().
+ $element += array(
+ '#title_display' => 'before',
+ );
+
+ // Add element #id for #type 'item'.
+ if (isset($element['#markup']) && !empty($element['#id'])) {
+ $attributes['id'] = $element['#id'];
+ }
+ // Add element's #type and #name as class to aid with JS/CSS selectors.
+ $attributes['class'] = array();
+ // Date selects need the form-item for the show/hide end date.
+ if (isset($element['#type'])) {
+ // AND.
+ if ($element['#type'] == 'date_select' or $element['#type'] == 'date_text' or $element['#type'] == 'date_popup') {
+ $attributes['class'] = array('form-item');
+ }
+ }
+
+ // Add a class for disabled elements to facilitate cross-browser styling.
+ if (!empty($element['#attributes']['disabled'])) {
+ $attributes['class'][] = 'form-disabled';
+ }
+
+ if ((isset($element['#title']) && $element['#title'] != 'Language') && (isset($element['#required']) && $element['#required'])) {
+ $attributes['class'][] = 'form-required';
+ }
+
+ if ($attributes['class']) {
+ $output = '<div' . drupal_attributes($attributes) . '>' . "\n";
+ }
+ else {
+ $output = "\n" . '<div>' . "\n";
+ }
+
+ // If #title is not set, we don't display any label or required marker.
+ if (!isset($element['#title'])) {
+ $element['#title_display'] = 'none';
+ }
+ $prefix = isset($element['#field_prefix']) ? '<span class="field-prefix">' . $element['#field_prefix'] . '</span> ' : '';
+ $suffix = isset($element['#field_suffix']) ? ' <span class="field-suffix">' . $element['#field_suffix'] . '</span>' : '';
+
+ switch ($element['#title_display']) {
+ case 'before':
+ case 'invisible':
+ $output .= ' ' . theme('form_element_label', $variables);
+ $output .= ' ' . $prefix . $element['#children'] . $suffix . "\n";
+ break;
+
+ case 'after':
+ $output .= ' ' . $prefix . $element['#children'] . $suffix;
+ $output .= ' ' . theme('form_element_label', $variables) . "\n";
+ break;
+
+ case 'none':
+ case 'attribute':
+ // Output no label and no required marker, only the children.
+ $output .= ' ' . $prefix . $element['#children'] . $suffix . "\n";
+ break;
+ }
+
+ if (!empty($element['#description'])) {
+ $output .= "\n" . '<small>' . $element['#description'] . "</small>\n";
+ }
+
+ $output .= "</div>\n";
+
+ return $output;
+}
diff --git a/includes/theme/form_element_label.inc b/includes/theme/form_element_label.inc
new file mode 100644
index 0000000..d6dd244
--- /dev/null
+++ b/includes/theme/form_element_label.inc
@@ -0,0 +1,76 @@
+<?php
+
+/**
+ * @file
+ * form_element_label.inc
+ */
+
+/**
+ * Implements hook_form_element_label().
+ *
+ * Remove the class="option" from the label
+ * remove the * from a required element and add it in class instead
+ * if required its added as a class to the label dont add a * to the markup we
+ * can take care of business in the css
+ * Removed the for="#id" for html5 if its an item, radios, checkboxes or managed
+ * file cause they aren't needed there.
+ */
+function atomium_form_element_label($variables) {
+ $element = $variables['element'];
+
+ // This is also used in the installer, pre-database setup.
+ $t = get_t();
+
+ // If title and required marker are both empty, output no label.
+ if (empty($element['#title']) && empty($element['#required'])) {
+ return '';
+ }
+
+ $attributes = array();
+ $required = FALSE;
+ if (!empty($element['#required'])) {
+ $required = !empty($element['#required']) ? theme('form_required_marker', array('element' => $element)) : '';
+ $attributes['class'] = 'required';
+ }
+
+ $title = filter_xss_admin($element['#title']);
+
+ // Style the label as class option to display inline with the element.
+ if ($element['#title_display'] == 'after') {
+ $attributes['class'] = 'option';
+ }
+ // Show label only to screen readers to avoid disruption in visual flows.
+ elseif ($element['#title_display'] == 'invisible') {
+ $attributes['class'] = 'element-invisible';
+ }
+
+ // FOR attribute
+ // in html5 we need an element for the for id items & check
+ // TODO: clean this up.
+ if (!empty($element['#id'])) {
+ // Not every element in drupal comes with an #id
+ // that we can use for the for="#id"
+ // AND.
+ if (
+ // If its html5 & is not an item, checkboxradios or manged file.
+ $element['#type'] != "item" &&
+ $element['#type'] != "checkboxes" &&
+ $element['#type'] != "radios" &&
+ $element['#type'] != "managed_file") {
+ $attributes['for'] = $element['#id'];
+ }
+ else {
+ $attributes['for'] = $element['#id'];
+ }
+ }
+
+ // The leading whitespace helps visually separate fields from inline labels.
+ if ($required) {
+ $output = ' <label' . drupal_attributes($attributes) . '>' . $t('!title !required', array('!title' => $title, '!required' => $required)) . "</label>";
+ }
+ else {
+ $output = ' <label' . drupal_attributes($attributes) . '>' . $t('!title', array('!title' => $title)) . "</label>";
+ }
+
+ return $output;
+}
diff --git a/includes/theme/item_list.inc b/includes/theme/item_list.inc
new file mode 100644
index 0000000..16278b8
--- /dev/null
+++ b/includes/theme/item_list.inc
@@ -0,0 +1,65 @@
+<?php
+
+/**
+ * @file
+ * item_list.inc
+ */
+
+/**
+ * Implements hook_item_list().
+ */
+function atomium_item_list($variables) {
+ $items = $variables['items'];
+ $type = $variables['type'];
+ $attributes = $variables['attributes'];
+ $output = '';
+
+ if (!empty($items)) {
+ $output .= "<$type" . drupal_attributes($attributes) . '>';
+ $num_items = count($items);
+ $i = 0;
+ foreach ($items as $item) {
+ $attributes = array();
+ $children = array();
+ $data = '';
+ $i++;
+ if (is_array($item)) {
+ foreach ($item as $key => $value) {
+ if ($key == 'data') {
+ $data = $value;
+ }
+ elseif ($key == 'children') {
+ $children = $value;
+ }
+ else {
+ $attributes[$key] = $value;
+ }
+ }
+ }
+ else {
+ $data = $item;
+ }
+ if (count($children) > 0) {
+ // Render nested list.
+ $data .= atomium_item_list(
+ array(
+ 'items' => $children,
+ 'title' => NULL,
+ 'type' => $type,
+ 'attributes' => $attributes,
+ )
+ );
+ }
+ if ($i == 1) {
+ $attributes['class'][] = 'first';
+ }
+ if ($i == $num_items) {
+ $attributes['class'][] = 'last';
+ }
+ $output .= '<li' . drupal_attributes($attributes) . '>' . render($data) . "</li>\n";
+ }
+ $output .= "</$type>";
+ }
+
+ return $output;
+}
diff --git a/includes/theme/link_field.inc b/includes/theme/link_field.inc
new file mode 100644
index 0000000..a6a677b
--- /dev/null
+++ b/includes/theme/link_field.inc
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * @file
+ * link_field.inc
+ */
+
+/**
+ * Implements hook_link_field().
+ */
+function atomium_link_field($vars) {
+ drupal_add_css(drupal_get_path('module', 'link') . '/link.css');
+
+ $element = $vars['element'];
+ // Prefix single value link fields with the name of the field.
+ if (empty($element['#field']['multiple'])) {
+ if (isset($element['url']) && !isset($element['title'])) {
+ unset($element['url']['#title']);
+ }
+ }
+
+ // Placeholder.
+ $element['#attributes']['placeholder'] = $element['#title'];
+
+ $output = '';
+ // $output .= '<div class="link-field-subrow">WTF';.
+ if (!empty($element['attributes']['target'])) {
+ $output .= '<div class="link-attributes">' . drupal_render($element['attributes']['target']) . '</div>';
+ }
+ if (!empty($element['attributes']['title'])) {
+ $output .= '<div class="link-attributes">' . drupal_render($element['attributes']['title']) . '</div>';
+ }
+ // $output .= '</div>';.
+ return $output;
+}
diff --git a/logo.png b/logo.png
new file mode 100644
index 0000000..645e13c
--- /dev/null
+++ b/logo.png
Binary files differ
diff --git a/template.php b/template.php
new file mode 100644
index 0000000..df3d2c8
--- /dev/null
+++ b/template.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * @file
+ * The primary PHP file for the Drupal Atomium base theme.
+ *
+ * This file should only contain light helper functions and point to stubs in
+ * other files containing more complex functions.
+ *
+ * The stubs should point to files within the `./includes` folder named after
+ * the function itself minus the theme prefix. If the stub contains a group of
+ * functions, then please organize them so they are related in some way and name
+ * the file appropriately to at least hint at what it contains.
+ *
+ * All [pre]process functions, theme functions and template files lives inside
+ * the `./templates` folder. This is a highly automated and complex system
+ * designed to only load the necessary files when a given theme hook is invoked.
+ */
+
+/**
+ * Include common functions used through out theme.
+ */
+include_once dirname(__FILE__) . '/includes/common.inc';
+
+atomium_include('atomium', 'includes/preprocess.inc');
+atomium_include('atomium', 'includes/process.inc');
+atomium_include('atomium', 'includes/theme');
+
+/**
+ * Implements hook_theme().
+ */
+function atomium_theme(&$existing, $type, $theme, $path) {
+ atomium_include('atomium', 'includes/registry.inc');
+ return _atomium_theme($existing, $type, $theme, $path);
+}
+
+/**
+ * Clear any previously set element_info() static cache.
+ *
+ * If element_info() was invoked before the theme was fully initialized, this
+ * can cause the theme's alter hook to not be invoked.
+ *
+ * @see https://www.drupal.org/node/2351731
+ */
+drupal_static_reset('element_info');
+
+/**
+ * Declare various hook_*_alter() hooks.
+ *
+ * hook_*_alter() implementations must live (via include) inside this file so
+ * they are properly detected when drupal_alter() is invoked.
+ */
+atomium_include('atomium', 'includes/alter');
diff --git a/templates/block/block.tpl.php b/templates/block/block.tpl.php
new file mode 100644
index 0000000..7dc94af
--- /dev/null
+++ b/templates/block/block.tpl.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * @file
+ * block.tpl.php
+ */
+?>
+<section<?php print $attributes; ?>>
+ <?php print render($title_prefix); ?>
+ <?php if ($block->title): ?>
+ <h2<?php print $title_attributes; ?>><?php print $block->title ?></h2>
+ <?php endif;?>
+ <?php print render($title_suffix); ?>
+
+ <?php if ($content): ?>
+ <div<?php print $content_attributes; ?>>
+ <?php print render($content); ?>
+ </div>
+ <?php endif; ?>
+</section>
diff --git a/templates/comment/comment-wrapper.tpl.php b/templates/comment/comment-wrapper.tpl.php
new file mode 100644
index 0000000..9771d88
--- /dev/null
+++ b/templates/comment/comment-wrapper.tpl.php
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * @file
+ * comment-wrapper.tpl.php
+ */
+?>
+<aside <?php print $attributes; ?>>
+ <?php if ($node->type != 'forum'): ?>
+ <h2><?php print t('Comments'); ?></h2>
+ <?php endif; ?>
+
+ <?php print render($content['comments']); ?>
+
+ <?php if ($content['comment_form']): ?>
+ <h3><?php print t('Add new comment'); ?></h3>
+ <?php print render($content['comment_form']); ?>
+ <?php endif; ?>
+</aside>
diff --git a/templates/comment/comment.tpl.php b/templates/comment/comment.tpl.php
new file mode 100644
index 0000000..a925373
--- /dev/null
+++ b/templates/comment/comment.tpl.php
@@ -0,0 +1,47 @@
+<?php
+
+/**
+ * @file
+ * comment.tpl.php
+ */
+?>
+<article <?php print $attributes; ?>>
+ <?php print render($title_prefix); ?>
+ <?php if ($title): ?>
+ <h3<?php print $title_attributes; ?>>
+ <?php print $title; ?>
+ </h3>
+ <?php endif; ?>
+ <?php print render($title_suffix); ?>
+
+ <footer>
+ <?php if ($new): ?>
+ <mark><?php print $new; ?></mark>
+ <?php endif; ?>
+ <figure>
+ <?php print $picture; ?>
+ <figcaption><?php print $author; ?></figcaption>
+ </figure>
+
+ <span class="date"><time><?php print $created; ?></time></span>
+ <span class="changed">(<?php print t('changed'); ?>
+ <time><?php print $changed; ?></time>)</span>
+ <?php print $permalink; ?>
+ </footer>
+
+ <div class="content"<?php print $content_attributes; ?>>
+ <?php
+ // We hide the comments and links now so that we can render them later.
+ hide($content['links']);
+ print render($content);
+ ?>
+
+ <?php if ($signature): ?>
+ <aside class="user-signature">
+ <?php print $signature; ?>
+ </aside>
+ <?php endif; ?>
+ </div>
+
+ <?php print render($content['links']) ?>
+</article>
diff --git a/templates/field/field.tpl.php b/templates/field/field.tpl.php
new file mode 100644
index 0000000..ebcb8f7
--- /dev/null
+++ b/templates/field/field.tpl.php
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @file
+ * field.tpl.php
+ */
+?>
+<div<?php print $attributes; ?>>
+<?php if (!$label_hidden) : ?>
+<label<?php print $title_attributes; ?>><?php print $label ?></label>
+<?php endif; ?>
+<div<?php print $content_attributes; ?>>
+<?php foreach ($items as $delta => $item) : ?>
+<div<?php print $item_attributes[$delta]; ?>><?php print render($item); ?></div>
+<?php endforeach; ?>
+</div>
+</div>
diff --git a/templates/menu/menu-link.tpl.php b/templates/menu/menu-link.tpl.php
new file mode 100644
index 0000000..b92ba60
--- /dev/null
+++ b/templates/menu/menu-link.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * menu-link.tpl.php
+ */
+?>
+<li<?php print $attributes; ?>><?php print $output; ?><?php print $sub_menu; ?></li>
diff --git a/templates/menu/menu-tree.tpl.php b/templates/menu/menu-tree.tpl.php
new file mode 100644
index 0000000..f7b755c
--- /dev/null
+++ b/templates/menu/menu-tree.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * menu-tree.tpl.php
+ */
+?>
+<ul<?php print $attributes; ?>><?php print $variables['tree']; ?></ul>
diff --git a/templates/node/node.tpl.php b/templates/node/node.tpl.php
new file mode 100644
index 0000000..745408f
--- /dev/null
+++ b/templates/node/node.tpl.php
@@ -0,0 +1,52 @@
+<?php
+
+/**
+ * @file
+ * node.tpl.php
+ */
+?>
+<article<?php print $attributes; ?>>
+ <?php if ($title_prefix || $title_suffix || $unpublished || $preview || !$page && $title): ?>
+ <header>
+ <?php print render($title_prefix); ?>
+ <?php if (!$page && $title): ?>
+ <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
+ <?php endif; ?>
+ <?php print render($title_suffix); ?>
+
+ <?php if ($unpublished): ?>
+ <mark class="watermark"><?php print t('Unpublished'); ?></mark>
+ <?php elseif ($preview): ?>
+ <mark class="watermark"><?php print t('Preview'); ?></mark>
+ <?php endif; ?>
+ </header>
+ <?php endif; ?>
+
+ <?php
+ // We hide the comments and links now so that we can render them later.
+ hide($content['comments']);
+ hide($content['links']);
+ ?>
+ <div class="content">
+ <?php print render($content); ?>
+ </div>
+
+ <?php if ($display_submitted): ?>
+ <footer>
+ <?php print $user_picture; ?>
+ <span class="author"><?php print t('Written by'); ?> <?php print $name; ?></span>
+ <span class="date">
+ <?php print t('On the'); ?> <time datetime="<?php print format_date($created, $type = 'custom', $format = 'Y-m-d\TH:i:sP') ?>"><?php print $date; ?></time>
+ </span>
+
+ <?php if (module_exists('comment')): ?>
+ <span class="comments"><?php print $comment_count; ?> Comments</span>
+ <?php endif; ?>
+ </footer>
+ <?php endif; ?>
+
+ <?php print render($content['links']); ?>
+
+ <?php print render($content['comments']); ?>
+
+</article>
diff --git a/templates/system/admin-block.tpl.php b/templates/system/admin-block.tpl.php
new file mode 100644
index 0000000..b70ba93
--- /dev/null
+++ b/templates/system/admin-block.tpl.php
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @file
+ * admin-block.tpl.php
+ */
+?>
+<div<?php print $attributes; ?>>
+ <?php if (!empty($block['title'])): ?>
+ <h3><?php print $block['title']; ?></h3>
+ <?php endif; ?>
+
+ <?php if (!empty($block['content'])): ?>
+ <div class="body"><?php print $block['content']; ?></div>
+ <?php else: ?>
+ <div class="description"><?php print $block['description']; ?></div>
+ <?php endif; ?>
+</div>
diff --git a/templates/system/breadcrumb.tpl.php b/templates/system/breadcrumb.tpl.php
new file mode 100644
index 0000000..a516f53
--- /dev/null
+++ b/templates/system/breadcrumb.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * breadcrumb.tpl.php
+ */
+?>
+<nav class="breadcrumb" rel="navigation"><?php print render($links); ?></nav>
diff --git a/templates/system/button.tpl.php b/templates/system/button.tpl.php
new file mode 100644
index 0000000..a35ff8c
--- /dev/null
+++ b/templates/system/button.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * button.tpl.php
+ */
+?>
+<input<?php print $attributes; ?>/>
diff --git a/templates/system/checkbox.tpl.php b/templates/system/checkbox.tpl.php
new file mode 100644
index 0000000..6c9bf9d
--- /dev/null
+++ b/templates/system/checkbox.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * checkbox.tpl.php
+ */
+?>
+<input<?php print $attributes; ?>/>
diff --git a/templates/system/checkboxes.tpl.php b/templates/system/checkboxes.tpl.php
new file mode 100644
index 0000000..4c06f7e
--- /dev/null
+++ b/templates/system/checkboxes.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * checkboxes.tpl.php
+ */
+?>
+<div<?php print $attributes; ?>><?php print $element['#children']; ?></div>
diff --git a/templates/system/container.tpl.php b/templates/system/container.tpl.php
new file mode 100644
index 0000000..50719a4
--- /dev/null
+++ b/templates/system/container.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * container.tpl.php
+ */
+?>
+<div<?php print $attributes; ?>><?php print $element['#children']; ?></div>
diff --git a/templates/system/date.tpl.php b/templates/system/date.tpl.php
new file mode 100644
index 0000000..2331062
--- /dev/null
+++ b/templates/system/date.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * date.tpl.php
+ */
+?>
+'<div<?php print $attributes; ?>><?php print $date;?></div>
diff --git a/templates/system/fieldset.tpl.php b/templates/system/fieldset.tpl.php
new file mode 100644
index 0000000..0aee954
--- /dev/null
+++ b/templates/system/fieldset.tpl.php
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * @file
+ * fieldset.tpl.php
+ */
+?>
+<fieldset<?php print $attributes; ?>>
+ <?php if ($title): ?>
+ <legend><span class="fieldset-legend"><?php print $title; ?></span></legend>
+ <?php endif; ?>
+ <div class="fieldset-wrapper">
+ <?php if ($description): ?>
+ <div class="fieldset-description"><?php print $description; ?></div>
+ <?php endif; ?>
+
+ <?php print render($element['#children']); ?>
+ </div>
+</fieldset>
diff --git a/templates/system/file.tpl.php b/templates/system/file.tpl.php
new file mode 100644
index 0000000..bacf3c4
--- /dev/null
+++ b/templates/system/file.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * file.tpl.php
+ */
+?>
+<input<?php print $attributes; ?>/>
diff --git a/templates/system/form-required-marker.tpl.php b/templates/system/form-required-marker.tpl.php
new file mode 100644
index 0000000..c58de8d
--- /dev/null
+++ b/templates/system/form-required-marker.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * form-required-marker.tpl.php
+ */
+?>
+<span<?php print $attributes; ?>><?php print $title; ?></span>
diff --git a/templates/system/form.tpl.php b/templates/system/form.tpl.php
new file mode 100644
index 0000000..49c1b09
--- /dev/null
+++ b/templates/system/form.tpl.php
@@ -0,0 +1,10 @@
+<?php
+
+/**
+ * @file
+ * form.tpl.php
+ */
+?>
+<form<?php print $attributes; ?>>
+ <?php print render($element['#children']); ?>
+</form>
diff --git a/templates/system/hidden.tpl.php b/templates/system/hidden.tpl.php
new file mode 100644
index 0000000..f66a29e
--- /dev/null
+++ b/templates/system/hidden.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * hidden.tpl.php
+ */
+?>
+<input<?php print $attributes; ?>/>
diff --git a/templates/system/html-tag.tpl.php b/templates/system/html-tag.tpl.php
new file mode 100644
index 0000000..9856653
--- /dev/null
+++ b/templates/system/html-tag.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * html-tag.tpl.php
+ */
+?>
+<<?php print $element['#tag'];?><?php print $attributes; ?>><?php print $element['#value']; ?></<?php print $element['#tag']; ?>>
diff --git a/templates/system/html.tpl.php b/templates/system/html.tpl.php
new file mode 100644
index 0000000..dbfd2be
--- /dev/null
+++ b/templates/system/html.tpl.php
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * @file
+ * html.tpl.php
+ */
+?>
+<!DOCTYPE html>
+<html<?php print $html_attributes . $rdf_namespaces; ?>>
+<head>
+<?php print $head; ?>
+<title><?php print $head_title; ?></title>
+<?php print $styles; ?>
+<?php print $scripts; ?>
+</head>
+<body<?php print $attributes;?>>
+<?php print $page_top; ?>
+<?php print $page; ?>
+<?php print $page_bottom; ?>
+</body>
+</html>
diff --git a/templates/system/image-button.tpl.php b/templates/system/image-button.tpl.php
new file mode 100644
index 0000000..b6bbd2f
--- /dev/null
+++ b/templates/system/image-button.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * image-button.tpl.php
+ */
+?>
+<input<?php print $attributes; ?>/>
diff --git a/templates/system/image.tpl.php b/templates/system/image.tpl.php
new file mode 100644
index 0000000..30d1297
--- /dev/null
+++ b/templates/system/image.tpl.php
@@ -0,0 +1 @@
+<img<?php print $attributes; ?>/> \ No newline at end of file
diff --git a/templates/system/link.tpl.php b/templates/system/link.tpl.php
new file mode 100644
index 0000000..86ff649
--- /dev/null
+++ b/templates/system/link.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * link.tpl.php
+ */
+?>
+<a href="<?php print $url; ?>"<?php print $attributes; ?>><?php print $text; ?></a>
diff --git a/templates/system/more-link.tpl.php b/templates/system/more-link.tpl.php
new file mode 100644
index 0000000..f3c0f07
--- /dev/null
+++ b/templates/system/more-link.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * more-link.tpl.php
+ */
+?>
+<div<?php print $attributes; ?>><?php print $link;?></div>
diff --git a/templates/system/page.tpl.php b/templates/system/page.tpl.php
new file mode 100644
index 0000000..11d9781
--- /dev/null
+++ b/templates/system/page.tpl.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * @file
+ * page.tpl.php
+ */
+?>
+<header role="banner"><?php print render($page['header']); ?></header>
+
+<?php if ($page['sidebar_first']): ?>
+<aside role="complementary"><?php print render($page['sidebar_first']); ?></aside>
+<?php endif; ?>
+
+<main role="main">
+<?php print render($page['highlighted']); ?>
+<?php print $breadcrumb; ?>
+<?php print render($title_prefix); ?>
+<?php if ($title): ?><h1><?php print $title; ?></h1><?php
+endif; ?>
+<?php print render($title_suffix); ?>
+<?php print $messages; ?>
+<?php print render($tabs); ?>
+<?php print render($page['help']); ?>
+<?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php
+endif; ?>
+<?php print render($page['content']); ?>
+</main>
+
+<?php if ($page['sidebar_second']): ?>
+<aside role="complementary"><?php print render($page['sidebar_second']); ?></aside>
+<?php endif; ?>
+
+<footer role="contentinfo"><?php print render($page['footer']); ?></footer>
diff --git a/templates/system/password.tpl.php b/templates/system/password.tpl.php
new file mode 100644
index 0000000..0b42084
--- /dev/null
+++ b/templates/system/password.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * password.tpl.php
+ */
+?>
+<input<?php print $attributes; ?>/>
diff --git a/templates/system/radio.tpl.php b/templates/system/radio.tpl.php
new file mode 100644
index 0000000..d3fbe72
--- /dev/null
+++ b/templates/system/radio.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * radio.tpl.php
+ */
+?>
+<input<?php print $attributes; ?>/>
diff --git a/templates/system/region.tpl.php b/templates/system/region.tpl.php
new file mode 100644
index 0000000..bd5b1df
--- /dev/null
+++ b/templates/system/region.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * region.tpl.php
+ */
+?>
+<div<?php print $attributes; ?>><?php print $content; ?></div>
diff --git a/templates/system/select.tpl.php b/templates/system/select.tpl.php
new file mode 100644
index 0000000..d20c8c2
--- /dev/null
+++ b/templates/system/select.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * select.tpl.php
+ */
+?>
+<select<?php print $attributes; ?>><?php print $options;?></select>
diff --git a/templates/system/textarea.tpl.php b/templates/system/textarea.tpl.php
new file mode 100644
index 0000000..fba2fa1
--- /dev/null
+++ b/templates/system/textarea.tpl.php
@@ -0,0 +1,10 @@
+<?php
+
+/**
+ * @file
+ * textarea.tpl.php
+ */
+?>
+<div<?php print $wrapper_attributes; ?>>
+ <textarea<?php print $attributes; ?>><?php print check_plain($element['#value']); ?></textarea>
+</div>
diff --git a/templates/system/textfield.tpl.php b/templates/system/textfield.tpl.php
new file mode 100644
index 0000000..6c70213
--- /dev/null
+++ b/templates/system/textfield.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * textfield.tpl.php
+ */
+?>
+<input<?php print $attributes; ?>/><?php print $extra; ?>
diff --git a/templates/system/username.tpl.php b/templates/system/username.tpl.php
new file mode 100644
index 0000000..047fdb6
--- /dev/null
+++ b/templates/system/username.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * username.tpl.php
+ */
+?>
+<?php print $name; ?><?php print $extra; ?>
diff --git a/templates/system/vertical-tabs.tpl.php b/templates/system/vertical-tabs.tpl.php
new file mode 100644
index 0000000..a57a8eb
--- /dev/null
+++ b/templates/system/vertical-tabs.tpl.php
@@ -0,0 +1,9 @@
+<?php
+
+/**
+ * @file
+ * vertical-tabs.tpl.php
+ */
+?>
+<h2 class="element-invisible"><?php print t('Vertical Tabs'); ?></h2>
+<div class="vertical-tabs-panes"><?php print $element['#children']; ?></div>
diff --git a/templates/user/user-profile.tpl.php b/templates/user/user-profile.tpl.php
new file mode 100644
index 0000000..89e7be5
--- /dev/null
+++ b/templates/user/user-profile.tpl.php
@@ -0,0 +1,10 @@
+<?php
+
+/**
+ * @file
+ * user-profile.tpl.php
+ */
+?>
+<div <?php print $attributes; ?>>
+ <?php print render($user_profile); ?>
+</div>
diff --git a/tests/scripts/pre-push.sh b/tests/scripts/pre-push.sh
new file mode 100644
index 0000000..d1ee19a
--- /dev/null
+++ b/tests/scripts/pre-push.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+echo "Running Code Sniffer..."
+composer phpcs
+if [ $? != 0 ]
+then
+ echo "Please fix Code Sniffer errors before pushing."
+ exit 1
+fi
+exit $?
diff --git a/themes/atomium_bootstrap/assets/css/override.css b/themes/atomium_bootstrap/assets/css/override.css
new file mode 100644
index 0000000..ab91732
--- /dev/null
+++ b/themes/atomium_bootstrap/assets/css/override.css
@@ -0,0 +1,10 @@
+fieldset legend.panel-heading {
+ float: left;
+ line-height: 1em;
+ margin: 0;
+}
+
+fieldset .panel-body {
+ clear: both;
+ display: inherit;
+}
diff --git a/themes/atomium_bootstrap/atomium_bootstrap.info b/themes/atomium_bootstrap/atomium_bootstrap.info
new file mode 100644
index 0000000..f6ec99e
--- /dev/null
+++ b/themes/atomium_bootstrap/atomium_bootstrap.info
@@ -0,0 +1,31 @@
+name = Atomium Bootstrap
+description = The NextEuropa theme based on Bootstrap Framework
+screenshot = assets/images/screenshot.png
+engine = phptemplate
+core = 7.x
+php = 5.2
+base theme = atomium
+
+;-------------- F E A T U R E S -------------
+features[] = logo
+features[] = name
+features[] = slogan
+features[] = favicon
+
+;-------------- R E G I O N S -------------
+regions[header] = "Header"
+regions[highlighted] = "Highlighted"
+regions[help] = "Help"
+regions[content] = "Content"
+regions[sidebar_first] = "Sidebar first"
+regions[sidebar_second] = "Sidebar second"
+regions[footer] = "Footer"
+;-------------- P A N E L S -------------
+
+;-------------- C S S -------------
+stylesheets[all][] = assets/css/override.css
+
+;-------------- JS -------------
+
+;-------------- Default Settings for theme-settings.php -------------
+settings[toggle_logo] = 0
diff --git a/themes/atomium_bootstrap/includes/alter/form.inc b/themes/atomium_bootstrap/includes/alter/form.inc
new file mode 100644
index 0000000..4e10916
--- /dev/null
+++ b/themes/atomium_bootstrap/includes/alter/form.inc
@@ -0,0 +1,86 @@
+<?php
+
+/**
+ * @file
+ * form.inc
+ */
+
+/**
+ * Implements hook_form_ID_alter().
+ */
+function atomium_bootstrap_form_system_theme_settings_alter(array &$form, array &$form_state = array(), $form_id = NULL) {
+ // Create vertical tabs for global settings (provided by core or other
+ // contrib modules).
+ if (!isset($form['global'])) {
+ $form['global'] = array(
+ '#type' => 'vertical_tabs',
+ '#weight' => -9,
+ );
+ if (!empty($form_state['build_info']['args'][0])) {
+ $form['global']['#prefix'] = '<h2><small>' . t('Override Global Settings') . '</small></h2>';
+ }
+ }
+
+ // Iterate over all child elements and check to see if they should be
+ // moved in the global vertical tabs.
+ $global_children = element_children($form);
+ foreach ($global_children as $child) {
+ if (isset($form[$child]['#type']) && $form[$child]['#type'] === 'fieldset' && !isset($form[$child]['#group'])) {
+ $form[$child]['#group'] = 'global';
+ }
+ }
+}
+
+/**
+ * Implements hook_form_ID_alter().
+ */
+function atomium_bootstrap_form_search_form_alter(array &$form, array &$form_state = array(), $form_id = NULL) {
+ // Remove container-inline from the container classes.
+ $form['basic']['#attributes']['class'] = array();
+
+ // Hide the default button from display.
+ $form['basic']['submit']['#attributes']['class'][] = 'element-invisible';
+
+ // Implement a theme wrapper to add a submit button containing a search
+ // icon directly after the input element.
+ $form['basic']['keys']['#title'] = '';
+ $form['basic']['keys']['#attributes']['placeholder'] = t('Search');
+}
+
+/**
+ * Implements hook_form_ID_alter().
+ */
+function atomium_bootstrap_form_search_block_form_alter(array &$form, array &$form_state = array(), $form_id = NULL) {
+ $form['#attributes']['class'][] = 'form-search';
+
+ $form['search_block_form']['#title'] = '';
+ $form['search_block_form']['#attributes']['placeholder'] = t('Search');
+
+ // Hide the default button from display and implement a theme wrapper
+ // to add a submit button containing a search icon directly after the
+ // input element.
+ $form['actions']['submit']['#attributes']['class'][] = 'element-invisible';
+ // Apply a clearfix so the results don't overflow onto the form.
+ $form['#attributes']['class'][] = 'content-search';
+}
+
+/**
+ * Implements hook_form_ID_alter().
+ */
+function atomium_bootstrap_form_image_style_form_alter(array &$form, array &$form_state = array(), $form_id = NULL) {
+ $form['effects']['new']['new']['#input_group_button'] = TRUE;
+}
+
+/**
+ * Implements hook_form_ID_alter().
+ */
+function atomium_bootstrap_form_path_admin_filter_form_alter(array &$form, array &$form_state = array(), $form_id = NULL) {
+ $form['basic']['filter']['#input_group_button'] = TRUE;
+}
+
+/**
+ * Implements hook_form_alter().
+ */
+function atomium_bootstrap_form_alter(array &$form, array &$form_state = array(), $form_id = NULL) {
+
+}
diff --git a/themes/atomium_bootstrap/includes/alter/menu.inc b/themes/atomium_bootstrap/includes/alter/menu.inc
new file mode 100644
index 0000000..2305409
--- /dev/null
+++ b/themes/atomium_bootstrap/includes/alter/menu.inc
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * @file
+ * menu.inc
+ */
+
+/**
+ * Implements hook_menu_local_tasks_alter().
+ */
+function atomium_bootstrap_menu_local_tasks_alter(&$data, &$router_item, $root_path) {
+ if (!empty($data['actions']['output'])) {
+ foreach ($data['actions']['output'] as $item) {
+ $data['tabs'][0]['output'][] = $item;
+ }
+ $data['actions']['output'] = array();
+ }
+
+}
diff --git a/themes/atomium_bootstrap/includes/preprocess/breadcrumb.inc b/themes/atomium_bootstrap/includes/preprocess/breadcrumb.inc
new file mode 100644
index 0000000..53bc393
--- /dev/null
+++ b/themes/atomium_bootstrap/includes/preprocess/breadcrumb.inc
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @file
+ * breadcrumb.inc
+ */
+
+/**
+ * Implements hook_preprocess_breadcrumb().
+ */
+function atomium_bootstrap_preprocess_breadcrumb(&$variables) {
+ $variables['attributes_array'] = array(
+ 'class' => array(
+ 'breadcrumb',
+ ),
+ );
+}
diff --git a/themes/atomium_bootstrap/includes/preprocess/fieldset.inc b/themes/atomium_bootstrap/includes/preprocess/fieldset.inc
new file mode 100644
index 0000000..5ab817a
--- /dev/null
+++ b/themes/atomium_bootstrap/includes/preprocess/fieldset.inc
@@ -0,0 +1,71 @@
+<?php
+
+/**
+ * @file
+ * fieldset.inc
+ */
+
+/**
+ * Implements hook_preprocess_fieldset().
+ */
+function atomium_bootstrap_preprocess_fieldset(&$variables) {
+ $element = &$variables['element'];
+
+ // Set the element's attributes.
+ element_set_attributes($element, array('id'));
+
+ // Retrieve the attributes for the element.
+ $attributes = &_atomium_get_attributes($element);
+
+ // Add panel and panel-default classes.
+ $attributes['class'][] = 'panel';
+ $attributes['class'][] = 'panel-default';
+
+ // states.js requires form-wrapper on fieldset to work properly.
+ $attributes['class'][] = 'form-wrapper';
+
+ // Handle collapsible panels.
+ $variables['collapsible'] = FALSE;
+ if (isset($element['#collapsible'])) {
+ $variables['collapsible'] = $element['#collapsible'];
+ }
+ $variables['collapsed'] = FALSE;
+ if (isset($element['#collapsed'])) {
+ $variables['collapsed'] = $element['#collapsed'];
+ }
+ // Force grouped fieldsets to not be collapsible (for vertical tabs).
+ if (!empty($element['#group'])) {
+ $variables['collapsible'] = FALSE;
+ $variables['collapsed'] = FALSE;
+ }
+ // Collapsible elements need an ID, so generate one if necessary.
+ if (!isset($attributes['id']) && $variables['collapsible']) {
+ $attributes['id'] = drupal_html_id('bootstrap-panel');
+ }
+
+ // Set the target if the element has an id.
+ $variables['target'] = NULL;
+ if (isset($attributes['id'])) {
+ $variables['target'] = '#' . $attributes['id'] . ' > .collapse';
+ }
+
+ // Build the panel content.
+ $variables['content'] = $element['#children'];
+ if (isset($element['#value'])) {
+ $variables['content'] .= $element['#value'];
+ }
+
+ // Iterate over optional variables.
+ $keys = array(
+ 'description',
+ 'prefix',
+ 'suffix',
+ 'title',
+ );
+ foreach ($keys as $key) {
+ $variables[$key] = !empty($element["#$key"]) ? $element["#$key"] : FALSE;
+ }
+
+ // Add the attributes.
+ $variables['attributes_array'] = $attributes;
+}
diff --git a/themes/atomium_bootstrap/includes/preprocess/form_required_marker.inc b/themes/atomium_bootstrap/includes/preprocess/form_required_marker.inc
new file mode 100644
index 0000000..952122b
--- /dev/null
+++ b/themes/atomium_bootstrap/includes/preprocess/form_required_marker.inc
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * @file
+ * form_required_marker.inc
+ */
+
+/**
+ * Implements hook_preprocess_form_required_marker().
+ */
+function atomium_bootstrap_preprocess_form_required_marker(&$variables) {
+ $t = get_t();
+
+ $attributes = array(
+ 'class' => array(
+ 'badge',
+ ),
+ 'title' => $t('Required'),
+ );
+
+ $variables['attributes_array'] = $attributes;
+ $variables['title'] = $t('Required');
+}
diff --git a/themes/atomium_bootstrap/includes/preprocess/html.inc b/themes/atomium_bootstrap/includes/preprocess/html.inc
new file mode 100644
index 0000000..fa8257b
--- /dev/null
+++ b/themes/atomium_bootstrap/includes/preprocess/html.inc
@@ -0,0 +1,14 @@
+<?php
+
+/**
+ * @file
+ * html.inc
+ */
+
+/**
+ * Implements hook_preprocess_html().
+ */
+function atomium_bootstrap_preprocess_html(&$variables, $hook) {
+ drupal_add_js('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js', 'external');
+ drupal_add_css('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', 'external');
+}
diff --git a/themes/atomium_bootstrap/includes/preprocess/links.inc b/themes/atomium_bootstrap/includes/preprocess/links.inc
new file mode 100644
index 0000000..fadeaab
--- /dev/null
+++ b/themes/atomium_bootstrap/includes/preprocess/links.inc
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @file
+ * links.inc
+ */
+
+/**
+ * Implements hook_preprocess_links().
+ */
+function atomium_bootstrap_preprocess_links(&$variables) {
+ if (!in_array($variables['theme_hook_original'], array('links__node', 'links__comment'))) {
+ return;
+ }
+
+ $variables['attributes']['class'] = array('nav', 'nav-pills', 'nav-justified');
+}
diff --git a/themes/atomium_bootstrap/includes/preprocess/region.inc b/themes/atomium_bootstrap/includes/preprocess/region.inc
new file mode 100644
index 0000000..07df795
--- /dev/null
+++ b/themes/atomium_bootstrap/includes/preprocess/region.inc
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * @file
+ * region.inc
+ */
+
+/**
+ * Implements hook_preprocess_region().
+ */
+function atomium_bootstrap_preprocess_region(&$variables) {
+ if (strpos($variables['region'], 'sidebar') !== FALSE) {
+ $variables['classes_array'][] = 'well';
+ }
+}
diff --git a/themes/atomium_bootstrap/includes/preprocess/table.inc b/themes/atomium_bootstrap/includes/preprocess/table.inc
new file mode 100644
index 0000000..970ff42
--- /dev/null
+++ b/themes/atomium_bootstrap/includes/preprocess/table.inc
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @file
+ * table.inc
+ */
+
+/**
+ * Implements hook_preprocess_table().
+ */
+function atomium_bootstrap_preprocess_table(&$variables) {
+ $variables['attributes']['class'] = array(
+ 'table',
+ 'table-hover',
+ 'table-striped',
+ );
+}
diff --git a/themes/atomium_bootstrap/includes/process/fieldset.inc b/themes/atomium_bootstrap/includes/process/fieldset.inc
new file mode 100644
index 0000000..6ee841a
--- /dev/null
+++ b/themes/atomium_bootstrap/includes/process/fieldset.inc
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @file
+ * fieldset.inc
+ */
+
+/**
+ * Implements hook_process_fieldset().
+ */
+function atomium_bootstrap_process_fieldset(&$variables) {
+ if (!empty($variables['title'])) {
+ $variables['title'] = filter_xss_admin(render($variables['title']));
+ }
+ if (!empty($variables['description'])) {
+ $variables['description'] = filter_xss_admin(render($variables['description']));
+ }
+}
diff --git a/themes/atomium_bootstrap/includes/theme/menu.inc b/themes/atomium_bootstrap/includes/theme/menu.inc
new file mode 100644
index 0000000..331710d
--- /dev/null
+++ b/themes/atomium_bootstrap/includes/theme/menu.inc
@@ -0,0 +1,65 @@
+<?php
+
+/**
+ * @file
+ * menu.inc
+ */
+
+/**
+ * Implements hook_menu_local_tasks().
+ */
+function atomium_bootstrap_menu_local_tasks(&$variables) {
+ $output = '';
+
+ if (!empty($variables['primary'])) {
+ $variables['primary']['#prefix'] = '<ul class="nav nav-tabs">';
+ $variables['primary']['#suffix'] = '</ul>';
+ $output .= drupal_render($variables['primary']);
+ }
+ if (!empty($variables['secondary'])) {
+ $variables['secondary']['#prefix'] = '<div class="button-group expanded">';
+ $variables['secondary']['#suffix'] = '</div>';
+ $output .= drupal_render($variables['secondary']);
+ }
+
+ return $output;
+}
+
+/**
+ * Implements hook_menu_local_task().
+ */
+function atomium_bootstrap_menu_local_task(&$variables) {
+ $link = $variables['element']['#link'];
+ $link_text = $link['title'];
+
+ $attributes = array();
+ $attributes['class'] = (!empty($variables['element']['#active']) ? 'active' : NULL);
+ $attributes['role'] = 'presentation';
+
+ if (!empty($variables['element']['#active'])) {
+ // Add text to indicate active tab for non-visual users.
+ $active = '<span class="element-invisible">' . t('(active tab)') . '</span>';
+
+ // If the link does not contain HTML already, check_plain() it now.
+ // After we set 'html'=TRUE the link will not be sanitized by l().
+ if (empty($link['localized_options']['html'])) {
+ $link['title'] = check_plain($link['title']);
+ }
+ $link['localized_options']['html'] = TRUE;
+ $link_text = t('!local-task-title!active', array('!local-task-title' => $link['title'], '!active' => $active));
+ }
+
+ // Add section tab styling.
+ $link['localized_options']['attributes']['class'] = array(
+ 'small',
+ 'button',
+ 'secondary',
+ );
+
+ $output = '';
+ $output .= '<li ' . drupal_attributes(array_filter($attributes)) . '>';
+ $output .= l($link_text, $link['href'], $link['localized_options']);
+ $output .= '</li>';
+
+ return $output;
+}
diff --git a/themes/atomium_bootstrap/includes/theme/status_messages.inc b/themes/atomium_bootstrap/includes/theme/status_messages.inc
new file mode 100644
index 0000000..ac3bf56
--- /dev/null
+++ b/themes/atomium_bootstrap/includes/theme/status_messages.inc
@@ -0,0 +1,53 @@
+<?php
+
+/**
+ * @file
+ * status_messages.inc
+ */
+
+/**
+ * Implements hook_status_messages().
+ */
+function atomium_bootstrap_status_messages($variables) {
+ $display = $variables['display'];
+
+ $status_mapping = array(
+ 'status' => 'success',
+ 'error' => 'danger',
+ 'warning' => 'warning',
+ );
+
+ $output = array();
+ foreach (drupal_get_messages($display) as $type => $messages) {
+ $container = array(
+ '#type' => 'html_tag',
+ '#tag' => 'div',
+ '#attributes' => array(
+ 'class' => array(
+ 'alert',
+ 'alert-block',
+ 'messages',
+ $type,
+ isset($status_mapping[$type]) ? 'alert-' . $status_mapping[$type] : 'alert-info',
+ ),
+ ),
+ );
+
+ if (count($messages) > 1) {
+ $item_list = array(
+ '#theme' => 'item_list',
+ '#items' => $messages,
+ '#type' => 'ul',
+ '#attributes' => array('class' => array('list-unstyled')),
+ );
+ $container['#value'] = render($item_list);
+ }
+ else {
+ $container['#value'] = $messages[0];
+ }
+
+ $output[] = $container;
+ }
+
+ return render($output);
+}
diff --git a/themes/atomium_bootstrap/template.php b/themes/atomium_bootstrap/template.php
new file mode 100644
index 0000000..91cf2dc
--- /dev/null
+++ b/themes/atomium_bootstrap/template.php
@@ -0,0 +1,9 @@
+<?php
+
+/**
+ * @file
+ * template.php
+ */
+
+atomium_include('atomium_bootstrap', 'includes/theme');
+atomium_include('atomium_bootstrap', 'includes/alter');
diff --git a/themes/atomium_bootstrap/templates/system/breadcrumb.tpl.php b/themes/atomium_bootstrap/templates/system/breadcrumb.tpl.php
new file mode 100644
index 0000000..36895ad
--- /dev/null
+++ b/themes/atomium_bootstrap/templates/system/breadcrumb.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * breadcrumb.tpl.php
+ */
+?>
+<?php print render($links); ?>
diff --git a/themes/atomium_bootstrap/templates/system/fieldset.tpl.php b/themes/atomium_bootstrap/templates/system/fieldset.tpl.php
new file mode 100644
index 0000000..69cc895
--- /dev/null
+++ b/themes/atomium_bootstrap/templates/system/fieldset.tpl.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * @file
+ * fieldset.tpl.php
+ */
+?>
+<fieldset <?php print $attributes; ?>>
+ <?php if ($title): ?>
+ <?php if ($collapsible): ?>
+ <legend class="panel-heading">
+ <a href="#" class="panel-title fieldset-legend" data-toggle="collapse" data-target="<?php print $target; ?>"><?php print $title; ?></a>
+ </legend>
+ <?php else: ?>
+ <legend class="panel-heading">
+ <span class="panel-title fieldset-legend"><?php print $title; ?></span>
+ </legend>
+ <?php endif; ?>
+ <?php endif; ?>
+ <?php if ($collapsible): ?>
+ <div class="panel-collapse collapse fade<?php print (!$collapsed ? ' in' : ''); ?>">
+ <?php endif; ?>
+ <div class="panel-body">
+ <?php if ($description): ?><div class="help-block"><?php print $description; ?></div><?php
+ endif; ?>
+ <?php print $content; ?>
+ </div>
+ <?php if ($collapsible): ?>
+ </div>
+ <?php endif; ?>
+</fieldset>
diff --git a/themes/atomium_bootstrap/templates/system/page.tpl.php b/themes/atomium_bootstrap/templates/system/page.tpl.php
new file mode 100644
index 0000000..3dcae69
--- /dev/null
+++ b/themes/atomium_bootstrap/templates/system/page.tpl.php
@@ -0,0 +1,61 @@
+<?php
+
+/**
+ * @file
+ * page.tpl.php
+ */
+if (!empty($page['header'])): ?>
+ <div class="container">
+ <div class="row">
+ <div class="col-md-12">
+ <header role="banner"><?php print render($page['header']); ?></header>
+ </div>
+ </div>
+ </div>
+<?php endif; ?>
+
+<?php if (!empty($breadcrumb)): ?>
+<div class="container">
+ <div class="row">
+ <div class="col-md-12">
+ <?php print $breadcrumb; ?>
+ </div>
+ </div>
+</div>
+<?php endif; ?>
+
+<div class="container">
+ <div class="row">
+ <?php if ($page['sidebar_first']): ?>
+ <aside class="col-md-3" role="complementary"><?php print render($page['sidebar_first']); ?></aside>
+ <?php endif; ?>
+
+ <main class="col-md-9" role="main">
+ <?php print render($page['highlighted']); ?>
+ <?php print render($title_prefix); ?>
+ <?php if ($title): ?><h1><?php print $title; ?></h1><?php
+ endif; ?>
+ <?php print render($title_suffix); ?>
+ <?php print $messages; ?>
+ <?php print render($tabs); ?>
+ <?php print render($page['help']); ?>
+ <?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php
+ endif; ?>
+ <?php print render($page['content']); ?>
+ </main>
+
+ <?php if ($page['sidebar_second']): ?>
+ <aside class="col-md-3 columns" role="complementary"><?php print render($page['sidebar_second']); ?></aside>
+ <?php endif; ?>
+ </div>
+</div>
+
+<?php if (!empty($page['footer'])): ?>
+ <div class="container">
+ <div class="row">
+ <div class="col-md-12">
+ <footer role="contentinfo"><?php print render($page['footer']); ?></footer>
+ </div>
+ </div>
+ </div>
+<?php endif; ?>
diff --git a/themes/atomium_foundation/atomium_foundation.info b/themes/atomium_foundation/atomium_foundation.info
new file mode 100644
index 0000000..5d8a56b
--- /dev/null
+++ b/themes/atomium_foundation/atomium_foundation.info
@@ -0,0 +1,30 @@
+name = Atomium Foundation
+description = The NextEuropa theme based on Zurb Foundation Framework
+screenshot = assets/images/screenshot.png
+engine = phptemplate
+core = 7.x
+php = 5.2
+base theme = atomium
+
+;-------------- F E A T U R E S -------------
+features[] = logo
+features[] = name
+features[] = slogan
+features[] = favicon
+
+;-------------- R E G I O N S -------------
+regions[header] = "Header"
+regions[highlighted] = "Highlighted"
+regions[help] = "Help"
+regions[content] = "Content"
+regions[sidebar_first] = "Sidebar first"
+regions[sidebar_second] = "Sidebar second"
+regions[footer] = "Footer"
+;-------------- P A N E L S -------------
+
+;-------------- C S S -------------
+
+;-------------- JS -------------
+
+;-------------- Default Settings for theme-settings.php -------------
+settings[toggle_logo] = 0
diff --git a/themes/atomium_foundation/includes/alter/form.inc b/themes/atomium_foundation/includes/alter/form.inc
new file mode 100644
index 0000000..ff741d1
--- /dev/null
+++ b/themes/atomium_foundation/includes/alter/form.inc
@@ -0,0 +1,63 @@
+<?php
+
+/**
+ * @file
+ * form.inc
+ */
+
+/**
+ * Implements hook_form_alter().
+ */
+function atomium_foundation_form_alter(&$form, &$form_state, $form_id) {
+ if (!empty($form['actions'])) {
+ $form['actions']['#attributes']['class'] = array('button-group', 'expanded');
+ if (!empty($form['actions']['submit'])) {
+ $form['actions']['submit']['#attributes']['class'][] = 'primary';
+ $form['actions']['submit']['#attributes']['class'][] = 'button';
+ $form['actions']['submit']['#attributes']['class'][] = 'radius';
+ }
+ if (!empty($form['actions']['preview'])) {
+ $form['actions']['preview']['#attributes']['class'][] = 'secondary';
+ $form['actions']['preview']['#attributes']['class'][] = 'button';
+ $form['actions']['preview']['#attributes']['class'][] = 'radius';
+ }
+ if (!empty($form['actions']['delete_translation'])) {
+ $form['actions']['delete_translation']['#attributes']['class'][] = 'warning';
+ $form['actions']['delete_translation']['#attributes']['class'][] = 'button';
+ $form['actions']['delete_translation']['#attributes']['class'][] = 'radius';
+ }
+ if (!empty($form['actions']['delete'])) {
+ $form['actions']['delete']['#attributes']['class'][] = 'warning';
+ $form['actions']['delete']['#attributes']['class'][] = 'button';
+ $form['actions']['delete']['#attributes']['class'][] = 'radius';
+ }
+ if (!empty($form['actions']['save'])) {
+ $form['actions']['save']['#attributes']['class'][] = 'primary';
+ $form['actions']['save']['#attributes']['class'][] = 'button';
+ $form['actions']['save']['#attributes']['class'][] = 'radius';
+ }
+ if (!empty($form['actions']['cancel'])) {
+ $form['actions']['cancel']['#attributes']['class'][] = 'warning';
+ $form['actions']['cancel']['#attributes']['class'][] = 'button';
+ $form['actions']['cancel']['#attributes']['class'][] = 'radius';
+ }
+ }
+
+ // Search Block Fixes.
+ if (isset($form['#form_id']) && ($form['#form_id'] == 'search_block_form')) {
+ $form['search_block_form']['#attributes']['class'][] = 'small-8';
+ $form['search_block_form']['#attributes']['class'][] = 'columns';
+
+ $form['actions']['submit']['#attributes']['class'][] = 'postfix';
+ $form['actions']['submit']['#attributes']['class'][] = 'small-4';
+ $form['actions']['submit']['#attributes']['class'][] = 'columns';
+ }
+
+ if (!empty($form['basic']['submit'])) {
+ $form['basic']['submit']['#attributes']['class'][] = 'primary';
+ $form['basic']['submit']['#attributes']['class'][] = 'button';
+ $form['basic']['submit']['#attributes']['class'][] = 'radius';
+ $form['basic']['keys']['#title'] = '';
+ $form['basic']['keys']['#attributes']['placeholder'] = t('Search');
+ }
+}
diff --git a/themes/atomium_foundation/includes/preprocess/block.inc b/themes/atomium_foundation/includes/preprocess/block.inc
new file mode 100644
index 0000000..e005348
--- /dev/null
+++ b/themes/atomium_foundation/includes/preprocess/block.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * block.inc
+ */
+
+/**
+ * Implements hook_preprocess_block().
+ */
+function atomium_foundation_preprocess_block(&$variables) {
+ $variables['classes_array'] = array('clearfix');
+}
diff --git a/themes/atomium_foundation/includes/preprocess/breadcrumb.inc b/themes/atomium_foundation/includes/preprocess/breadcrumb.inc
new file mode 100644
index 0000000..bcaf778
--- /dev/null
+++ b/themes/atomium_foundation/includes/preprocess/breadcrumb.inc
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @file
+ * breadcrumb.inc
+ */
+
+/**
+ * Implements hook_preprocess_breadcrumb().
+ */
+function atomium_foundation_preprocess_breadcrumb(&$variables) {
+ $variables['attributes_array'] = array(
+ 'class' => array(
+ 'breadcrumbs',
+ ),
+ );
+}
diff --git a/themes/atomium_foundation/includes/preprocess/fieldset.inc b/themes/atomium_foundation/includes/preprocess/fieldset.inc
new file mode 100644
index 0000000..2db3afa
--- /dev/null
+++ b/themes/atomium_foundation/includes/preprocess/fieldset.inc
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * @file
+ * fieldset.inc
+ */
+
+/**
+ * Implements hook_preprocess_fieldset().
+ */
+function atomium_foundation_preprocess_fieldset(&$variables) {
+ $variables['attributes_array']['class'] = array_merge(
+ $variables['element']['#attributes']['class'],
+ array('fieldset')
+ );
+}
diff --git a/themes/atomium_foundation/includes/preprocess/form_required_marker.inc b/themes/atomium_foundation/includes/preprocess/form_required_marker.inc
new file mode 100644
index 0000000..d79439f
--- /dev/null
+++ b/themes/atomium_foundation/includes/preprocess/form_required_marker.inc
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * @file
+ * form_required_marker.inc
+ */
+
+/**
+ * Implements hook_preprocess_form_required_marker().
+ */
+function atomium_foundation_preprocess_form_required_marker(&$variables) {
+ $t = get_t();
+
+ $attributes = array(
+ 'class' => array(
+ 'label',
+ 'alert',
+ ),
+ 'title' => $t('Required'),
+ );
+
+ $variables['attributes_array'] = $attributes;
+ $variables['title'] = $t('Required');
+}
diff --git a/themes/atomium_foundation/includes/preprocess/html.inc b/themes/atomium_foundation/includes/preprocess/html.inc
new file mode 100644
index 0000000..9dfba71
--- /dev/null
+++ b/themes/atomium_foundation/includes/preprocess/html.inc
@@ -0,0 +1,14 @@
+<?php
+
+/**
+ * @file
+ * html.inc
+ */
+
+/**
+ * Implements hook_preprocess_html().
+ */
+function atomium_foundation_preprocess_html(&$variables, $hook) {
+ drupal_add_js('https://cdnjs.cloudflare.com/ajax/libs/foundation/6.3.0/js/foundation.min.js', 'external');
+ drupal_add_css('https://cdnjs.cloudflare.com/ajax/libs/foundation/6.3.0/css/foundation.min.css', 'external');
+}
diff --git a/themes/atomium_foundation/includes/preprocess/links.inc b/themes/atomium_foundation/includes/preprocess/links.inc
new file mode 100644
index 0000000..fb601c8
--- /dev/null
+++ b/themes/atomium_foundation/includes/preprocess/links.inc
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * @file
+ * links.inc
+ */
+
+/**
+ * Implements hook_preprocess_links().
+ */
+function atomium_foundation_preprocess_links(&$variables) {
+ if (!in_array($variables['theme_hook_original'], array('links__node', 'links__comment'))) {
+ return;
+ }
+
+ $variables['attributes']['class'] = array('button-group', 'expanded');
+ foreach ($variables['links'] as &$link) {
+ $link['attributes']['class'][] = 'button';
+ }
+}
diff --git a/themes/atomium_foundation/includes/preprocess/menu_tree.inc b/themes/atomium_foundation/includes/preprocess/menu_tree.inc
new file mode 100644
index 0000000..fa9a1f2
--- /dev/null
+++ b/themes/atomium_foundation/includes/preprocess/menu_tree.inc
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @file
+ * menu_tree.inc
+ */
+
+/**
+ * Implements hook_preprocess_menu_tree().
+ */
+function atomium_foundation_preprocess_menu_tree(&$variables) {
+ $variables['attributes_array']['class'][] = 'vertical';
+}
diff --git a/themes/atomium_foundation/includes/theme/links.inc b/themes/atomium_foundation/includes/theme/links.inc
new file mode 100644
index 0000000..960528d
--- /dev/null
+++ b/themes/atomium_foundation/includes/theme/links.inc
@@ -0,0 +1,166 @@
+<?php
+
+/**
+ * @file
+ * links.inc
+ */
+
+/**
+ * Implements theme_links__node().
+ *
+ * To theme only links in nodes.
+ */
+function atomium_foundation_links__node($variables) {
+ $links = $variables['links'];
+ $attributes = $variables['attributes'];
+ $heading = $variables['heading'];
+ global $language_url;
+ $output = '';
+
+ if (count($links) > 0) {
+ // Treat the heading first if it is present to prepend it to the
+ // list of links.
+ if (!empty($heading)) {
+ if (is_string($heading)) {
+ // Prepare the array that will be used when the passed heading
+ // is a string.
+ $heading = array(
+ 'text' => $heading,
+ // Set the default level of the heading.
+ 'level' => 'h2',
+ );
+ }
+ $output .= '<' . $heading['level'];
+ if (!empty($heading['class'])) {
+ $output .= drupal_attributes(array('class' => $heading['class']));
+ }
+ $output .= '>' . check_plain($heading['text']) . '</' . $heading['level'] . '>';
+ }
+
+ $output .= '<div' . drupal_attributes($attributes) . '>';
+
+ $num_links = count($links);
+ $i = 1;
+
+ foreach ($links as $key => $link) {
+ $class = array($key);
+
+ // Add first, last and active classes to the list of links to help out
+ // themers.
+ if ($i == 1) {
+ $class[] = 'first';
+ }
+ if ($i == $num_links) {
+ $class[] = 'last';
+ }
+ if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '<front>' && drupal_is_front_page()))
+ && (empty($link['language']) || $link['language']->language == $language_url->language)) {
+ $class[] = 'active';
+ }
+
+ $link['attributes']['class'] = array_merge($link['attributes']['class'], $class);
+
+ if (isset($link['href'])) {
+ // Pass in $link as $options, they share the same keys.
+ $output .= l($link['title'], $link['href'], $link);
+ }
+ elseif (!empty($link['title'])) {
+ // Some links are actually not links, but we wrap these in <span> for
+ // adding title and class attributes.
+ if (empty($link['html'])) {
+ $link['title'] = check_plain($link['title']);
+ }
+ $span_attributes = '';
+ if (isset($link['attributes'])) {
+ $span_attributes = drupal_attributes($link['attributes']);
+ }
+ $output .= '<span' . $span_attributes . '>' . $link['title'] . '</span>';
+ }
+
+ $i++;
+ }
+
+ $output .= '</div>';
+ }
+
+ return $output;
+}
+
+/**
+ * Implements hook_links__comment().
+ */
+function atomium_foundation_links__comment($variables) {
+ $links = $variables['links'];
+ $attributes = $variables['attributes'];
+ $heading = $variables['heading'];
+ global $language_url;
+ $output = '';
+
+ if (count($links) > 0) {
+ // Treat the heading first if it is present to prepend it to the
+ // list of links.
+ if (!empty($heading)) {
+ if (is_string($heading)) {
+ // Prepare the array that will be used when the passed heading
+ // is a string.
+ $heading = array(
+ 'text' => $heading,
+ // Set the default level of the heading.
+ 'level' => 'h2',
+ );
+ }
+ $output .= '<' . $heading['level'];
+ if (!empty($heading['class'])) {
+ $output .= drupal_attributes(array('class' => $heading['class']));
+ }
+ $output .= '>' . check_plain($heading['text']) . '</' . $heading['level'] . '>';
+ }
+
+ $output .= '<div ' . drupal_attributes($attributes) . '>';
+
+ $num_links = count($links);
+ $i = 1;
+
+ foreach ($links as $key => $link) {
+ $class = array($key);
+
+ // Add first, last and active classes to the list of links to help out
+ // themers.
+ if ($i == 1) {
+ $class[] = 'first';
+ }
+ if ($i == $num_links) {
+ $class[] = 'last';
+ }
+ if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '<front>' && drupal_is_front_page()))
+ && (empty($link['language']) || $link['language']->language == $language_url->language)) {
+ $class[] = 'active';
+ }
+
+ $link['attributes']['class'] = array_merge($link['attributes']['class'], $class);
+
+ if (isset($link['href'])) {
+ // Pass in $link as $options, they share the same keys.
+ $output .= l($link['title'], $link['href'], $link);
+ }
+ elseif (!empty($link['title'])) {
+ // Some links are actually not links, but we wrap these in <span> for
+ // adding title and class attributes.
+ if (empty($link['html'])) {
+ $link['title'] = check_plain($link['title']);
+ }
+ $span_attributes = '';
+ if (isset($link['attributes'])) {
+ $span_attributes = drupal_attributes($link['attributes']);
+ }
+ $output .= '<span' . $span_attributes . '>' . $link['title'] . '</span>';
+ }
+
+ $i++;
+ }
+
+ $output .= '</div>';
+ }
+
+ return $output;
+}
diff --git a/themes/atomium_foundation/includes/theme/menu.inc b/themes/atomium_foundation/includes/theme/menu.inc
new file mode 100644
index 0000000..2c024fa
--- /dev/null
+++ b/themes/atomium_foundation/includes/theme/menu.inc
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * @file
+ * menu.inc
+ */
+
+/**
+ * Implements theme_menu_local_tasks().
+ */
+function atomium_foundation_menu_local_tasks(&$variables) {
+ $output = '';
+
+ if (!empty($variables['primary'])) {
+ $variables['primary']['#prefix'] = '<div class="button-group expanded">';
+ $variables['primary']['#suffix'] = '</div>';
+ $output .= drupal_render($variables['primary']);
+ }
+ if (!empty($variables['secondary'])) {
+ $variables['secondary']['#prefix'] = '<div class="button-group expanded">';
+ $variables['secondary']['#suffix'] = '</div>';
+ $output .= drupal_render($variables['secondary']);
+ }
+
+ return $output;
+}
+
+/**
+ * Implements theme_menu_local_task().
+ */
+function atomium_foundation_menu_local_task(&$variables) {
+ $link = $variables['element']['#link'];
+ $link_text = $link['title'];
+
+ if (!empty($variables['element']['#active'])) {
+ // Add text to indicate active tab for non-visual users.
+ $active = '<span class="element-invisible">' . t('(active tab)') . '</span>';
+
+ // If the link does not contain HTML already, check_plain() it now.
+ // After we set 'html'=TRUE the link will not be sanitized by l().
+ if (empty($link['localized_options']['html'])) {
+ $link['title'] = check_plain($link['title']);
+ }
+ $link['localized_options']['html'] = TRUE;
+ $link_text = t('!local-task-title!active', array('!local-task-title' => $link['title'], '!active' => $active));
+ }
+
+ // Add section tab styling.
+ $link['localized_options']['attributes']['class'] = array(
+ 'small',
+ 'button',
+ 'secondary',
+ );
+
+ $output = '';
+ $output .= l($link_text, $link['href'], $link['localized_options']);
+ return $output;
+}
diff --git a/themes/atomium_foundation/includes/theme/status_messages.inc b/themes/atomium_foundation/includes/theme/status_messages.inc
new file mode 100644
index 0000000..92bb4e0
--- /dev/null
+++ b/themes/atomium_foundation/includes/theme/status_messages.inc
@@ -0,0 +1,62 @@
+<?php
+
+/**
+ * @file
+ * status_messages.inc
+ */
+
+/**
+ * Implements hook_status_messages().
+ */
+function atomium_foundation_status_messages($variables) {
+ $display = $variables['display'];
+
+ $status_mapping = array(
+ 'error' => 'alert',
+ 'status' => 'success',
+ 'warning' => 'warning',
+ );
+
+ $output = array(
+ '#type' => 'container',
+ '#attributes' => array(
+ 'class' => array(),
+ ),
+ 'messages' => array(),
+ );
+
+ $close = '<button class="close-button" aria-label="Dismiss alert" type="button" data-close><span aria-hidden="true">&times;</span></button>';
+
+ foreach (drupal_get_messages($display) as $type => $messages) {
+ $container = array(
+ '#type' => 'container',
+ array(
+ '#type' => 'html_tag',
+ '#tag' => 'div',
+ '#attributes' => array(
+ 'data-closable' => '',
+ 'class' => array(
+ 'callout',
+ isset($status_mapping[$type]) ? $status_mapping[$type] : 'info',
+ ),
+ ),
+ ),
+ );
+
+ $item_list = array(
+ '#theme' => 'item_list',
+ '#items' => $messages,
+ '#type' => 'ul',
+ '#attributes' => array('class' => array('no-bullet')),
+ );
+ $container[0]['#value'] = render($item_list) . $close;
+
+ $output['messages'][] = $container;
+ }
+
+ if (empty($output['messages'])) {
+ $output = array();
+ }
+
+ return render($output);
+}
diff --git a/themes/atomium_foundation/template.php b/themes/atomium_foundation/template.php
new file mode 100644
index 0000000..1f80570
--- /dev/null
+++ b/themes/atomium_foundation/template.php
@@ -0,0 +1,11 @@
+<?php
+
+/**
+ * @file
+ * template.php
+ */
+
+atomium_include('atomium_foundation', 'includes/preprocess');
+atomium_include('atomium_foundation', 'includes/process');
+atomium_include('atomium_foundation', 'includes/theme');
+atomium_include('atomium_foundation', 'includes/alter');
diff --git a/themes/atomium_foundation/templates/system/breadcrumb.tpl.php b/themes/atomium_foundation/templates/system/breadcrumb.tpl.php
new file mode 100644
index 0000000..c8d4293
--- /dev/null
+++ b/themes/atomium_foundation/templates/system/breadcrumb.tpl.php
@@ -0,0 +1,8 @@
+<?php
+
+/**
+ * @file
+ * breadcrumb.tpl.php
+ */
+?>
+<nav class="breadcrumb" rel="navigation" role="navigation" aria-label="You are here:"><?php print render($links); ?></nav>
diff --git a/themes/atomium_foundation/templates/system/page.tpl.php b/themes/atomium_foundation/templates/system/page.tpl.php
new file mode 100644
index 0000000..eee00ae
--- /dev/null
+++ b/themes/atomium_foundation/templates/system/page.tpl.php
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @file
+ * page.tpl.php
+ */
+?>
+<div class="expanded row">
+ <header role="banner"><?php print render($page['header']); ?></header>
+</div>
+
+<?php if (!empty($breadcrumb)): ?>
+ <div class="row">
+ <div class="larger-12 columns">
+ <?php print $breadcrumb; ?>
+ </div>
+ </div>
+<?php endif; ?>
+
+<div class="row">
+ <?php if ($page['sidebar_first']): ?>
+ <aside class="large-3 columns" role="complementary"><?php print render($page['sidebar_first']); ?></aside>
+ <?php endif; ?>
+
+ <main class="large-9 columns" role="main">
+ <?php print render($page['highlighted']); ?>
+ <?php print render($title_prefix); ?>
+ <?php if ($title): ?><h1><?php print $title; ?></h1><?php
+ endif; ?>
+ <?php print render($title_suffix); ?>
+ <?php print $messages; ?>
+ <?php print render($tabs); ?>
+ <?php print render($page['help']); ?>
+ <?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php
+ endif; ?>
+ <?php print render($page['content']); ?>
+ </main>
+
+ <?php if ($page['sidebar_second']): ?>
+ <aside class="large-3 columns" role="complementary"><?php print render($page['sidebar_second']); ?></aside>
+ <?php endif; ?>
+</div>
+
+<div class="expanded row">
+ <footer role="contentinfo"><?php print render($page['footer']); ?></footer>
+</div>
diff --git a/themes/avogadro/assets/images/logo.png b/themes/avogadro/assets/images/logo.png
new file mode 100644
index 0000000..645e13c
--- /dev/null
+++ b/themes/avogadro/assets/images/logo.png
Binary files differ
diff --git a/themes/avogadro/assets/images/logo.svg b/themes/avogadro/assets/images/logo.svg
new file mode 100644
index 0000000..0f62c4a
--- /dev/null
+++ b/themes/avogadro/assets/images/logo.svg
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="131"
+ height="120">
+ <path
+ d="M 103.96875,29.43727 C 106.08143,18.684552 104.89996,10.523975 99.90625,7.2810201 98.241679,6.2000351 96.24602,5.7270015 94,5.8122701 81.871494,6.2727205 62.301679,22.972344 46.3125,47.59352 27.362362,76.774173 20.627996,106.01897 31.28125,112.93727 c 5.056946,3.28402 13.115147,0.95604 22.21875,-5.53125"
+ style="fill:none;stroke:#66595c;stroke-width:5;stroke-linecap:round" />
+ <path
+ d="m 113.6875,77.15602 c 8.99437,-3.489189 14.52504,-8.265012 14.8125,-13.75 0.6648,-12.685141 -26.94124,-24.429026 -61.6875,-26.25 -3.257461,-0.170716 -6.460588,-0.260544 -9.59375,-0.25 -30.287234,0.101927 -53.9287749,8.410341 -54.53125,19.90625 -0.286892,5.474225 4.7004836,10.782383 13.25,15.1875"
+ style="fill:none;stroke:#66595c;stroke-width:5;stroke-linecap:round" />
+ <path
+ d="M 57,10.53102 C 50.846125,5.4251295 45.074552,2.683237 40.4375,3.0310201 39.20289,3.123617 38.061068,3.4278792 37,3.9685201 25.681946,9.7353567 29.297632,39.560643 45.09375,70.56227 c 15.796118,31.00163 37.775696,51.45434 49.09375,45.6875 10.8844,-5.54588 7.94666,-33.337754 -6.34375,-63.03125"
+ style="fill:none;stroke:#66595c;stroke-width:5;stroke-linecap:round" />
+ <path
+ d="m 73.5,61 a 7.5,7.5 0 0 1 -15,0 7.5,7.5 0 1 1 15,0 z"
+ style="fill:#66595c" />
+</svg> \ No newline at end of file
diff --git a/themes/avogadro/assets/images/logo_original.png b/themes/avogadro/assets/images/logo_original.png
new file mode 100644
index 0000000..f8e22f3
--- /dev/null
+++ b/themes/avogadro/assets/images/logo_original.png
Binary files differ
diff --git a/themes/avogadro/assets/images/screenshot.png b/themes/avogadro/assets/images/screenshot.png
new file mode 100644
index 0000000..b31af47
--- /dev/null
+++ b/themes/avogadro/assets/images/screenshot.png
Binary files differ
diff --git a/themes/avogadro/avogadro.info b/themes/avogadro/avogadro.info
new file mode 100644
index 0000000..402ac83
--- /dev/null
+++ b/themes/avogadro/avogadro.info
@@ -0,0 +1,31 @@
+name = Avogadro
+description = The NextEuropa theme
+screenshot = assets/images/screenshot.png
+engine = phptemplate
+core = 7.x
+php = 5.2
+base theme = atomium
+
+;-------------- F E A T U R E S -------------
+features[] = logo
+features[] = name
+features[] = slogan
+features[] = favicon
+
+;-------------- R E G I O N S -------------
+regions[header] = "Header"
+regions[highlighted] = "Highlighted"
+regions[help] = "Help"
+regions[content] = "Content"
+regions[sidebar_first] = "Sidebar first"
+regions[sidebar_second] = "Sidebar second"
+regions[footer] = "Footer"
+;-------------- P A N E L S -------------
+
+;-------------- C S S -------------
+stylesheets[all][] = assets/css/avogadro.css
+
+;-------------- JS -------------
+
+;-------------- Default Settings for theme-settings.php -------------
+settings[toggle_logo] = 0
diff --git a/themes/avogadro/logo.png b/themes/avogadro/logo.png
new file mode 100644
index 0000000..645e13c
--- /dev/null
+++ b/themes/avogadro/logo.png
Binary files differ
diff --git a/themes/avogadro/template.php b/themes/avogadro/template.php
new file mode 100644
index 0000000..9faf409
--- /dev/null
+++ b/themes/avogadro/template.php
@@ -0,0 +1,6 @@
+<?php
+
+/**
+ * @file
+ * template.php
+ */