Index: skinr.api.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/skinr.api.php,v
retrieving revision 1.1
diff -u -p -r1.1 skinr.api.php
--- skinr.api.php	17 Dec 2010 22:15:24 -0000	1.1
+++ skinr.api.php	9 Jan 2011 11:56:10 -0000
@@ -93,18 +93,281 @@ function hook_skinr_config() {
 }
 
 /**
- * Register Skinr API information. This is required for your module to have
- * its include files loaded.
+ * Define the API version of this Skinr plugin. This is required when creating
+ * a new Skinr plugin. It checks to make sure your Skins are compatible with the
+ * installed version of Skinr and takes care of loading the include files.
  *
- * The full documentation for this hook is in the advanced help.
+ * The "hook" prefix is substituted with the name of the module or theme that
+ * implements it, e.g. THEME_skinr_api() in template.php, or MODULE_skinr_api()
+ * in MODULE.module.
  */
 function hook_skinr_api() {
   return array(
-    'api' => 1,
+    'api' => 2.0,
     'path' => drupal_get_path('module', 'modulename'),
   );
 }
 
 /**
+ * Define the skin(s) for this Skinr plugin.
+ *
+ * Each skin definition consists of properties that define its form element and
+ * settings that are needed to make it work, such as the class(es) Skinr should
+ * apply, which files it should load, whether or not it should be disabled by
+ * default and which theme hook(s) it was designed to work with.
+ *
+ * Each skin name must be unique. It is recommended to prefix the name of each
+ * skin with the name of the theme or module name implementing it, followed by
+ * the name of the skin. Note that you cannot define 2 skins with the same
+ * the same name, even if they are in different plugins.
+ *
+ * Skin settings:
+ * - title (required): Title of the skin form element.
+ * - description (optional): Description of the skin form element.
+ * - group (optional): The group the skin is attached to; defaults to a Skinr
+ *   provided group labeled "General."
+ * - type (optional): The type of form element. Allowed values:
+ *   - checkboxes (default): Useful when single or multiple options can be
+ *     chosen.
+ *     Does not need to be set manually, as Skinr will apply this by default.
+ *   - select: Useful when a single option can be chosen, but many exist.
+ *   - radios: Useful when a single option can be chosen and only a few options
+ *     exist.
+ * - weight (discouraged): Sets the weight of the skin inside the group; NULL
+ *   by default. weight should not be set on each individual skin. Instead, it
+ *   should be used sparingly where positioning a skin at the very top or
+ *   bottom is desired.
+ * - attached (optional): A array containing information about CSS and
+ *   JavaScript files the skin requires. Each entry is an array keyed by type:
+ *   - css (optional): Maps to the functionality of drupal_add_css() with one
+ *     exception: paths are automatically assumed relative to the plugin
+ *     directory, unless external. Examples:
+ *     - Simple:
+ *       'css' => array('css/skin-name.css')
+ *     - Advanced:
+ *       'css' => array(
+ *         array('css/skin-name-ie.css', array(
+ *           'media' => 'screen',
+ *           'browsers' => array('IE' => 'lte IE 8'),
+ *         ),
+ *       )
+ *   - js (optional): Maps to the functionality of drupal_add_js() with one
+ *     exception: paths are automatically assumed as relative to the plugin
+ *     directory, unless external. Examples:
+ *     - Simple:
+ *       'js' => array('js/skin-name.js')
+ *     - Advanced:
+ *       'js' => array(
+ *         array(
+ *           'js/skin-name-advanced.js',
+ *           array(
+ *             'scope' => 'footer',
+ *             'group' => JS_THEME,
+ *         ),
+ *       )
+ * - options (required): An array containing one or more options (also arrays)
+ *   for the user to choose from when applying skins. Each option key should be
+ *   a machine name describing the option. An option should including the
+ *   following keys:
+ *   - label (required): The option label.
+ *   - class (required): An array containing one or more classes the skin
+ *     should apply. All classes should be entered as an array: For example:
+ *     'class' => array('class-b', 'class-b')
+ *   - attached (optional): Same syntax as above, but applies to a specific
+ *     option only.
+ * - theme hooks (optional): An array containing certain allowed hooks, which
+ *   allow you to limit where the skin can be used. Allowed options include:
+ *   block, block__MODULE, comment, comment__NODETYPE, comment_wrapper,
+ *   comment__wrapper_NODETYPE, node, node__NODETYPE, region,
+ *   region__REGIONNAME, panels_display, panels_region, panels_pane, views_view,
+ *   views_view__STYLENAME, views_view__DISPLAY_NAME, views_view__VIEWNAME, and
+ *   views_view__VIEWNAME_DISPLAYNAME.
+ * - default_status (optional): Skins are disabled by default to keep UI
+ *   clutter to a minimum. In some cases, like contrib themes, it makes sense to
+ *   enable skins which are required to make the theme work properly by default.
+ *   Setting this property to 1 will cause it to be enabled by default for all
+ *   installed themes.
+ *
+ * The "hook" prefix is substituted with the name of the module or theme
+ * implementing it.
+ */
+function hook_skinr_skin_info() {
+  $skins['skinr_menus'] = array(
+    'title' => t('Menu styles'),
+    'description' => t('Select a style to use for the main navigation.'),
+    'type' => 'select',
+    'group' => 'skinr_menus',
+    'theme hooks' => array('block__menu', 'block__menu_block'),
+    'attached' => array(
+      'css' => array('css/nav.css'),
+    ),
+    'options' => array(
+      'one_level' => array(
+        'title' => t('Standard (1 level) - No colors'),
+        'class' => array('nav'),
+      ),
+      'menu_a' => array(
+        'title' => t('Standard (1 level) - Green'),
+        'class' => array('nav', 'nav-a'),
+        'attached' => array('css' => array('css/nav-colors.css')),
+      ),
+      'menu_b' => array(
+        'title' => t('Standard (1 level) - Blue'),
+        'class' => array('nav', 'nav-b'),
+        'attached' => array('css' => array('css/nav-colors.css')),
+      ),
+      'menu_c' => array(
+        'title' => t('Dropdowns - No colors'),
+        'class' => array('nav', 'nav-dd'),
+        'attached' => array(
+          'css' => array('css/nav-dd.css'),
+          'js' => array('js/dropdown.js'),
+        ),
+      ),
+      'menu_d' => array(
+        'title' => t('Dropdowns - Green'),
+        'class' => array('nav', 'nav-dd', 'nav-a'),
+        'attached' => array(
+          'css' => array('css/nav-dd.css'),
+          'js' => array('js/dropdown.js'),
+        ),
+      ),
+      'menu_e' => array(
+        'title' => t('Dropdowns - Blue'),
+        'class' => array('nav', 'nav-dd', 'nav-b'),
+        'attached' => array(
+          'css' => array('css/nav-dd.css'),
+          'js' => array('js/dropdown.js'),
+        ),
+      ),
+    ),
+  );
+  return $skins;
+}
+
+/**
+ * Define one or more skins in an atomic Skinr plugin file.
+ *
+ * This hook works identically to hook_skinr_skin_info(), but allows to place
+ * one or more related skin definitions into a separate plugin file.
+ *
+ * For example, considering a module or theme with the name "extension" that
+ * contains an include file:
+ * @code
+ * extension/skins/example.inc
+ * @encode
+ * The "hook" prefix is substituted with the name of the module or theme
+ * implementing it ("extension"), and PLUGIN is substituted with the name of the
+ * include file ("example"), e.g., THEME_skinr_skin_PLUGIN_info() or
+ * MODULE_skinr_skin_PLUGIN_info(). For above example, the function name would
+ * be: extension_skinr_skin_example_info().
+ */
+function hook_skinr_skin_PLUGIN_info() {
+  $skins['extension_example_menus'] = array(
+    'title' => t('Example menu styles'),
+    'type' => 'select',
+    'group' => 'skinr_menus',
+    'theme hooks' => array('block__menu', 'block__menu_block'),
+    'attached' => array(
+      'css' => array('css/nav.css'),
+    ),
+    'options' => array(
+      'menu_a' => array(
+        'title' => t('Standard (1 level) - Green'),
+        'class' => array('nav', 'nav-a'),
+        'attached' => array('css' => array('css/nav-colors.css')),
+      ),
+      'menu_b' => array(
+        'title' => t('Standard (1 level) - Blue'),
+        'class' => array('nav', 'nav-b'),
+        'attached' => array('css' => array('css/nav-colors.css')),
+      ),
+    ),
+  );
+  return $skins;
+}
+
+/**
+ * Perform alterations on Skinr skins.
+ *
+ * @param $skins
+ *   An array of skin information exposed by hook_skinr_skin_info()
+ *   implementations.
+ */
+function hook_skinr_skin_info_alter(&$skins) {
+  // Remove restrictions on theme hooks the skin works with.
+  unset($skins['skinr_navigation']['theme hooks']);
+}
+
+/**
+ * Defines group(s) that will contain skins.
+ *
+ * Groups are form element containers used to organize skins categorically. If
+ * you do not define a group, your skins will appear in Skinr's default group,
+ * which is labeled "General." Skinr implements 4 default groups, which may be
+ * used in any skin implementation. For more information, see skins/default.inc.
+ *
+ * Each group name must be unique. It is recommended to prefix the name of each
+ * group with the name of the theme or module name implementing it, followed by
+ * the name of the group. Note that you cannot define 2 groups with the same
+ * name, even if they are in different plugins.
+ *
+ * Group properties:
+ * - title (required): Brief title of the tab.
+ * - description (optional): Description of the group for administration page.
+ * - weight (discouraged): Weight of the tab group; 0 by default.
+ *
+ * The "hook" prefix is substituted with the name of the module or theme that
+ * implements it.
+ *
+ * @see skinr_default_skinr_group_info()
+ */
+function hook_skinr_group_info() {
+  $group['skinr_menus'] = array(
+    'title' => t('Menus'),
+    'description' => t('Menu and navigation styles.'),
+  );
+
+  return $groups;
+}
+
+/**
+ * Define one or more skin groups in an atomic Skinr plugin file.
+ *
+ * This hook works identically to hook_skinr_group_info(), but allows to place
+ * one or more related skin group definitions into a separate plugin file.
+ *
+ * For example, considering a module or theme with the name "extension" that
+ * contains an include file:
+ * @code
+ * extension/skins/example.inc
+ * @encode
+ * The "hook" prefix is substituted with the name of the module or theme
+ * implementing it ("extension"), and PLUGIN is substituted with the name of the
+ * include file ("example"), e.g., THEME_skinr_group_PLUGIN_info() or
+ * MODULE_skinr_group_PLUGIN_info(). For above example, the function name would
+ * be: extension_skinr_group_example_info().
+ */
+function hook_skinr_group_PLUGIN_info() {
+  $group['extension_example_menus'] = array(
+    'title' => t('Menus'),
+    'description' => t('Menu and navigation styles.'),
+  );
+  return $groups;
+}
+
+/**
+ * Perform alterations on Skinr groups.
+ *
+ * @param $groups
+ *   An array of group information exposed by hook_skinr_group_info()
+ *   implementations.
+ */
+function hook_skinr_group_info_alter(&$groups) {
+  // Show this tab group at the top of the Skinr settings form.
+  $groups['skinr_menus']['weight'] = -1;
+}
+
+/**
  * @}
  */
