? 960548-templateremove.patch
? skinr_960548.patch
? submithandlers-906764-HEAD.patch
Index: skinr.handlers.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/skinr.handlers.inc,v
retrieving revision 1.4
diff -u -p -r1.4 skinr.handlers.inc
--- skinr.handlers.inc	2 Jun 2010 13:16:58 -0000	1.4
+++ skinr.handlers.inc	9 Nov 2010 00:49:43 -0000
@@ -125,13 +125,6 @@ function skinr_submit_handler(&$form, $f
           }
         }
 
-        if (isset($theme['_template'])) {
-          $theme['_template'] = trim($theme['_template']);
-          if (!empty($theme['_template'])) {
-            $skinr->skins['_template'] = $theme['_template'];
-          }
-        }
-
         if (empty($skinr->sid)) {
           // We didn't receive a valid sid, so raise an error
           drupal_set_message(t("Skinr settings weren't saved due to an error."), 'error');
Index: skinr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/skinr.module,v
retrieving revision 1.30
diff -u -p -r1.30 skinr.module
--- skinr.module	29 Oct 2010 18:08:59 -0000	1.30
+++ skinr.module	9 Nov 2010 00:49:43 -0000
@@ -71,9 +71,6 @@ function skinr_preprocess(&$variables, $
             _skinr_add_file($file['path'], 'js');
           }
         }
-        if (!empty($extracted['template'])) {
-          $variables['theme_hook_suggestions'][] = $extracted['template'];
-        }
         $variables['classes_array'] = array_merge($variables['classes_array'], $extracted['classes']);
 
         // Need to add a hook for skinr_ui to plug into.
@@ -105,7 +102,6 @@ function skinr_skin_extract($module, $si
     'classes' => array(),
     'css' => array(),
     'js' => array(),
-    'template' => array(),
   );
 
   $skins = array();
