Index: fpss.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/fpss/fpss.info,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 fpss.info
--- fpss.info	27 Feb 2009 01:57:25 -0000	1.2.2.1
+++ fpss.info	28 Jan 2010 23:30:15 -0000
@@ -7,3 +7,10 @@
 
 ; Information added by drupal.org packaging script on 2008-10-01
 version = 6.x-1.x-dev
+
+; Information added by drupal.org packaging script on 2009-02-27
+version = "6.x-1.0-beta2"
+core = "6.x"
+project = "fpss"
+datestamp = "1235721680"
+
Index: fpss.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/fpss/fpss.install,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 fpss.install
--- fpss.install	27 Feb 2009 01:57:25 -0000	1.1.2.2
+++ fpss.install	28 Jan 2010 23:30:15 -0000
@@ -25,10 +25,11 @@
       'strip'           => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 1),
       'links'           => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
       'random_order'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
-      'limit_slides'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
+      'limit_slides'    => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+      'save_css'        => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 1)
       ),
     'unique keys' => array(
-      'nid'     => array('nid')
+      'vid'     => array('vid')
       ),
     'primary key' => array('vid')
   );
@@ -38,12 +39,13 @@
       'nid'             => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
       'vid'             => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
       'ssid'            => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+      'weight'          => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
       'slide_url'       => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
       'slide_cat'       => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
       'slide_tag'       => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')
       ),
     'unique keys' => array(
-      'nid'     => array('nid'),
+      'vid'     => array('vid'),
       ),
     'primary key' => array('vid')
   );
Index: fpss.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/fpss/fpss.module,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 fpss.module
--- fpss.module	27 Feb 2009 01:57:25 -0000	1.1.2.2
+++ fpss.module	28 Jan 2010 23:30:16 -0000
@@ -66,7 +66,7 @@
  * Implementation of hook_perm().
  */
 function fpss_perm() {
-  return array('create slide', 'edit own slide', 'create slideshow', 'edit own slideshow', 'admin slideshow', 'set slideshow template');
+  return array('create slide', 'edit own slide', 'edit any slide', 'create slideshow', 'edit own slideshow', 'admin slideshow', 'set slideshow template');
 }
 
 
@@ -84,9 +84,9 @@
       'name' => t('Slide'),
       'module' => 'fpss',
       'description' => t('Add a new slide to a FPSS slideshow. Must have a slideshow set up first.'),
-      'had_title' => TRUE,
+      'has_title' => TRUE,
       'title_label' => t('Title'),
-      'had_body' => TRUE,
+      'has_body' => TRUE,
       'body_label' => t('Slide Text'),
       'min_word_count' => 3,
       'locked' => TRUE
@@ -96,9 +96,9 @@
       'name' => t('Slideshow'),
       'module' => 'fpss',
       'description' => t('Add a new FPSS slideshow.'),
-      'had_title' => TRUE,
+      'has_title' => TRUE,
       'title_label' => t('Title'),
-      'had_body' => FALSE,
+      'has_body' => FALSE,
       'min_word_count' => 0,
       'locked' => TRUE
     )
@@ -134,7 +134,7 @@
     }
     
     if ($op == 'update' || $op == 'delete') {
-      return (user_access('edit own slide') && ($account->uid == $node->uid));
+      return (user_access('edit own slide') && $account->uid == $node->uid) || user_access('edit own slide');
     }
   
   } 
@@ -374,16 +374,26 @@
       '#weight' => -9,
       '#default_value' => $node->ssid,
     );
+    $form['weight'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Weight'),
+      '#required' => TRUE,
+      '#default_value' => $node->weight != '' ? $node->weight : 0,
+      '#maxlength' => 2,
+      '#size' => 30,
+      '#description' => 'Order slides by weight. Lower weights float to the top.',
+      '#weight' => -8.5
+    );
     $form['title'] = array(
       '#type' => 'textfield',
-      '#title' => t($type_data->title_label),
+      '#title' => t('Title'),
       '#required' => TRUE,
       '#default_value' => $node->title,
       '#weight' => -10
     );
     $form['body_filter']['body'] = array(
       '#type' => 'textarea',
-      '#title' => t($type_data->body_label),
+      '#title' => t('Slide Text'),
       '#default_value' => $node->body,
       '#rows' => 7,
       '#required' => TRUE,
@@ -403,6 +413,17 @@
         '#description' => '<p>'.t('The template to use for this slideshow. Selecting \'Random\' will use any of the templates available in the templates directory. When selecting Random, make sure the navigation bar is turned off as not all templates use the navigation bar and the width will vary.').'</p>',
       );
     }
