summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--delta.module58
1 files changed, 29 insertions, 29 deletions
diff --git a/delta.module b/delta.module
index 902d9e7..17f8901 100644
--- a/delta.module
+++ b/delta.module
@@ -215,7 +215,7 @@ function delta_theme($existing, $type, $theme, $path) {
'arguments' => array(
'form' => NULL,
),
- 'file' => 'theme-functions.inc',
+ //'file' => 'theme-functions.inc',
'template' => 'delta-override-form',
),
);
@@ -376,14 +376,6 @@ function template_preprocess_delta_theme_overrides_form(&$vars) {
$vars['default_add_override_link'] = l(t('add new override'), 'admin/build/delta/override/add');
drupal_add_js('misc/tableheader.js');
drupal_add_tabledrag('delta-overrides', 'order', 'sibling', 'delta-weight');
- if (function_exists('popups_add_popups')) {
- popups_add_popups(array('.add-template' => array(
- 'width' => '800px',
- )));
- }
- else {
- drupal_set_message('You must install the <a href="http://drupal.org/project/popups">Popups API</a> in order for this interface to work correctly, and to allow for new templates to be added', 'error');
- }
}
/**
@@ -965,7 +957,10 @@ function delta_create_theme_settings_template_form($form_state, $theme) {
'#collapsed' => FALSE,
'#tree' => TRUE,
);
-
+ $form['delta_template']['theme'] = array(
+ '#type' => 'hidden',
+ '#value' => $theme,
+ );
$form['delta_template']['name'] = array(
'#type' => 'textfield',
'#title' => t('Theme Settings Template Title'),
@@ -973,9 +968,13 @@ function delta_create_theme_settings_template_form($form_state, $theme) {
'#default_value' => $form_state['delta_template']['name'],
'#description' => t('Use a descriptive title to name your theme settings template.'),
);
-
-
-
+ $form['delta_template_overrides'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Theme Settings to Override.'),
+ '#collapsible' => TRUE,
+ '#collapsed' => FALSE,
+ '#tree' => TRUE,
+ );
/**
* Let's look to locate a theme-settings.php file for the theme we are
* creating the template for.
@@ -985,8 +984,10 @@ function delta_create_theme_settings_template_form($form_state, $theme) {
include_once(drupal_get_path('theme', $theme). '/theme-settings.php');
$function = $theme. '_settings';
$settings = theme_get_settings($theme);
- $form += $function($settings);
-
+ $override_form_elements = $function($settings);
+ foreach($override_form_elements AS $k => $v) {
+ $form['delta_template_overrides'][$k] = $v;
+ }
}
// submit button
$form['submit'] = array(
@@ -995,6 +996,7 @@ function delta_create_theme_settings_template_form($form_state, $theme) {
'#validate' => array('delta_create_theme_settings_template_validate'),
'#submit' => array('delta_create_theme_settings_template_submit'),
);
+ $form['#redirect'] = 'admin/build/delta/settings/'. $theme;
return $form;
}
@@ -1006,18 +1008,16 @@ function delta_create_theme_settings_template_validate($form, &$form_state) {
}
}
function delta_create_theme_settings_template_submit($form, &$form_state) {
- drupal_set_message('New theme settings themplate: '. $form_state['values']['delta_template']['name'] .' created.');
-}
-
-/**
- * Adds skins to the Popups API.
- *
- * Returns an associative array where the key is the skin name, along
- * with CSS and JS values to tell where the skin can be found.
- */
-function delta_popups_skins() {
- $skins['delta'] = array(
- 'css' => drupal_get_path('module', 'delta') .'/popups_skin/delta_popups.css',
- );
- return $skins;
+ $delta = $form_state['values'];
+ // New Override, Insert query
+ db_query("
+ INSERT INTO {delta_theme_settings}
+ (name, theme, data)
+ VALUES('%s', '%s', '%s')",
+ $delta['delta_template']['name'],
+ $delta['delta_template']['theme'],
+ serialize($delta['delta_template_overrides'])
+ );
+
+ drupal_set_message('New theme settings template: '. $form_state['values']['delta_template']['name'] .' created.');
} \ No newline at end of file