@@ -122,12 +118,6 @@ function skinr_skin_extract($module, $si
   $extracted['css'] = skinr_skin_get_files($skins, 'css', $theme);
   $extracted['js'] = skinr_skin_get_files($skins, 'js', $theme);
 
-  // Add template files.
-  if (!empty($skins['_template'])) {
-    $extracted['template'] = $skins['_template'];
-    unset($skins['_template']);
-  }
-
   $extracted['classes'] = skinr_flatten_skins_array($skins);
 
   return $extracted;
@@ -635,7 +625,6 @@ function skinr_skin_default() {
     'type' => 'checkboxes',
     'description' => '',
     'features' => array('*'),
-    'templates' => array(),
     'group' => '',
     'options' => array(),
     'stylesheets' => array(),
@@ -690,7 +679,6 @@ function _skinr_skinset($info) {
         'type' => isset($skin['type']) ? $skin['type'] : $defaults['type'],
         'description' => isset($skin['description']) ? $skin['description'] : $defaults['description'],
         'features' => isset($skin['features']) ? $skin['features'] : $defaults['features'],
-        'templates' => isset($skin['templates']) ? $skin['templates'] : $defaults['templates'],
         'group' => !empty($skin['group']) && !empty($skinset['options']['groups'][$skin['group']]) ? $skin['group'] : $defaults['group'],
         'options' => isset($skin['options']) ? $skin['options'] : $defaults['options'],
         'stylesheets' => isset($skin['stylesheets']) ? $skin['stylesheets'] : $defaults['stylesheets'],
Index: skinr_ui.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/skinr_ui.module,v
retrieving revision 1.17
diff -u -p -r1.17 skinr_ui.module
--- skinr_ui.module	29 Oct 2010 06:21:51 -0000	1.17
+++ skinr_ui.module	9 Nov 2010 00:49:44 -0000
@@ -16,7 +16,7 @@ function skinr_ui_permission() {
     ),
     'access skinr classes' => array(
       'title' => t('Access Skinr\'s advanced settings'),
-      'description' => t('Set advanced Skinr options, such as custom CSS classes and custom template files.'),
+      'description' => t('Set advanced Skinr options, such as custom CSS classes.'),
     ),
   );
 }
@@ -449,19 +449,16 @@ function skinr_ui_form_alter(&$form, $fo
           if ($skinr = skinr_handler('data_handler', 'form', $form_settings['data_handler'], $form, $form_state, $theme->name, $module, $form_settings)) {
             $defaults  = $skinr->skins;
             $additional_default = isset($skinr->skins['_additional']) ? $skinr->skins['_additional'] : '';
-            $template_default = isset($skinr->skins['_template']) ? $skinr->skins['_template'] : '';
           }
           else {
             $defaults  = array();
             $additional_default = '';
-            $template_default = '';
           }
         }
         else {
           // Handle preview before submit.
           $defaults  = $form_state['values']['widgets'];
           $additional_default = $form_state['values']['_additional'];
-          $template_default = $form_state['values']['_template'];
         }
 
         if (!isset($form['skinr_settings'][$module . '_group'])) {
@@ -490,7 +487,6 @@ function skinr_ui_form_alter(&$form, $fo
         }
 
         // Create individual widgets for each skin.
-        $template_options = array();
         if (isset($info[$theme->name]->skins)) {
           foreach ($info[$theme->name]->skins as $skin_id => $skin) {
             // Check if this skin is disabled.
@@ -554,10 +550,6 @@ function skinr_ui_form_alter(&$form, $fo
               }
               $form['skinr_settings'][$module . '_group'][$theme->name]['widgets'][$skin['group']][$skin_id] = $field;
             }
-
-            // Prepare templates.
-            $templates = skinr_ui_info_templates_filter($skin['templates'], $preprocess_hooks);
-            $template_options = array_merge($template_options, skinr_ui_info_templates_to_form_options($templates));
           }
         }
 
@@ -570,13 +562,6 @@ function skinr_ui_form_alter(&$form, $fo
             '#description' => t('To add CSS classes manually, enter classes separated by a single space i.e. <code>first-class second-class</code>'),
             '#default_value' => $additional_default,
           );
-          $form['skinr_settings'][$module . '_group'][$theme->name]['_template'] = array(
-            '#type' => !empty($template_options) ? 'select' : 'hidden',
-            '#title' => t('Template file'),
-            '#options' => array_merge(array('' => 'Default'), $template_options),
-            '#default_value' => $template_default,
-            '#description' => t('Optionally, select a template file to use. The "Default" option allows Drupal to handle this.'),
-          );
 
           // Only add validation handler once.
           if (!isset($form['#validate']) || !in_array('skinr_ui_form_validate', $form['#validate'])) {
@@ -775,34 +760,3 @@ function skinr_ui_info_options_to_form_o
   }
   return $form_options;
 }
-
-/**
- * Helper function to convert an array of template filenames, as specified in
- * the info file, into an array usable by form api.
- */
-function skinr_ui_info_templates_to_form_options($templates) {
-  $form_options = array();
-  foreach ($templates as $template) {
-    // If it exists, strip .tpl.php from template.
-    $template = str_replace('.tpl.php', '', $template);
-    $form_options[$template] = $template . '.tpl.php';
-  }
-  return $form_options;
-}
-
-/**
- * Helper function to filter templates by preprocess_hooks.
- */
-function skinr_ui_info_templates_filter($templates, $preprocess_hooks) {
-  $filtered_templates = array();
-  foreach ($templates as $template) {
-    // If it exists, strip .tpl.php from template.
-    $template = str_replace('.tpl.php', '', $template);
-    foreach ($preprocess_hooks as $preprocess_hook) {
-      if (drupal_substr(str_replace('_', '-', $template), (drupal_strlen($preprocess_hook) * -1)) == str_replace('_', '-', $preprocess_hook)) {
-        $filtered_templates[] = $template;
-      }
-    }
-  }
-  return $filtered_templates;
-}
Index: help/skinr.help.ini
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/help/skinr.help.ini,v
retrieving revision 1.2
diff -u -p -r1.2 skinr.help.ini
--- help/skinr.help.ini	15 Oct 2010 07:26:55 -0000	1.2
+++ help/skinr.help.ini	9 Nov 2010 00:49:44 -0000
@@ -16,11 +16,6 @@ title = "Features"
 parent = syntax
 weight = 2
 
-[templates]
-title = "Templates"
-parent = syntax
-weight = 5
-
 [examples]
 title = "Examples"
 parent = syntax