+    $form['save_css'] = array(
+      '#type' => 'radios',
+      '#title' => t('Create new css file'),
+      '#required' => TRUE,
+      '#description' => '<p>'.t('Do you want to create or overwrite the css file for this template?').'</p>',
+      '#options' => array(
+        '1' => t('Yes'),
+        '0' => t('No')
+      ),
+      '#default_value' => $node->save_css ? 1 : 0,
+    );
     $form['dimensions'] = array(
       '#type' => 'fieldset',
       '#title' => 'Dimensions',
@@ -633,9 +654,12 @@
   switch ($op) {
     case 'insert':
     case 'update':
-      if ($node->type == 'fpss_slideshow') {
+      if ($node->type == 'fpss_slideshow' && $node->save_css) {
         fpss_stylesheet_create($node);
       }
+      if ($node->type == 'fpss_slideshow' && !$node->save_css) {
+        drupal_set_message(t('At your request, a new FPSS css file was not created.'));
+      }
       break;
   }
 }
@@ -644,7 +668,7 @@
  * Implementation of hook_form_alter().
  * Add menu item fields to the node form.
  */
-function fpss_form_alter($form_id, &$form) {
+function fpss_form_alter(&$form, $form_state, $form_id) {
   if ($form_id == 'fpss_slide_node_form' && isset($form['attachments'])) {
     $form['attachments']['#title'] = t('Images');
     $form['attachments']['#description'] = t('Upload the image for the slideshow. This should be a JPG, GIF or PNG. Do not upload more than 1 file.');
@@ -714,6 +738,9 @@
     if ($node->ssid == 0) {
       form_set_error('ssid',t('Please select a slideshow to add this slide to.'));
     }
+    if (!is_numeric($node->weight)) {
+      form_set_error('weight',t('The weight for the slides must be a number.'));
+    }
   }
 }
 
@@ -722,9 +749,9 @@
  */
 function fpss_insert(&$node) {
   if ($node->type == 'fpss_slide') {
-    db_query("INSERT INTO {fpss_slides} (nid, vid, ssid, slide_url, slide_cat, slide_tag) VALUES (%d, %d, %d, '%s', '%s', '%s')", $node->nid, $node->vid, $node->ssid, $node->slide_url, $node->slide_cat, $node->slide_tag);
+    db_query("INSERT INTO {fpss_slides} (nid, vid, ssid, weight, slide_url, slide_cat, slide_tag) VALUES (%d, %d, %d, %d, '%s', '%s', '%s')", $node->nid, $node->vid, $node->ssid, $node->weight, $node->slide_url, $node->slide_cat, $node->slide_tag);
   }elseif ($node->type == 'fpss_slideshow') {
-    db_query("INSERT INTO {fpss_slideshows} (nid, vid, show_nav, width, height, sidebar_width, delay, transition, loading, rotate_action, show_title, show_category, show_tagline, show_slidetext, show_readmore, maxwords, maxchars, strip, links, random_order, limit_slides, template) VALUES (%d, %d, %d, %d, %d, %d, %d, %d, %d, '%s', %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s')", $node->nid, $node->vid, $node->show_nav, $node->width, $node->height, $node->sidebar_width, $node->delay, $node->transition, $node->loading, $node->rotate_action, $node->show_title, $node->show_category, $node->show_tagline, $node->show_slidetext, $node->show_readmore, $node->maxwords, $node->maxchars, $node->strip, $node->links, $node->random_order, $node->limit_slides, $node->template);
+    db_query("INSERT INTO {fpss_slideshows} (nid, vid, show_nav, width, height, sidebar_width, delay, transition, loading, rotate_action, show_title, show_category, show_tagline, show_slidetext, show_readmore, maxwords, maxchars, strip, links, random_order, limit_slides, template, save_css) VALUES (%d, %d, %d, %d, %d, %d, %d, %d, %d, '%s', %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s', %d)", $node->nid, $node->vid, $node->show_nav, $node->width, $node->height, $node->sidebar_width, $node->delay, $node->transition, $node->loading, $node->rotate_action, $node->show_title, $node->show_category, $node->show_tagline, $node->show_slidetext, $node->show_readmore, $node->maxwords, $node->maxchars, $node->strip, $node->links, $node->random_order, $node->limit_slides, $node->template, $node->save_css);
   }
 }
 
@@ -736,9 +763,10 @@
     fpss_insert($node);
   }
   if ($node->type == 'fpss_slide' && !$node->revision) {
-    db_query("UPDATE {fpss_slides} SET slide_url = '%s', slide_cat = '%s', slide_tag = '%s', ssid = %d WHERE vid = %d", $node->slide_url, $node->slide_cat, $node->slide_tag, $node->ssid, $node->vid);
-  }elseif ($node->type == 'fpss_slideshow' && !$node->revision) {
-    db_query("UPDATE {fpss_slideshows} SET show_nav = %d, width = %d, height = %d, sidebar_width = %d, delay = %d, transition = %d, loading = %d, rotate_action = '%s', show_title = %d, show_category = %d, show_tagline = %d, show_slidetext = %d, show_readmore = %d, maxwords = %d, maxchars = %d, strip = %d, links = %d, random_order = %d, limit_slides = %d, template = '%s' WHERE vid = %d", $node->show_nav, $node->width, $node->height, $node->sidebar_width, $node->delay, $node->transition, $node->loading, $node->rotate_action, $node->show_title, $node->show_category, $node->show_tagline, $node->show_slidetext, $node->show_readmore, $node->maxwords, $node->maxchars, $node->strip, $node->links, $node->random_order, $node->limit_slides, $node->template, $node->vid);
+    db_query("UPDATE {fpss_slides} SET slide_url = '%s', slide_cat = '%s', slide_tag = '%s', ssid = %d, weight = %d WHERE vid = %d", $node->slide_url, $node->slide_cat, $node->slide_tag, $node->ssid, $node->weight, $node->vid);
+  }
+  elseif ($node->type == 'fpss_slideshow' && !$node->revision) {
+    db_query("UPDATE {fpss_slideshows} SET show_nav = %d, width = %d, height = %d, sidebar_width = %d, delay = %d, transition = %d, loading = %d, rotate_action = '%s', show_title = %d, show_category = %d, show_tagline = %d, show_slidetext = %d, show_readmore = %d, maxwords = %d, maxchars = %d, strip = %d, links = %d, random_order = %d, limit_slides = %d, template = '%s', save_css = %d WHERE vid = %d", $node->show_nav, $node->width, $node->height, $node->sidebar_width, $node->delay, $node->transition, $node->loading, $node->rotate_action, $node->show_title, $node->show_category, $node->show_tagline, $node->show_slidetext, $node->show_readmore, $node->maxwords, $node->maxchars, $node->strip, $node->links, $node->random_order, $node->limit_slides, $node->template, $node->save_css, $node->vid);
   }
 }
 
