Skip to content

Commit

Permalink
v.1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
findlabnet committed Mar 26, 2019
1 parent 157ea0b commit 3565ad3
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 71 deletions.
2 changes: 1 addition & 1 deletion minicss.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = minicss
description = The basic theme built with <b>mini.css ver.3.0.0</b> - minimal, responsive, style-agnostic CSS framework.
backdrop = 1.x
screenshot = screenshot.png
version = 1.0.2
version = 1.0.3

; Default settings for theme features.
settings[top_right] = main-menu
Expand Down
8 changes: 5 additions & 3 deletions template.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ function minicss_breadcrumb($variables) {
* Implements hook_preprocess_header().
*/
function minicss_preprocess_header(&$variables) {
$selected = theme_get_setting('top_right', 'minicss');
$theme_default = config_get('system.core', 'theme_default');
$selected = theme_get_setting('top_right', $theme_default);
$menu = menu_tree($selected);
$tr_menu = backdrop_render($menu);
$variables['tr_menu'] = $tr_menu;
Expand All @@ -118,6 +119,7 @@ function minicss_form_alter(&$form, &$form_state, $form_id) {
* Implements hook_preprocess_layout().
*/
function minicss_preprocess_layout(&$variables) {
$variables['sticky_header'] = theme_get_setting('sticky_header', 'minicss') ? ' sticky' : '';
$variables['sticky_footer'] = theme_get_setting('sticky_footer', 'minicss') ? ' sticky' : '';
$theme_default = config_get('system.core', 'theme_default');
$variables['sticky_header'] = theme_get_setting('sticky_header', $theme_default) ? ' sticky' : '';
$variables['sticky_footer'] = theme_get_setting('sticky_footer', $theme_default) ? ' sticky' : '';
}
134 changes: 67 additions & 67 deletions theme-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,74 +4,74 @@
* Theme settings file
*/

function minicss_form_system_theme_settings_alter(&$form, $form_state) {
$form['minicss'] = array(
'#type' => 'vertical_tabs',
'#weight' => -10,
);

$form['sticky'] = array(
'#type' => 'fieldset',
'#title' => t('Header and Footer'),
'#group' => 'minicss',
);
$form['sticky']['sticky_header'] = array(
'#prefix' => '<p>' . t("You can make your site's header and / or footer sticky by selecting options below") . '</p>',
'#type' => 'checkbox',
'#title' => t('Sticky header'),
'#default_value' => theme_get_setting('sticky_header', 'minicss'),
);
$form['sticky']['sticky_footer'] = array(
'#type' => 'checkbox',
'#title' => t('Sticky footer'),
'#default_value' => theme_get_setting('sticky_footer', 'minicss'),
);
$theme_default = config_get('system.core', 'theme_default');

$form['main_menu'] = array(
'#type' => 'fieldset',
'#title' => t('Main navigation menu'),
'#group' => 'minicss',
);
$menus = menu_get_menus($all = TRUE);
$form['main_menu']['top_right'] = array(
'#type' => 'select',
'#title' => t('Main navigation menu'),
'#default_value' => theme_get_setting('top_right', 'minicss'),
'#description' => t('Select which one of menus should be used as main navigation (opens by top right "hamburger" icon)'),
'#options' => $menus,
);

$form['flavors'] = array(
'#type' => 'fieldset',
'#title' => t('Color schemes'),
'#group' => 'minicss',
);
$form['flavors']['flavor'] = array(
'#type' => 'select',
'#default_value' => theme_get_setting('flavor', 'minicss'),
'#options' => array(
'default' => t('Default'),
'dark' => t('Dark'),
'nord' => t('Nord'),
),
'#suffix' => '<p><b>mini.css </b>' . t('comes with a few prebuild flavors out of the box, so you can get started without having to finetune every little aspect of your CSS framework') . '</p>',
);

$form['debug'] = array(
'#type' => 'fieldset',
'#title' => t('Theme debug'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#group' => 'minicss',
);
$form['debug']['enable'] = array(
'#type' => 'checkbox',
'#title' => t('Enable debug output'),
'#default_value' => config_get('system.core', 'theme_debug'),
'#element_validate' => array('_theme_debug_settings'),
'#description' => t('Output theme debugging information to source code of page - do not forget to disable this on a live site!'),
);
}
$form['minicss'] = array(
'#type' => 'vertical_tabs',
'#weight' => -10,
);

$form['sticky'] = array(
'#type' => 'fieldset',
'#title' => t('Header and Footer'),
'#group' => 'minicss',
);
$form['sticky']['sticky_header'] = array(
'#prefix' => '<p>' . t("You can make your site's header and / or footer sticky by selecting options below") . '</p>',
'#type' => 'checkbox',
'#title' => t('Sticky header'),
'#default_value' => theme_get_setting('sticky_header', $theme_default),
);
$form['sticky']['sticky_footer'] = array(
'#type' => 'checkbox',
'#title' => t('Sticky footer'),
'#default_value' => theme_get_setting('sticky_footer', $theme_default),
);

$form['main_menu'] = array(
'#type' => 'fieldset',
'#title' => t('Main navigation menu'),
'#group' => 'minicss',
);
$menus = menu_get_menus($all = TRUE);
$form['main_menu']['top_right'] = array(
'#type' => 'select',
'#title' => t('Main navigation menu'),
'#default_value' => theme_get_setting('top_right', $theme_default),
'#description' => t('Select which one of menus should be used as main navigation (opens by top right "hamburger" icon)'),
'#options' => $menus,
);

$form['flavors'] = array(
'#type' => 'fieldset',
'#title' => t('Color schemes'),
'#group' => 'minicss',
);
$form['flavors']['flavor'] = array(
'#type' => 'select',
'#default_value' => theme_get_setting('flavor', $theme_default),
'#options' => array(
'default' => t('Default'),
'dark' => t('Dark'),
'nord' => t('Nord'),
),
'#suffix' => '<p><b>mini.css </b>' . t('comes with a few prebuild flavors out of the box, so you can get started without having to finetune every little aspect of your CSS framework') . '</p>',
);

$form['debug'] = array(
'#type' => 'fieldset',
'#title' => t('Theme debug'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#group' => 'minicss',
);
$form['debug']['enable'] = array(
'#type' => 'checkbox',
'#title' => t('Enable debug output'),
'#default_value' => config_get('system.core', 'theme_debug'),
'#element_validate' => array('_theme_debug_settings'),
'#description' => t('Output theme debugging information to source code of page - do not forget to disable this on a live site!'),
);

function _theme_debug_settings($element) {
config_set('system.core', 'theme_debug', $element['#value']);
Expand Down

0 comments on commit 3565ad3

Please sign in to comment.