Index: help/templates.html
===================================================================
RCS file: help/templates.html
diff -N help/templates.html
--- help/templates.html	15 Oct 2010 07:26:55 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,51 +0,0 @@
-<div class="messages warning">This feature is still in experimental stages,
-  therefore it should NOT be used on live sites. There are still issues with it
-  that need to be worked out, and in general it will NOT be supported at the
-  moment. Please do not report and issues on this unless they include patches or
-  serious ideas about a way forward for this.
-</div>
-<p>At the moment, templates can be associated with a Skin, or just on their own:
-</p>
-<pre>
-skinr[rounded_corners][templates][] = rounded-corners-block
-skinr[rounded_corners][templates][] = rounded-corners-node</pre>
-<p>However, associating a template with a Skin doesn't automatically mean that
-  file will be used. It needs to be selected manually in the UI.
-</p>
-<p>Also, since there are different variables and template file structures
-  available per hook, it's necessary to provide template files for each type;
-  hence, the -block, -node suffix. This is required, and will automatically
-  filter out the template files that do no apply based on the -hook suffix.
-  While this can still be incredibly useful as is, it's obviously not ideal. An
-  implementation such as rounded corners would probably be better served as some
-  type of wrapper template (like comment-wrapper does today). Ideas and patches
-  to solve this issue are more than welcome.
-</p>
-
-<p>Some creative uses for template files could include:</p>
-
-<pre>
-skinr[extras][templates][] = minimal-block
-skinr[extras][templates][] = blank-block</pre>
-<p>By not specifying the regular widget options, like [title] and [description]
-  for Skins, the widget is conveniently hidden in the UI, but the template still
-  exists under advanced options. So, if you have a case where you don't need the
-  extra markup like the block title and , you can switch the template file to
-  use minimal-block.tpl.php and with the below in your template markup you'll
-  only get the <code>$skinr</code> class and the block content.
-</p>
-<p>In the above example, minimal-block.tpl.php could contain the following
-  markup:
-</p>
-<pre>
-&lt;div class=&quot;&lt;?php print $skinr; ?&gt;&quot;&gt;
-  &lt;?php print $block-&gt;content; ?&gt;
-&lt;/div&gt;</pre>
-<p>You could also specify a blank-block.tpl.php, which could contain only the content:</p>
-<pre>&lt;?php print $block-&gt;content; ?&gt;</pre>
-<p>Both of these examples are useful for cases where you might otherwise be
-  creating multiple template files for custom blocks just to remove markup,
-  which can get unruly. In this case you can just assign the appropriate
-  template file and be done with it, while keeping the number of template files
-  in your theme manageable.
-</p>
Index: modules/panels.skinr.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/modules/panels.skinr.inc,v
retrieving revision 1.14
diff -u -p -r1.14 panels.skinr.inc
--- modules/panels.skinr.inc	29 Oct 2010 06:24:37 -0000	1.14
+++ modules/panels.skinr.inc	9 Nov 2010 00:49:44 -0000
@@ -235,13 +235,6 @@ function panels_skinr_submit_handler_set
         }
       }
 
-      if (isset($theme['_template'])) {
-        $theme['_template'] = trim($theme['_template']);
-        if (!empty($theme['_template'])) {
-          $value['_template'] = $theme['_template'];
-        }
-      }
-
       if (empty($sid)) {
         // We didn't receive a valid sid, so raise an error.
         drupal_set_message(t("Skinr settings weren't saved due to an error."), 'error');
Index: modules/views.skinr.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/modules/views.skinr.inc,v
retrieving revision 1.8
diff -u -p -r1.8 views.skinr.inc
--- modules/views.skinr.inc	2 Jun 2010 13:16:58 -0000	1.8
+++ modules/views.skinr.inc	9 Nov 2010 00:49:44 -0000
@@ -213,13 +213,6 @@ function views_skinr_submit_handler_disp
         }
       }
 
-      if (isset($theme['_template'])) {
-        $theme['_template'] = trim($theme['_template']);
-        if (!empty($theme['_template'])) {
-          $value['_template'] = $theme['_template'];
-        }
-      }
-
       if (empty($sid)) {
         // We didn't receive a valid sid, so raise an error
         drupal_set_message(t("Skinr settings weren't saved due to an error."), 'error');