@@ -838,7 +866,7 @@
         $js .= 'var CTRrotateAction = \''.$config->rotate_action.'\';';
         drupal_add_js($js,'inline', $fpss_jslocation);
         
-        $sql = "SELECT * FROM {node} n JOIN {node_revisions} r ON n.vid = r.vid JOIN {fpss_slides} f ON  f.vid = r.vid JOIN {upload} a ON a.vid = r.vid JOIN {files} q ON q.fid = a.fid WHERE n.type = '%s' AND n.status = %d AND f.ssid = %d";
+        $sql = "SELECT * FROM {node} n JOIN {node_revisions} r ON n.vid = r.vid JOIN {fpss_slides} f ON  f.vid = r.vid JOIN {upload} a ON a.vid = r.vid JOIN {files} q ON q.fid = a.fid WHERE n.type = '%s' AND n.status = %d AND f.ssid = %d ORDER BY f.weight ASC";
         
         $result = db_query(db_rewrite_sql($sql), 'fpss_slide', 1, $delta);
         $slides = array();
@@ -981,7 +1009,7 @@
           $key = $key + 1;
           if ($key < 10) { $key = "0".$key; }
           $navhtml .= '<li>';
-          $navhtml .= '<a class="navbutton off navi" href="javascript:void(0);" title="'.variable_get('fpss_lang_clicknav', 'Click to navigate!').'">';
+          $navhtml .= '<a class="navbutton off navi" href="'.$slidelink.'" title="'.variable_get('fpss_lang_clicknav', 'Click to navigate!').'">';
           $navhtml .= '
               <span class="navbar-img"><img src="'.$slideimage.'" alt="'.variable_get('fpss_lang_clicknav', 'Click to navigate!').'" /></span>
               <span class="navbar-key">'.t($key).'</span>

