? .DS_Store
? inline.patch
Index: inline.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/inline/inline.info,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 inline.info
--- inline.info	27 Mar 2007 03:52:31 -0000	1.1.2.1
+++ inline.info	27 Jul 2008 15:31:37 -0000
@@ -2,4 +2,6 @@
 name = Inline
 description = Allows attached files to be placed into the body of a node either automatically or by using simple tags.
 package = "Input filters"
-dependencies = filter upload
\ No newline at end of file
+dependencies[] = filter
+dependencies[] = upload
+core = 6.x
Index: inline.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/inline/inline.module,v
retrieving revision 1.19.2.7
diff -u -p -r1.19.2.7 inline.module
--- inline.module	18 Apr 2007 11:22:27 -0000	1.19.2.7
+++ inline.module	27 Jul 2008 15:31:37 -0000
@@ -1,23 +1,20 @@
 <?php
-// $Id: inline.module,v 1.19.2.7 2007/04/18 11:22:27 sun Exp $
+// $Id: inline.info,v 1.1.2.6 2008/04/27 03:52:31 SiliconMind $
 
 
 /**
  * Implementation of hook_menu().
  */
-function inline_menu($may_cache) {
+function inline_menu() {
   $items = array();
   
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/settings/inline',
-      'title' => t('Inline'),
-      'description' => t('Manage automatic and manual inclusion of attachments in the content of your posts.'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('inline_settings'),
-      'access' => user_access('administer inline settings'),
-    );
-  }
+  $items['admin/settings/inline'] = array(
+    'title' => 'Inline',
+    'description' => t('Manage automatic and manual inclusion of attachments in the content of your posts.'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('inline_settings'),
+    'access arguments' => array('administer inline settings'),
+  );
   return $items;
 }
 
@@ -25,14 +22,14 @@ function inline_perm() {
   return array('administer inline settings');
 }
 
-function inline_help($section = 'admin/help#inline') {
+function inline_help($path, $arg) {
   $output = '';
-  switch ($section) {
+  switch ($path) {
     case 'admin/help#inline':
       return t('<p>Sometimes a user may want to add an image or a file inside the body of a node. This can be done with special tags that are replaced by links to the corresponding uploaded file. If the file is an image, it will be displayed inline, otherwise a link to the file will be inserted. To enable this feature and learn the proper syntax, visit the <a href="!filters">filters configuration screen</a>.</p>', array('!filters' => url('admin/filters')));
     
     case 'filter#short-tip':
-      return t('You may add links to files uploaded with this node <a href="!explanation-url">using special tags</a>', array('!explanation-url' => url('filter/tips', NULL, 'image')));
+      return t('You may add links to files uploaded with this node <a href="!explanation-url">using special tags</a>', array('!explanation-url' => url('filter/tips', array('fragment' => 'image'))));
     
     case 'filter#long-tip':
       return t('<p>You may link to files uploaded with the current node using special tags. The tags will be replaced by the corresponding files. Syntax: <code>[inline:file_id]</code>. Parameter: file_id represents the file uploaded with the node in which to link, assuming that the first uploaded file is labeled as 1 and so on.</p>
@@ -83,9 +80,9 @@ function inline_settings() {
   if (module_exists('imagecache')) {
     $options     = array();
     $options[''] = 'No Imagecache processing';
-    $presets     = _imagecache_get_presets();
+    $presets     = imagecache_presets();
     foreach ($presets as $id => $name) {
-      $options[$name] = $name;
+      $options[$name['presetname']] = $name['presetname'];
     }
     $form['inline']['upload']['image_scaling']['inline_teaser_preset'] = array(
       '#title' => t('Teaser preset'),
@@ -117,7 +114,7 @@ function inline_settings() {
   return system_settings_form($form);
 }
 
-function inline_form_alter($form_id, &$form) {
+function inline_form_alter(&$form, $form_state, $form_id) {
   if ($form_id == 'node_type_form') {
     $node_type = $form['orig_type']['#value'];
     $form['workflow']['upload_inline'] = array(
@@ -170,7 +167,7 @@ function inline_filter_tips($delta, $for
       will be replaced by <em><code>&lt;a href=file1.pdf.png&gt;test&lt;/a&gt;</code></em>');
   }
   else {
-    return t('You may use <a href="!inline_help">[inline:xx] tags</a> to display uploaded files or images inline.', array("!inline_help" => url("filter/tips/$format", NULL, 'filter-inline')));
+    return t('You may use <a href="!inline_help">[inline:xx] tags</a> to display uploaded files or images inline.', array("!inline_help" => url("filter/tips/$format", array('fragment' => 'filter-inline'))));
   }
 }
 
@@ -178,6 +175,7 @@ function inline_nodeapi(&$node, $op, $ar
   if (!is_array($node->files)) {
     return;
   }
+
   switch ($op) {
     case 'alter':
     case 'print':
@@ -195,7 +193,7 @@ function inline_nodeapi(&$node, $op, $ar
       return;
     
     case 'prepare':
-    case 'submit':
+    case 'presave':
       $node->teaser = _inline_replace_numbers($node, 'teaser');
       $node->body = _inline_replace_numbers($node, 'body');
       return;
@@ -238,55 +236,28 @@ function inline_prepare_file_object($fil
   return $file;
 }
 
-function theme_inline_as_link($file) {
-  // prepare link text with title or filename
-  $linktext = ($file->title ? $file->title : $file->filename);
-  
-  return l($linktext, file_create_url($file->filepath), array('title' => t('Download: @name (@size)', array('@name' => $file->filename, '@size' => format_size($file->filesize)))));
-}
-
-function theme_inline_img($file, $field) {
-  $title = (!empty($file->title) ? $file->title : $file->filename);
-  $inline_preset = $field == 'teaser' ? 'inline_teaser_preset' : 'inline_full_preset';
-  
-  if (module_exists('imagecache') && variable_get($inline_preset, '') != '') {
-    $image = theme('imagecache',
-      variable_get($inline_preset, ''),
-      $file->filepath,
-      $title,
-      $title,
-      array('class' => 'inline')
-    );
-  }
-  else {
-    $image = theme('image',
-      $file->filepath,
-      $title,
-      $title,
-      array('class' => 'inline')
-    );
-  }
-  
-  if (variable_get('inline_link_img', '1')) {
-    $attributes = array(
-      'class' => 'inline-image-link',
-      'title' => t("View") .': '. $title,
+/**
+ * Implementation of hook_theme()
+ */
+function inline_theme() {
+  return array(
+    'inline_as_link' => array(
+      'arguments' => array('link' => NULL),
+      'file' => 'inline.theme.inc'
+    ),
+    'inline_img' => array(
+      'arguments' => array('file' => NULL, 'field' => NULL),
+      'file' => 'inline.theme.inc'
+    ),
+    'inline_add_to_teaser' => array(
+      'arguments' => array('node' => NULL, 'file' => NULL, 'field' => NULL),
+      'file' => 'inline.theme.inc'
+    ),
+    'inline_add_to_body' => array(
+      'arguments' => array('node' => NULL, 'file' => NULL, 'field' => NULL),
+      'file' => 'inline.theme.inc'
+    )
     );
-    $html = l($image, $file->filepath, $attributes, NULL, NULL, FALSE, TRUE);
-  }
-  else {
-    $html = $image;
-  }
-  
-  return $html;
-}
-
-function theme_inline_add_to_teaser($node, $file, $field) {
-  return theme('inline_img', $file, $field) . $node->teaser;
-}
-
-function theme_inline_add_to_body($node, $file, $field) {
-  return theme('inline_img', $file, $field) . $node->body;
 }
 
 function _inline_auto_add($node) {
Index: inline.theme.inc
===================================================================
RCS file: inline.theme.inc
diff -N inline.theme.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ inline.theme.inc	27 Jul 2008 15:31:37 -0000
@@ -0,0 +1,52 @@
+<?php
+
+function theme_inline_as_link($file) {
+  // prepare link text with title or filename
+  $linktext = ($file->title ? $file->title : $file->filename);
+
+  return l($linktext, file_create_url($file->filepath), array('attributes' => array('title' => t('Download: @name (@size)', array('@name' => $file->filename, '@size' => format_size($file->filesize))))));
+}
+
+function theme_inline_img($file, $field) {
+  $title = (!empty($file->title) ? $file->title : $file->filename);
+  $inline_preset = $field == 'teaser' ? 'inline_teaser_preset' : 'inline_full_preset';
+
+  if (module_exists('imagecache') && variable_get($inline_preset, '') != '') {
+    $image = theme('imagecache',
+      variable_get($inline_preset, ''),
+      $file->filepath,
+      $title,
+      $title,
+      array('class' => 'inline')
+    );
+  }
+  else {
+    $image = theme('image',
+      $file->filepath,
+      $title,
+      $title,
+      array('class' => 'inline')
+    );
+  }
+
+  if (variable_get('inline_link_img', '1')) {
+    $attributes = array(
+      'class' => 'inline-image-link',
+      'title' => t("View") .': '. $title,
+    );
+    $html = l($image, $file->filepath, array('attributes' => $attributes, 'html' => true));
+  }
+  else {
+    $html = $image;
+  }
+
+  return $html;
+}
+
+function theme_inline_add_to_teaser($node, $file, $field) {
+  return theme('inline_img', $file, $field) . $node->teaser;
+}
+
+function theme_inline_add_to_body($node, $file, $field) {
+  return theme('inline_img', $file, $field) . $node->body;
+}
