summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Strawn2012-10-11 14:00:03 (GMT)
committer Jake Strawn2012-10-11 14:00:03 (GMT)
commitec9af782a89883b11f082c8e20072896e6524820 (patch)
treeecc1f48e9db137f9c446defae5fc3050da3ab4e1
parent2a392284ec5b161836892431c552ced2d2514a8d (diff)
updated theme settings for isotope settings and functionality.
-rw-r--r--template.php60
-rw-r--r--theme-settings.php182
2 files changed, 192 insertions, 50 deletions
diff --git a/template.php b/template.php
index ef11799..eb4770d 100644
--- a/template.php
+++ b/template.php
@@ -152,15 +152,29 @@ drupal_set_message('This is a normal call to <em>drupal_set_message</em>.', 'sta
drupal_add_js(drupal_get_path('theme', 'omega_nodemaker') . '/js/jquery.isotope.js');
drupal_add_js(drupal_get_path('theme', 'omega_nodemaker') . '/js/nodemaker-isotope.js');
drupal_add_js(array('nodemaker' => array('isotope' => true)), 'setting');
- //add the home_page_columns
- $columns['home_columns_gutter'] = theme_get_setting('home_columns_gutter', $theme->theme);
- $columns['home_columns_mobile'] = theme_get_setting('home_columns_mobile', $theme->theme);
- $columns['home_columns_narrow'] = theme_get_setting('home_columns_narrow', $theme->theme);
- $columns['home_columns_normal'] = theme_get_setting('home_columns_normal', $theme->theme);
- $columns['home_columns_wide'] = theme_get_setting('home_columns_wide', $theme->theme);
- drupal_add_js(array('nodemaker' => array('home_columns' => $columns)), 'setting');
+
+ if (theme_get_setting('isotope_home_toggle', $theme->theme)) {
+ $columns = array();
+ //add the home_page_columns
+ $columns['home_columns_gutter'] = theme_get_setting('home_columns_gutter', $theme->theme);
+ $columns['home_columns_narrow'] = theme_get_setting('home_columns_narrow', $theme->theme);
+ $columns['home_columns_normal'] = theme_get_setting('home_columns_normal', $theme->theme);
+ $columns['home_columns_wide'] = theme_get_setting('home_columns_wide', $theme->theme);
+ drupal_add_js(array('nodemaker' => array('isotope_home_toggle' => theme_get_setting('isotope_home_toggle', $theme->theme), 'home_columns' => $columns)), 'setting');
+ }
+
+ if (theme_get_setting('isotope_taxonomy_toggle', $theme->theme)) {
+ $columns = array();
+
+ $columns['taxonomy_columns_gutter'] = theme_get_setting('taxonomy_columns_gutter', $theme->theme);
+ $columns['taxonomy_columns_narrow'] = theme_get_setting('taxonomy_columns_narrow', $theme->theme);
+ $columns['taxonomy_columns_normal'] = theme_get_setting('taxonomy_columns_normal', $theme->theme);
+ $columns['taxonomy_columns_wide'] = theme_get_setting('taxonomy_columns_wide', $theme->theme);
+ drupal_add_js(array('nodemaker' => array('isotope_taxonomy_toggle' => theme_get_setting('isotope_taxonomy_toggle', $theme->theme),'taxonomy_columns' => $columns)), 'setting');
+ }
}
+ //dsm($vars);
// add the ios touch icons
$icon = array(
@@ -275,6 +289,16 @@ function omega_nodemaker_preprocess_page(&$vars) {
$vars['userbar'] = $vars['page']['header']['user'];
unset($vars['page']['header']['user']);
}
+
+ if (arg(0) == 'node' && (arg(2) == 'edit' || arg(2) == 'revisions')) {
+ //dsm('node edit page bitches!');
+
+ unset($vars['page']['content']['content']['sidebar_first']);
+ unset($vars['page']['sidebar_first']);
+ //unset($vars['page']['content']['content']['sidebar_second']);
+
+ //dsm($vars);
+ }
//krumo($vars);
}
@@ -321,7 +345,9 @@ function omega_nodemaker_preprocess_node(&$vars) {
// operate on specific node types
switch ($type) {
-
+ case 'forum':
+ //dsm($vars);
+ break;
case 'nm_blog':
//krumo($vars['content']);
break;
@@ -395,7 +421,12 @@ function omega_nodemaker_preprocess_block(&$vars) {
function omega_nodemaker_page_alter(&$page) {
// on taxonomy term pags make a wrapper around the nodes that is logical. #wtf
-
+ //dsm($page);
+ // page rendered for /node default drupal river of news
+ if (arg(0) == 'node' && !arg(1)) {
+ $page['content']['content']['content']['system_main']['content']['nodes']['#prefix'] = '<div class="clearfix node-river">';
+ $page['content']['content']['content']['system_main']['content']['nodes']['#suffix'] = '</div>';
+ }
if (arg(0) == 'taxonomy' & arg(1) == 'term') {
// for some stupid @#@#$@#$ reason, the list of nodes on a taxonomy page is in a
@@ -418,7 +449,7 @@ function omega_nodemaker_page_alter(&$page) {
* Implements hook_form_alter
*/
function omega_nodemaker_form_alter(&$form, &$form_state, $form_id) {
- //krumo($form_id);
+ //dsm($form_id);
switch ($form_id) {
case 'user_login_block':
$form['name']['#weight'] = -10;
@@ -441,4 +472,11 @@ function omega_nodemaker_form_alter(&$form, &$form_state, $form_id) {
//$form['advanced']['#access'] = FALSE;
break;
}
-} \ No newline at end of file
+
+ $node_form = substr($form_id, -10, 10);
+ //dsm($node_form);
+ if ($node_form == '_node_form') {
+ //dsm($form);
+ }
+}
+
diff --git a/theme-settings.php b/theme-settings.php
index 29ab5f6..c73591e 100644
--- a/theme-settings.php
+++ b/theme-settings.php
@@ -27,38 +27,46 @@ function omega_nodemaker_form_system_theme_settings_alter(&$form, &$form_state)
$theme = alpha_get_theme();
//krumo($theme);
- $form['alpha_settings']['jquery'] = array(
+ $form['alpha_settings']['isotope'] = array(
'#type' => 'fieldset',
- '#weight' => -49,
- '#title' => t('jQuery Settings'),
- );
- $form['alpha_settings']['jquery']['jquery172'] = array(
- '#type' => 'checkbox',
- '#title' => t('Enable jQuery 1.7.2'),
- '#description' => t('Usage in scripts: $jq172'),
- '#default_value' => theme_get_setting('jquery172', $theme->theme),
+ '#weight' => -75,
+ '#title' => t('jQuery Isotope Settings'),
);
- $form['alpha_settings']['jquery']['jquery180'] = array(
- '#type' => 'checkbox',
- '#title' => t('Enable jQuery 1.8.0'),
- '#description' => t('Usage in scripts: $jq180'),
- '#default_value' => theme_get_setting('jquery180', $theme->theme),
- );
- $form['alpha_settings']['jquery']['isotope'] = array(
+
+ $form['alpha_settings']['isotope']['isotope'] = array(
'#type' => 'fieldset',
'#title' => t('Isotope Settings'),
);
- $form['alpha_settings']['jquery']['isotope']['isotope_toggle'] = array(
+
+ $form['alpha_settings']['isotope']['isotope']['isotope_toggle'] = array(
'#type' => 'checkbox',
- '#title' => t('Activate Isotope plugin for node displays'),
+ '#title' => t('Activate Isotope plugin'),
'#description' => t('This will enable the Masonry plugin (<a href="http://masonry.desandro.com/">masonry.desandro.com/</a>) to various node views.'),
'#default_value' => theme_get_setting('isotope_toggle', $theme->theme),
);
- $form['alpha_settings']['jquery']['isotope']['home'] = array(
+
+ $form['alpha_settings']['isotope']['isotope']['isotope_home_toggle'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Activate Isotope for landing pages provided by the NodeMaker Landing Pages app.'),
+ '#default_value' => theme_get_setting('isotope_home_toggle', $theme->theme),
+ '#states' => array(
+ 'visible' => array(
+ 'input[name="isotope_toggle"]' => array('checked' => TRUE),
+ ),
+ ),
+ );
+
+ $form['alpha_settings']['isotope']['isotope']['home'] = array(
'#type' => 'fieldset',
- '#title' => t('Home Page Columns'),
+ '#title' => t('Landing Page Columns'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
+ '#states' => array(
+ 'visible' => array(
+ 'input[name="isotope_toggle"]' => array('checked' => TRUE),
+ 'input[name="isotope_home_toggle"]' => array('checked' => TRUE),
+ ),
+ ),
);
//make gutter options
@@ -66,17 +74,18 @@ function omega_nodemaker_form_system_theme_settings_alter(&$form, &$form_state)
$gutter_options[$i] = $i;
}
- $form['alpha_settings']['jquery']['isotope']['home']['home_columns_gutter'] = array(
+ $form['alpha_settings']['isotope']['isotope']['home']['home_columns_gutter'] = array(
'#type' => 'select',
'#title' => t('Pixel spacing between columns'),
'#description' => t('On the home page, how pixels do you want in between each column?'),
'#options' => $gutter_options,
'#default_value' => theme_get_setting('home_columns_gutter', $theme->theme),
);
- $form['alpha_settings']['jquery']['isotope']['home']['home_columns_mobile'] = array(
+
+ $form['alpha_settings']['isotope']['isotope']['home']['home_columns_narrow'] = array(
'#type' => 'select',
- '#title' => t('Number of Home Page Columns - Mobile'),
- '#description' => t('On the home page, how many columns do want for the main content when viewing a "mobile" display?'),
+ '#title' => t('Number of Home Page Columns - Narrow'),
+ '#description' => t('On the home page, how many columns do want for the main content when viewing a "narrow" display?'),
'#options' => array(
'1' => '1',
'2' => '2',
@@ -89,12 +98,13 @@ function omega_nodemaker_form_system_theme_settings_alter(&$form, &$form_state)
'9' => '9',
'10' => '10',
),
- '#default_value' => theme_get_setting('home_columns_mobile', $theme->theme),
- );
- $form['alpha_settings']['jquery']['isotope']['home']['home_columns_narrow'] = array(
+ '#default_value' => theme_get_setting('home_columns_narrow', $theme->theme),
+ );
+
+ $form['alpha_settings']['isotope']['isotope']['home']['home_columns_normal'] = array(
'#type' => 'select',
- '#title' => t('Number of Home Page Columns - Narrow'),
- '#description' => t('On the home page, how many columns do want for the main content when viewing a "narrow" display?'),
+ '#title' => t('Number of Home Page Columns - Normal'),
+ '#description' => t('On the home page, how many columns do want for the main content when viewing a "normal" display?'),
'#options' => array(
'1' => '1',
'2' => '2',
@@ -107,12 +117,13 @@ function omega_nodemaker_form_system_theme_settings_alter(&$form, &$form_state)
'9' => '9',
'10' => '10',
),
- '#default_value' => theme_get_setting('home_columns_narrow', $theme->theme),
- );
- $form['alpha_settings']['jquery']['isotope']['home']['home_columns_normal'] = array(
+ '#default_value' => theme_get_setting('home_columns_normal', $theme->theme),
+ );
+
+ $form['alpha_settings']['isotope']['isotope']['home']['home_columns_wide'] = array(
'#type' => 'select',
- '#title' => t('Number of Home Page Columns - Normal'),
- '#description' => t('On the home page, how many columns do want for the main content when viewing a "normal" display?'),
+ '#title' => t('Number of Home Page Columns - Wide'),
+ '#description' => t('On the home page, how many columns do want for the main content when viewing a "wide" display?'),
'#options' => array(
'1' => '1',
'2' => '2',
@@ -125,12 +136,45 @@ function omega_nodemaker_form_system_theme_settings_alter(&$form, &$form_state)
'9' => '9',
'10' => '10',
),
- '#default_value' => theme_get_setting('home_columns_normal', $theme->theme),
+ '#default_value' => theme_get_setting('home_columns_wide', $theme->theme),
);
- $form['alpha_settings']['jquery']['isotope']['home']['home_columns_wide'] = array(
+
+ $form['alpha_settings']['isotope']['isotope']['isotope_taxonomy_toggle'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Activate Isotope for taxonomy pages'),
+ '#default_value' => theme_get_setting('isotope_taxonomy_toggle', $theme->theme),
+ '#states' => array(
+ 'visible' => array(
+ 'input[name="isotope_toggle"]' => array('checked' => TRUE),
+ ),
+ ),
+ );
+
+ $form['alpha_settings']['isotope']['isotope']['taxonomy'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Taxonomy Page Columns'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ '#states' => array(
+ 'visible' => array(
+ 'input[name="isotope_toggle"]' => array('checked' => TRUE),
+ 'input[name="isotope_taxonomy_toggle"]' => array('checked' => TRUE),
+ ),
+ ),
+ );
+
+ $form['alpha_settings']['isotope']['isotope']['taxonomy']['taxonomy_columns_gutter'] = array(
'#type' => 'select',
- '#title' => t('Number of Home Page Columns - Wide'),
- '#description' => t('On the home page, how many columns do want for the main content when viewing a "wide" display?'),
+ '#title' => t('Pixel spacing between columns'),
+ '#description' => t('On the various taxonomy pages, how pixels do you want in between each column?'),
+ '#options' => $gutter_options,
+ '#default_value' => theme_get_setting('taxonomy_columns_gutter', $theme->theme),
+ );
+
+ $form['alpha_settings']['isotope']['isotope']['taxonomy']['taxonomy_columns_narrow'] = array(
+ '#type' => 'select',
+ '#title' => t('Number of Taxonomy Page Columns - Narrow'),
+ '#description' => t('On the various taxonomy pages, how many columns do want for the main content when viewing a "narrow" display?'),
'#options' => array(
'1' => '1',
'2' => '2',
@@ -143,8 +187,68 @@ function omega_nodemaker_form_system_theme_settings_alter(&$form, &$form_state)
'9' => '9',
'10' => '10',
),
- '#default_value' => theme_get_setting('home_columns_wide', $theme->theme),
+ '#default_value' => theme_get_setting('taxonomy_columns_narrow', $theme->theme),
+ );
+
+ $form['alpha_settings']['isotope']['isotope']['taxonomy']['taxonomy_columns_normal'] = array(
+ '#type' => 'select',
+ '#title' => t('Number of Taxonomy Page Columns - Normal'),
+ '#description' => t('On the various taxonomy pages, how many columns do want for the main content when viewing a "normal" display?'),
+ '#options' => array(
+ '1' => '1',
+ '2' => '2',
+ '3' => '3',
+ '4' => '4',
+ '5' => '5',
+ '6' => '6',
+ '7' => '7',
+ '8' => '8',
+ '9' => '9',
+ '10' => '10',
+ ),
+ '#default_value' => theme_get_setting('taxonomy_columns_normal', $theme->theme),
+ );
+
+ $form['alpha_settings']['isotope']['isotope']['taxonomy']['taxonomy_columns_wide'] = array(
+ '#type' => 'select',
+ '#title' => t('Number of Taxonomy Page Columns - Wide'),
+ '#description' => t('On the various taxonomy pages, how many columns do want for the main content when viewing a "wide" display?'),
+ '#options' => array(
+ '1' => '1',
+ '2' => '2',
+ '3' => '3',
+ '4' => '4',
+ '5' => '5',
+ '6' => '6',
+ '7' => '7',
+ '8' => '8',
+ '9' => '9',
+ '10' => '10',
+ ),
+ '#default_value' => theme_get_setting('taxonomy_columns_wide', $theme->theme),
+ );
+
+
+ $form['alpha_settings']['jquery'] = array(
+ '#type' => 'fieldset',
+ '#weight' => -49,
+ '#title' => t('jQuery Settings'),
);
+ $form['alpha_settings']['jquery']['jquery172'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Enable jQuery 1.7.2'),
+ '#description' => t('Usage in scripts: $jq172'),
+ '#default_value' => theme_get_setting('jquery172', $theme->theme),
+ );
+ $form['alpha_settings']['jquery']['jquery180'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Enable jQuery 1.8.0'),
+ '#description' => t('Usage in scripts: $jq180'),
+ '#default_value' => theme_get_setting('jquery180', $theme->theme),
+ );
+
+
+
$form['alpha_settings']['mobile_settings'] = array(
'#type' => 'fieldset',