? skeleton-menu.patch
Index: skeleton.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skeleton/skeleton.module,v
retrieving revision 1.10
diff -u -p -r1.10 skeleton.module
--- skeleton.module	28 Dec 2008 22:45:13 -0000	1.10
+++ skeleton.module	29 Dec 2008 22:29:48 -0000
@@ -40,40 +40,42 @@ function skeleton_menu() {
 
   $items = array();
 
+  // Default configuration elements.
   $items['admin/content/skeleton'] = array(
-    'page callback' => 'skeleton_configure',
-    'page arguments' => array('skeleton_admin'),
+    'page callback' => 'skeleton_admin',
     'description' => 'Create reusable book outlines.',
     'access callback' => '_skeleton_user_can_view',
     'title' => 'Skeleton outlines',
+    'file' => 'skeleton_admin.inc',
   );
   $items['admin/content/skeleton/skeleton'] = array(
-    'page callback' => 'skeleton_configure',
-    'page arguments' => array('skeleton_admin'),
+    'page callback' => 'skeleton_admin',
     'access arguments' => array('configure skeleton outlines'),
     'type' => MENU_DEFAULT_LOCAL_TASK,
     'weight' => -10,
     'title' => 'Skeletons',
+    'file' => 'skeleton_admin.inc',
   );
   $items['admin/content/skeleton/skeleton/view'] = array(
-    'page callback' => 'skeleton_configure',
-    'page arguments' => array('skeleton_add'),
+    'page callback' => 'skeleton_add',
     'access arguments' => array('configure skeleton outlines'),
     'type' => MENU_DEFAULT_LOCAL_TASK,
     'weight' => -10,
     'title' => 'List',
+    'file' => 'skeleton_admin.inc',
   );
   $items['admin/content/skeleton/skeleton/add'] = array(
-    'page callback' => 'skeleton_configure',
-    'page arguments' => array('skeleton_add'),
+    'page callback' => 'skeleton_add',
     'access arguments' => array('configure skeleton outlines'),
     'type' => MENU_LOCAL_TASK,
     'weight' => -8,
     'title' => 'Add skeleton',
+    'file' => 'skeleton_admin.inc',
   );
+  // Template items.
   $items['admin/content/skeleton/template'] = array(
-    'page callback' => 'skeleton_template',
-    'page arguments' => array('0', 'list'),
+    'page callback' => 'skeleton_list_template',
+    'page arguments' => array('0'),
     'access arguments' => array('configure skeleton outlines'),
     'type' => MENU_LOCAL_TASK,
     'weight' => 10,
@@ -81,8 +83,8 @@ function skeleton_menu() {
     'file' => 'skeleton_template.inc',
   );
     $items['admin/content/skeleton/template/view'] = array(
-    'page callback' => 'skeleton_template',
-    'page arguments' => array('0', 'view'),
+    'page callback' => 'skeleton_view_template',
+    'page arguments' => array('0'),
     'access arguments' => array('configure skeleton outlines'),
     'type' => MENU_DEFAULT_LOCAL_TASK,
     'weight' => -10,
@@ -90,28 +92,20 @@ function skeleton_menu() {
     'file' => 'skeleton_template.inc',
   );
   $items['admin/content/skeleton/template/add'] = array(
-    'page callback' => 'skeleton_template',
-    'page arguments' => array('0', 'add'),
+    'page callback' => 'skeleton_add_template',
+    'page arguments' => array('0'),
     'access arguments' => array('configure skeleton outlines'),
     'type' => MENU_LOCAL_TASK,
     'weight' => -8,
     'title' => 'Add template',
     'file' => 'skeleton_template.inc',
   );
-
-  $items['admin/content/skeleton/skeleton/%skeleton/create'] = array(
-    'page callback' => 'skeleton_instance',
-    'page arguments' => array(4, 'create'),
-    'access arguments' => array('create new instances'),
-    'type' => MENU_LOCAL_TASK,
-    'weight' => 6,
-    'title' => 'Create skeleton instance',
-  );
   $items['admin/content/skeleton/assign/%/%/%'] = array(
     'page callback' => 'skeleton_assign_template',
     'page arguments' => array(4, 5, 6),
     'access arguments' => array('configure skeleton outlines'),
     'type' => MENU_CALLBACK,
+    'file' => 'skeleton_template.inc',
   );
   $items['admin/content/skeleton/template/%skeleton_template/view'] = array(
     'page callback' => 'skeleton_view_template',
@@ -139,97 +133,37 @@ function skeleton_menu() {
     'weight' => 10,
     'file' => 'skeleton_template.inc',
   );
+  // Skeleton items.
+  $items['admin/content/skeleton/skeleton/%skeleton/create'] = array(
+    'page callback' => 'skeleton_create_instance',
+    'page arguments' => array(4),
+    'access arguments' => array('create new instances'),
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 6,
+    'title' => 'Create skeleton instance',
+    'file' => 'skeleton_instance.inc',
+  );
   $items['admin/content/skeleton/skeleton/%skeleton/edit'] = array(
-    'page callback' => 'skeleton_instance',
-    'page arguments' => array(4, 'edit'),
+    'page callback' => 'skeleton_edit_instance',
+    'page arguments' => array(4),
     'access arguments' => array('configure skeleton outlines'),
     'type' => MENU_LOCAL_TASK,
     'weight' => 8,
     'title' => 'Edit skeleton',
+    'file' => 'skeleton_instance.inc',
   );
   $items['admin/content/skeleton/skeleton/%skeleton/delete'] = array(
-    'page callback' => 'skeleton_instance',
-    'page arguments' => array(4, 'delete'),
+    'page callback' => 'skeleton_delete_instance',
+    'page arguments' => array(4),
     'access arguments' => array('configure skeleton outlines'),
     'type' => MENU_CALLBACK,
     'weight' => 10,
+    'file' => 'skeleton_instance.inc',
   );
 
   return $items;
 }
 
-/**
- * Router for the admin page.
- *
- * @param $function
- *   The callback function that should be loaded by this page request.
- * @return
- *   HTML content rendered by the target function
- */
-function skeleton_configure($function) {
-  include_once('skeleton_admin.inc');
-  return $function();
-}
-
-/**
- * Router for the skeleton page.
- *
- * @param $skeleton
- *   The skeleton to act upon
- * @param $action
- *   Determines the callback function that should be loaded by this page request.
- * @return
- *   HTML content rendered by the target function
- */
-function skeleton_instance($skeleton, $action) {
-  // be sure we have an integer
-  include_once('skeleton_admin.inc');
-  $function = 'skeleton_'. $action .'_instance';
-  return $function($skeleton);
-}
-
-/**
- * Router for the skeleton page.
- *
- * @param $template_id
- *   The id of the template to act upon
- * @param $action
- *   Determines the callback function that should be loaded by this page request.
- * @return
- *   HTML content rendered by the target function
- */
-function skeleton_template($template_id, $action) {
-  // Be sure we have an integer.
-  if (is_numeric($template_id)) {
-    $function = 'skeleton_'. $action .'_template';
-    return $function(intval($template_id));
-  }
-  else {
-    return t('Illegal request.');
-  }
-}
-
-/**
- * Add a template to a skeleton
- *
- * @param $action
- *   Route the function to the correct action (add / remove)
- * @param $skeleton_id
- *   The id of the template to act upon
- * @param $template_id
- *   The id of the template to act upon
- * @return
- *   Callback function, will return you to the current page after acting.
- */
-function skeleton_assign_template($action, $skeleton_id, $template_id) {
-  if (($action != 'add' && $action != 'remove') || intval($skeleton_id) == 0 || intval($template_id) == 0) {
-    return t('Illegal request');
-  }
-  include_once('skeleton_instance.inc');
-  $skeleton = skeleton_load($skeleton_id);
-  $template = skeleton_template_load($template_id);
-  return skeleton_assign($action, $skeleton, $template);
-}
 
 /**
  * Return if the user should be given permission to view Skeleton Outlines.
Index: skeleton_admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skeleton/skeleton_admin.inc,v
retrieving revision 1.10
diff -u -p -r1.10 skeleton_admin.inc
--- skeleton_admin.inc	29 Dec 2008 18:14:31 -0000	1.10
+++ skeleton_admin.inc	29 Dec 2008 22:29:48 -0000
@@ -101,200 +101,3 @@ function skeleton_add_form_submit($form,
   $skeleton = skeleton_get_by_name($form_state['values']['skeleton']);
   drupal_goto('admin/content/skeleton/'. $skeleton->skeleton_id . '/edit');
 }
-
-/**
- * Edit a skeleton definition
- *
- * @param $skeleton
- *   An object from the {skeleton} table, indicating the outline to act upon.
- * @return
- *   Themed HTML, including the outline form
- */
-function skeleton_edit_instance($skeleton) {
-  $output = '';
-  drupal_set_title(check_plain($skeleton->skeleton));
-  $output .= '<h3>'. check_plain($skeleton->skeleton) .'</h3>';
-  include_once('skeleton_instance.inc');
-  return skeleton_define($skeleton);
-}
-
-/**
- * Delete a skeleton
- *
- * @param $skeleton
- *   An object from the {skeleton} table, indicating the outline to act upon.
- * @return
- *   Themed HTML, including the deletion form
- */
-function skeleton_delete_instance($skeleton) {
-  $output = '';
-  drupal_set_title(t('Skeleton: Delete'));
-  $output .= '<h3>'. check_plain($skeleton->skeleton) .'</h3>';
-  $output .= t('<p>Are you sure you want to delete this skeleton outline?</p>');
-  $output .= drupal_get_form('skeleton_delete_form', $skeleton->skeleton_id);
-  return $output;
-}
-
-/**
- * FormsAPI for skeleton_delete_instance()
- */
-function skeleton_delete_form($form_state, $skeleton_id) {
-  $form = array();
-  $form['skeleton_id'] = array('#type' => 'value', '#value' => $skeleton_id);
-  $form['submit'] = array(
-    '#type' => 'submit',
-    '#value' => t('Delete skeleton'),
-    '#prefix' => l(t('Cancel action'), 'admin/content/skeleton') .'<br />'
-  );
-  return $form;
-}
-
-/**
-  * FormsAPI for skeleton_delete_form()
-  */
-function skeleton_delete_form_submit($form, &$form_state) {
-  db_query("DELETE from {skeleton} WHERE skeleton_id = %d", $form_state['values']['skeleton_id']);
-  // TODO add delete for legacy items
-  drupal_set_message(t('Skeleton deleted.'));
-  drupal_goto('admin/content/skeleton');
-}
-
-/**
- * Create a new instance of a skeleton
- * This function generates the actual book pages.
- *
- * @param $skeleton
- *   An object from the {skeleton} table, indicating the outline to act upon.
- * @return
- *   Themed HTML, including the instance creation form
- */
-function skeleton_create_instance($skeleton) {
-  $output = '';
-  drupal_set_title(t('Skeleton: Create'));
-  $output .= '<h3>'. check_plain($skeleton->skeleton) .'</h3>';
-  $tree = skeleton_get_tree($skeleton->skeleton_id);
-  if (empty($tree)) {
-    $output .= '<p>' . t('You must first assign at least one template to this skeleton outline. <a href="@edit-url">Edit this skeleton</a> to add a template to it.', array('@edit-url' => url('admin/content/skeleton/skeleton/' . $skeleton->skeleton_id . '/edit'))) . '</p>';
-    return $output;
-  }
-  $output .= drupal_get_form('skeleton_create_instance_form', $skeleton);
-  return $output;
-}
-
-/**
- * FormsAPI for skeleton_create_instance()
- */
-function skeleton_create_instance_form($form_state, $skeleton) {
-  $form = array();
-  $form['instance'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Skeleton Information'),
-    '#collapsible' => TRUE
-  );
-  $form['instance']['title'] = array(
-    '#type' => 'textfield',
-    '#size' => 40,
-    '#title' => t('Book title'),
-    '#required' => TRUE,
-    '#description' => t('The title of the new book you wish to create'),
-  );
-  if (module_exists('translation')) {
-    // We are always creating a book page. This is modified from
-    // locale_form_alter().
-    if (variable_get('language_content_type_book', 0)) {
-      $form['instance']['language'] = array(
-        '#type' => 'select',
-        '#title' => t('Language'),
-        '#options' => array('' => t('Language neutral')) + locale_language_list('name'),
-      );
-    }
-    // Node type without language selector: assign the default for new nodes
-    else {
-      $default = language_default();
-      $form['instance']['language'] = array(
-        '#type' => 'value',
-        '#value' => $default->language
-      );
-    }
-  }
-  $form['instance']['body'] = array(
-    '#type' => 'textarea',
-    '#cols' => 40,
-    '#rows' => 10,
-    '#title' => t('Book introduction'),
-    '#required' => TRUE,
-    '#description' => t('A description of the contents of this book.'),
-    '#suffix' => t('<p>After you create this instance, you will be able to edit the complete book page.</p>'),
-  );
-  $form['instance']['skeleton_id'] = array(
-    '#type' => 'value',
-    '#value' => $skeleton->skeleton_id,
-  );
-  $form['submit'] = array(
-    '#type' => 'submit',
-    '#value' => t('Create new book from skeleton'),
-  );
-  return $form;
-}
-
-/**
- * FormsAPI for skeleton_create_instance()
- * Creates the nodes from the outline using drupal_execute().
- *
- * Note: The nid fetching sequence is sketchy and might need rewriting
- * 
- */
-function skeleton_create_instance_form_submit($form, &$form_state) {
-  include_once drupal_get_path('module', 'node') . '/node.pages.inc';
-  global $user;
-  $nodes = skeleton_get_tree($form_state['values']['skeleton_id']);
-  //dpr ("Inserting nodes...");
-  if (!empty($nodes)) {
-    $parents = array();
-    // get the next node id and use it for the parent
-    $parent_node = array(
-      'values' => array(
-        'uid' => $user->uid,
-        'name' => $user->name,
-        'title' => $form_state['values']['title'],
-        'type' => 'book',
-        'body' => $form_state['values']['body'],
-        'op' => t('Save'),
-      ),
-    );
-    if (module_exists('translation')) {
-      $parent_node['values']['language'] = $form_state['values']['language'];
-    }
-    $parent_node['values']['book']['bid'] = 'new';
-    $parent_node['values']['book']['options'] = array();
-    drupal_execute('book_node_form', $parent_node, $parent_node['values']);
-    // get the id we just created
-    $book_id = $parent_node['nid'];
-    $goto_id = $book_id;
-    // iterate through the dummy nodes and create the book pages
-    // The Book ID is the NID of the topmost book page.
-    foreach ($nodes as $data) {
-      $node = array();
-      $node['values'] = unserialize($data->node_data);
-      // if parents are assigned by the skeleton, use them
-      if ($data->parent > 0 && isset($parents[$data->parent])) {
-        $parent_node = node_load($parents[$data->parent]);
-      }
-      else {
-        $parent_node = node_load($book_id);
-      }
-      $node['values']['book'] = array();
-      $node['values']['book']['bid'] = $book_id;
-      $node['values']['book']['plid'] = $parent_node->book['mlid'];
-      $node['values']['book']['options'] = array();
-      $node['values']['op'] = t('Save');
-      drupal_execute($node['values']['type'] .'_node_form', $node, (object)$node['values']);
-      // Store all of the menu id's for each inserted template.
-      $parents[$data->template_id] = $node['nid'];
-    }
-  }
-  else {
-    form_set_error(t('This skeleton is empty.'), 'form');
-  }
-  $form_state['redirect'] = 'node/' . $goto_id . '/edit';
-}
\ No newline at end of file
Index: skeleton_instance.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skeleton/skeleton_instance.inc,v
retrieving revision 1.8
diff -u -p -r1.8 skeleton_instance.inc
--- skeleton_instance.inc	29 Dec 2008 18:18:29 -0000	1.8
+++ skeleton_instance.inc	29 Dec 2008 22:29:49 -0000
@@ -322,3 +322,200 @@ function skeleton_delete_redirect($form_
 function skeleton_create_redirect($form_id, &$form_state) {
   $form_state['redirect'] = 'admin/content/skeleton/skeleton/'. $form_state['values']['skeleton_id'] . '/create';
 }
+
+/**
+ * Edit a skeleton definition
+ *
+ * @param $skeleton
+ *   An object from the {skeleton} table, indicating the outline to act upon.
+ * @return
+ *   Themed HTML, including the outline form
+ */
+function skeleton_edit_instance($skeleton) {
+  $output = '';
+  drupal_set_title(check_plain($skeleton->skeleton));
+  $output .= '<h3>'. check_plain($skeleton->skeleton) .'</h3>';
+  include_once('skeleton_instance.inc');
+  return skeleton_define($skeleton);
+}
+
+/**
+ * Delete a skeleton
+ *
+ * @param $skeleton
+ *   An object from the {skeleton} table, indicating the outline to act upon.
+ * @return
+ *   Themed HTML, including the deletion form
+ */
+function skeleton_delete_instance($skeleton) {
+  $output = '';
+  drupal_set_title(t('Skeleton: Delete'));
+  $output .= '<h3>'. check_plain($skeleton->skeleton) .'</h3>';
+  $output .= t('<p>Are you sure you want to delete this skeleton outline?</p>');
+  $output .= drupal_get_form('skeleton_delete_form', $skeleton->skeleton_id);
+  return $output;
+}
+
+/**
+ * FormsAPI for skeleton_delete_instance()
+ */
+function skeleton_delete_form($form_state, $skeleton_id) {
+  $form = array();
+  $form['skeleton_id'] = array('#type' => 'value', '#value' => $skeleton_id);
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Delete skeleton'),
+    '#prefix' => l(t('Cancel action'), 'admin/content/skeleton') .'<br />'
+  );
+  return $form;
+}
+
+/**
+  * FormsAPI for skeleton_delete_form()
+  */
+function skeleton_delete_form_submit($form, &$form_state) {
+  db_query("DELETE from {skeleton} WHERE skeleton_id = %d", $form_state['values']['skeleton_id']);
+  // TODO add delete for legacy items
+  drupal_set_message(t('Skeleton deleted.'));
+  drupal_goto('admin/content/skeleton');
+}
+
+/**
+ * Create a new instance of a skeleton
+ * This function generates the actual book pages.
+ *
+ * @param $skeleton
+ *   An object from the {skeleton} table, indicating the outline to act upon.
+ * @return
+ *   Themed HTML, including the instance creation form
+ */
+function skeleton_create_instance($skeleton) {
+  $output = '';
+  drupal_set_title(t('Skeleton: Create'));
+  $output .= '<h3>'. check_plain($skeleton->skeleton) .'</h3>';
+  $tree = skeleton_get_tree($skeleton->skeleton_id);
+  if (empty($tree)) {
+    $output .= '<p>' . t('You must first assign at least one template to this skeleton outline. <a href="@edit-url">Edit this skeleton</a> to add a template to it.', array('@edit-url' => url('admin/content/skeleton/skeleton/' . $skeleton->skeleton_id . '/edit'))) . '</p>';
+    return $output;
+  }
+  $output .= drupal_get_form('skeleton_create_instance_form', $skeleton);
+  return $output;
+}
+
+/**
+ * FormsAPI for skeleton_create_instance()
+ */
+function skeleton_create_instance_form($form_state, $skeleton) {
+  $form = array();
+  $form['instance'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Skeleton Information'),
+    '#collapsible' => TRUE
+  );
+  $form['instance']['title'] = array(
+    '#type' => 'textfield',
+    '#size' => 40,
+    '#title' => t('Book title'),
+    '#required' => TRUE,
+    '#description' => t('The title of the new book you wish to create'),
+  );
+  if (module_exists('translation')) {
+    // We are always creating a book page. This is modified from
+    // locale_form_alter().
+    if (variable_get('language_content_type_book', 0)) {
+      $form['instance']['language'] = array(
+        '#type' => 'select',
+        '#title' => t('Language'),
+        '#options' => array('' => t('Language neutral')) + locale_language_list('name'),
+      );
+    }
+    // Node type without language selector: assign the default for new nodes
+    else {
+      $default = language_default();
+      $form['instance']['language'] = array(
+        '#type' => 'value',
+        '#value' => $default->language
+      );
+    }
+  }
+  $form['instance']['body'] = array(
+    '#type' => 'textarea',
+    '#cols' => 40,
+    '#rows' => 10,
+    '#title' => t('Book introduction'),
+    '#required' => TRUE,
+    '#description' => t('A description of the contents of this book.'),
+    '#suffix' => t('<p>After you create this instance, you will be able to edit the complete book page.</p>'),
+  );
+  $form['instance']['skeleton_id'] = array(
+    '#type' => 'value',
+    '#value' => $skeleton->skeleton_id,
+  );
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Create new book from skeleton'),
+  );
+  return $form;
+}
+
+/**
+ * FormsAPI for skeleton_create_instance()
+ * Creates the nodes from the outline using drupal_execute().
+ *
+ * Note: The nid fetching sequence is sketchy and might need rewriting
+ * 
+ */
+function skeleton_create_instance_form_submit($form, &$form_state) {
+  include_once drupal_get_path('module', 'node') . '/node.pages.inc';
+  global $user;
+  $nodes = skeleton_get_tree($form_state['values']['skeleton_id']);
+  //dpr ("Inserting nodes...");
+  if (!empty($nodes)) {
+    $parents = array();
+    // get the next node id and use it for the parent
+    $parent_node = array(
+      'values' => array(
+        'uid' => $user->uid,
+        'name' => $user->name,
+        'title' => $form_state['values']['title'],
+        'type' => 'book',
+        'body' => $form_state['values']['body'],
+        'op' => t('Save'),
+      ),
+    );
+    if (module_exists('translation')) {
+      $parent_node['values']['language'] = $form_state['values']['language'];
+    }
+    $parent_node['values']['book']['bid'] = 'new';
+    $parent_node['values']['book']['options'] = array();
+    drupal_execute('book_node_form', $parent_node, $parent_node['values']);
+    // get the id we just created
+    $book_id = $parent_node['nid'];
+    $goto_id = $book_id;
+    // iterate through the dummy nodes and create the book pages
+    // The Book ID is the NID of the topmost book page.
+    foreach ($nodes as $data) {
+      $node = array();
+      $node['values'] = unserialize($data->node_data);
+      // if parents are assigned by the skeleton, use them
+      if ($data->parent > 0 && isset($parents[$data->parent])) {
+        $parent_node = node_load($parents[$data->parent]);
+      }
+      else {
+        $parent_node = node_load($book_id);
+      }
+      $node['values']['book'] = array();
+      $node['values']['book']['bid'] = $book_id;
+      $node['values']['book']['plid'] = $parent_node->book['mlid'];
+      $node['values']['book']['options'] = array();
+      $node['values']['op'] = t('Save');
+      drupal_execute($node['values']['type'] .'_node_form', $node, (object)$node['values']);
+      // Store all of the menu id's for each inserted template.
+      $parents[$data->template_id] = $node['nid'];
+    }
+  }
+  else {
+    form_set_error(t('This skeleton is empty.'), 'form');
+  }
+  $form_state['redirect'] = 'node/' . $goto_id . '/edit';
+}
Index: skeleton_template.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skeleton/skeleton_template.inc,v
retrieving revision 1.8
diff -u -p -r1.8 skeleton_template.inc
--- skeleton_template.inc	23 Dec 2008 00:26:59 -0000	1.8
+++ skeleton_template.inc	29 Dec 2008 22:29:50 -0000
@@ -375,4 +375,26 @@ function skeleton_edit_template_form_sub
   }
   db_query("UPDATE {skeleton_template} SET node_data = '%s' WHERE template_id = %d", serialize($node), $form_state['values']['template_id']);
   drupal_set_message(t('Template successfully updated.'));
-}
\ No newline at end of file
+}
+
+/**
+ * Add a template to a skeleton
+ *
+ * @param $action
+ *   Route the function to the correct action (add / remove)
+ * @param $skeleton_id
+ *   The id of the template to act upon
+ * @param $template_id
+ *   The id of the template to act upon
+ * @return
+ *   Callback function, will return you to the current page after acting.
+ */
+function skeleton_assign_template($action, $skeleton_id, $template_id) {
+  if (($action != 'add' && $action != 'remove') || intval($skeleton_id) == 0 || intval($template_id) == 0) {
+    return t('Illegal request');
+  }
+  include_once('skeleton_instance.inc');
+  $skeleton = skeleton_load($skeleton_id);
+  $template = skeleton_template_load($template_id);
+  return skeleton_assign($action, $skeleton, $template);
+}