Index: skins/default.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/skins/default.inc,v
retrieving revision 1.2
diff -u -p -r1.2 default.inc
--- skins/default.inc	29 Dec 2010 01:02:31 -0000	1.2
+++ skins/default.inc	9 Jan 2011 11:57:11 -0000
@@ -7,17 +7,17 @@
  */
 
 /**
- * Implements hook_skinr_group_info().
+ * Implements hook_skinr_group_PLUGIN_info().
  */
-function skinr_default_skinr_group_info() {
-  $groups['box'] = array(
-    'title' => t('Box styles'),
-    'description' => t('Presentational styles for the container; default group for skins.'),
-  );
+function skinr_skinr_group_default_info() {
   $groups['general'] = array(
     'title' => t('General'),
     'description' => t('Styles for content such as lists, buttons, margins, padding, etc.'),
   );
+  $groups['box'] = array(
+    'title' => t('Box styles'),
+    'description' => t('Presentational styles for the container.'),
+  );
   $groups['typography'] = array(
     'title' => t('Typography'),
     'description' => t('Fonts, styles, sizes and other typography related skins.'),
@@ -26,6 +26,5 @@ function skinr_default_skinr_group_info(
     'title' => t('Layout'),
     'description' => t('Grid, layout and other structural related skins.'),
   );
-
   return $groups;
-}
\ No newline at end of file
+}
