cvs diff: Diffing .
? .project
Index: skeleton.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skeleton/skeleton.module,v
retrieving revision 1.21
diff -u -p -r1.21 skeleton.module
--- skeleton.module	15 Jan 2010 02:25:30 -0000	1.21
+++ skeleton.module	20 Jan 2010 21:25:49 -0000
@@ -71,12 +71,47 @@ function skeleton_menu() {
     'file' => 'skeleton_admin.inc',
   );
   $items['admin/content/skeleton/sync'] = array(
-    'page callback' => 'skeleton_sync_page',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('skeleton_sync_add_template_form'),
     'access arguments' => array('configure skeleton outlines'),
     'type' => MENU_LOCAL_TASK,
     'title' => 'Synchronize',
     'file' => 'skeleton_sync.inc',
   );
+  $items['admin/content/skeleton/sync/add-template'] = array(
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('skeleton_sync_add_template_form'),
+    'access arguments' => array('configure skeleton outlines'),
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'title' => 'Added templates',
+    'file' => 'skeleton_sync.inc',
+  );
+  $items['admin/content/skeleton/sync/content'] = array(
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('skeleton_sync_content_form'),
+    'access arguments' => array('configure skeleton outlines'),
+    'type' => MENU_LOCAL_TASK,
+    'title' => 'Template content',
+    'file' => 'skeleton_sync.inc',
+  );
+  $items['admin/content/skeleton/sync/delete-template'] = array(
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('skeleton_sync_delete_template_form'),
+    'access arguments' => array('configure skeleton outlines'),
+    'type' => MENU_LOCAL_TASK,
+    'title' => 'Deleted templates',
+    'file' => 'skeleton_sync.inc',
+  );
+  if (module_exists('translation')) {
+    $items['admin/content/skeleton/sync/translations'] = array(
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('skeleton_sync_translation_form'),
+      'access arguments' => array('configure skeleton outlines'),
+      'type' => MENU_LOCAL_TASK,
+      'title' => 'Template translations',
+      'file' => 'skeleton_translate.inc',
+    );
+  }
   $items['admin/content/skeleton/token'] = array(
     'page callback' => 'drupal_get_form',
     'page arguments' => array('skeleton_token_form'),
Index: skeleton_sync.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skeleton/skeleton_sync.inc,v
retrieving revision 1.4
diff -u -p -r1.4 skeleton_sync.inc
--- skeleton_sync.inc	15 Jan 2010 02:25:30 -0000	1.4
+++ skeleton_sync.inc	20 Jan 2010 21:25:49 -0000
@@ -3,25 +3,6 @@
 // $Id: skeleton_sync.inc,v 1.4 2010/01/15 02:25:30 deviantintegral Exp $
 
 /**
- * Syncronize form. Contains lists of updated, added, and deleted templates.
- *
- * @return
- *   The rendered HTML of the page.
- */
-function skeleton_sync_page() {
-  drupal_add_js(drupal_get_path('module', 'skeleton') . '/skeleton-admin.js');
-  $output .= drupal_get_form('skeleton_sync_content_form');
-  $output .= drupal_get_form('skeleton_sync_add_template_form');
-  $output .= drupal_get_form('skeleton_sync_delete_template_form');
-  // TOOD: When skeleton syncing becomes proper tabs, move this to hook_menu().
-  if (module_exists('translation')) {
-    module_load_include('inc', 'skeleton', 'skeleton_translate');
-    $output .= drupal_get_form('skeleton_sync_translation_form');
-  }
-  return $output;
-}
-
-/**
  * Syncronize content form.
  *
  * @param $form_state
@@ -30,13 +11,9 @@ function skeleton_sync_page() {
  *   The form array.
  */
 function skeleton_sync_content_form($form_state) {
+  drupal_add_js(drupal_get_path('module', 'skeleton') . '/skeleton-admin.js');
   $form = array();
-  $form['content'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Syncronize template content'),
-    '#collapsible' => TRUE,
-  );
-  $form['content']['help'] = array(
+  $form['help'] = array(
     '#prefix' => '<p>',
     '#suffix' => '</p>',
     '#value' => t('Use this form to syncronize changed templates with pages which have all ready been created.'),
@@ -51,20 +28,19 @@ function skeleton_sync_content_form($for
     $updated[$node->nid] = t('<a href="@node-url">%title</a>, in the <a href="@book-url">%book-title</a> book, created from the <a href="@template-url">%template</a> template.', array('@node-url' => url('node/' . $node->nid), '%title' => $node->title, '@book-url' => url('node/' . $book->nid), '%book-title' => $book->title, '%template' => $eligble_node->template, '@template-url' => url('admin/content/skeleton/template/' . $eligble_node->template_id . '/view')));
   }
   if (!empty($updated)) {
-    $form['content']['#collapsed'] = FALSE;
-    $form['content']['nodes'] = array(
+    $form['#collapsed'] = FALSE;
+    $form['nodes'] = array(
       '#type' => 'checkboxes',
       '#title' => t('Select the nodes you wish to update'),
       '#options' => $updated,
     );
-    $form['content']['submit'] = array(
+    $form['submit'] = array(
       '#type' => 'submit',
       '#value' => t('Synchronize'),
     );
   }
   else {
-    $form['content']['#collapsed'] = TRUE;
-    $form['content']['no_nodes'] = array(
+    $form['no_nodes'] = array(
       '#prefix' => '<p>',
       '#suffix' => '</p>',
       '#value' => t('There are no nodes eligible for content synchronizing.')
@@ -100,11 +76,15 @@ function skeleton_sync_content_form_subm
  * Form for pushing out new templates to existing skeletons.
  */
 function skeleton_sync_add_template_form($form_state) {
+  drupal_add_js(drupal_get_path('module', 'skeleton') . '/skeleton-admin.js');
   $form = array();
-  $form['templates'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Syncronize templates'),
-    '#collapsible' => TRUE,
+  $form['help'] = array(
+    '#prefix' => '<p>',
+    '#value' => 'Use this form to add new templates to existing books created from a skeleton.',
+    '#suffix' => '</p>',
+  );
+  $form['skeletons'] = array(
+    '#tree' => TRUE,
   );
   // Find all copies of instantiated skeletons which do not contain a template
   // now associated with the same skeleton.
@@ -113,10 +93,6 @@ function skeleton_sync_add_template_form
     $templates = array();
     $updated = array();
     $skeleton = skeleton_load($skeleton_id);
-    $form['templates']['skeletons'] = array(
-      '#tree' => TRUE,
-    );
-    $form['templates']['skeletons'][$skeleton_id] = array();
     $template_result = db_query("SELECT DISTINCT template_id FROM {skeleton_template_node} WHERE skeleton_id = %d", $skeleton_id);
     while ($template_id = db_result($template_result)) {
       $templates[] = $template_id;
@@ -127,25 +103,27 @@ function skeleton_sync_add_template_form
       $updated[$updated_id] = l($template->template, 'admin/content/skeleton/template/' . $template->template_id . '/view');
     }
     if (!empty($updated)) {
-      $form['templates']['skeletons'][$skeleton_id] = array(
+      $form['skeletons'][$skeleton_id] = array(
         '#type' => 'checkboxes',
         '#title' => t('Create new pages from new templates assigned to <a href="@skeleton-url">%skeleton</a>', array('@skeleton-url' => url('admin/content/skeleton/skeleton/' . $skeleton->skeleton_id . '/edit'), '%skeleton' => $skeleton->skeleton)),
         '#options' => $updated,
       );
-      $form['templates']['submit'] = array(
-        '#type' => 'submit', 
-        '#value' => t('Syncronize'),
-      );
-    }
-    else {
-      $form['templates']['#collapsed'] = TRUE;
-      $form['templates']['no_templates'] = array(
-        '#prefix' => '<p>',
-        '#suffix' => '</p>',
-        '#value' => t('There are no templates eligible for content synchronizing.')
-      );
+      $sync_available = TRUE;
     }
   }
+  if ($sync_available) {
+    $form['submit'] = array(
+      '#type' => 'submit', 
+      '#value' => t('Syncronize'),
+    );
+  }
+  else {
+    $form['no_templates'] = array(
+      '#prefix' => '<p>',
+      '#suffix' => '</p>',
+      '#value' => t('There are no new templates available.')
+    );
+  }
   return $form;
 }
 
@@ -219,18 +197,14 @@ function skeleton_sync_add_template_form
  * deleted.
  */
 function skeleton_sync_delete_template_form($form_state) {
+  drupal_add_js(drupal_get_path('module', 'skeleton') . '/skeleton-admin.js');
   $form = array();
-  $form['delete'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Delete instantiated template nodes'),
-    '#collapsible' => TRUE,
-  );
-  $form['delete']['help'] = array(
+  $form['help'] = array(
     '#prefix' => '<p>',
     '#suffix' => '</p>',
     '#value' => t("Use this form to delete nodes where the associated template has also been deleted."),
   );
-  $form['delete']['nodes'] = array(
+  $form['nodes'] = array(
     '#tree' => TRUE,
   );
 
@@ -242,19 +216,18 @@ function skeleton_sync_delete_template_f
     $options[$node->nid] = t('<a href="@node-url">%title</a>, in the <a href="@book-url">%book-title</a> book.', array('@node-url' => url('node/' . $node->nid), '%title' => $node->title, '@book-url' => url('node/' . $book->nid), '%book-title' => $book->title));
   }
   if (!empty($options)) {
-    $form['delete']['nodes'] = array(
+    $form['nodes'] = array(
       '#type' => 'checkboxes',
       '#title' => t('Select the nodes you wish to delete'),
       '#options' => $options,
     );
-    $form['delete']['submit'] = array(
+    $form['submit'] = array(
       '#type' => 'submit',
       '#value' => t('Delete selected nodes'),
     );
   }
   else {
-    $form['delete']['#collapsed'] = TRUE;
-    $form['delete']['no_nodes'] = array(
+    $form['no_nodes'] = array(
       '#prefix' => '<p>',
       '#suffix' => '</p>',
       '#value' => t('There are no nodes with deleted templates.')
Index: skeleton_translate.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skeleton/skeleton_translate.inc,v
retrieving revision 1.3
diff -u -p -r1.3 skeleton_translate.inc
--- skeleton_translate.inc	20 Jan 2010 19:50:48 -0000	1.3
+++ skeleton_translate.inc	20 Jan 2010 21:25:49 -0000
@@ -46,16 +46,12 @@ function skeleton_sync_translation_form(
   foreach($books as $bid => $book) {
     $book_options[$bid] = $book['title'];
   }
-  $form['translation'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Syncronize node translations'),
-  );
-  $form['translation']['books'] = array(
+  $form['books'] = array(
     '#type' => 'checkboxes',
-    '#title' => t('Syncronize node translations within these books'),
+    '#title' => t('Syncronize translations within these books'),
     '#options' => $book_options,
   );
-  $form['translation']['submit'] = array(
+  $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Update translations'),
   );
