/[drupal]/contributions/modules/thickbox/thickbox.module
ViewVC logotype

Diff of /contributions/modules/thickbox/thickbox.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.18.2.17, Tue Mar 24 14:25:36 2009 UTC revision 1.18.2.18, Mon Jun 1 09:43:06 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: thickbox.module,v 1.18.2.16 2009/03/12 07:16:27 frjo Exp $  // $Id: thickbox.module,v 1.18.2.17 2009/03/24 14:25:36 frjo Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 14  Line 14 
14  function thickbox_theme() {  function thickbox_theme() {
15    $theme = array(    $theme = array(
16      'imagefield_image_imagecache_thickbox' => array(      'imagefield_image_imagecache_thickbox' => array(
17        'arguments' => array('namespace' => NULL, 'field' => NULL, 'path' => NULL, 'alt' => NULL, 'title' => NULL, 'gid' => NULL, 'attributes' => NULL),        'arguments' => array('namespace' => NULL, 'path' => NULL, 'alt' => NULL, 'title' => NULL, 'gid' => NULL, 'attributes' => NULL),
18      ),      ),
19    );    );
20    
# Line 195  function thickbox_field_formatter($field Line 195  function thickbox_field_formatter($field
195      }      }
196      list($namespace, $presetname) = explode('][', $formatter, 2);      list($namespace, $presetname) = explode('][', $formatter, 2);
197      if ($preset = imagecache_preset_by_name($namespace)) {      if ($preset = imagecache_preset_by_name($namespace)) {
198        return theme('imagefield_image_imagecache_thickbox', $namespace, $field, $item['filepath'], $item['data']['alt'], $item['data']['title'], $gallery_id);        return theme('imagefield_image_imagecache_thickbox', $namespace, $item['filepath'], $item['data']['alt'], $item['data']['title'], $gallery_id);
199      }      }
200    }    }
201  }  }
202    
203  /**  /**
204   * Implementation of theme_imagefield_image_imagecache_thickbox().   * Implementation of theme_imagefield_image_imagecache_thickbox().
205     *
206     * @param $namespace
207     *   presetname of the derivative you wish to generate a tag for.
208     * @param $path
209     *   path to the original image you wish to create a derivative image tag for.
210     * @param $alt
211     *   img tag alternate text
212     * @param $title
213     *   img tag title text
214     * @param $gid
215     *   gallery id
216     * @param attributes
217     *   optional drupal attributes array. If attributes is set, the default imagecache classes
218     *   will not be set automatically, you must do this manually.
219   */   */
220  function theme_imagefield_image_imagecache_thickbox($namespace, $field, $path, $alt = '', $title = '', $gid = '', $attributes = NULL) {  function theme_imagefield_image_imagecache_thickbox($namespace, $path, $alt = '', $title = '', $gid = '', $attributes = NULL) {
221    if (!empty($path)) {    if (!empty($path)) {
222      $attributes = drupal_attributes($attributes);      $image = theme('imagecache', $namespace, $path, $alt, $title, $attributes);
     $imagecache_path = imagecache_create_url($namespace, $path);  
     $image = '<img src="'. $imagecache_path .'" alt="'. check_plain($alt) .'" '. $attributes .' />';  
   
223      if ($presetname = variable_get('thickbox_imagecache_preset', 0)) {      if ($presetname = variable_get('thickbox_imagecache_preset', 0)) {
224        $link_path = imagecache_create_url($presetname, $path);        $link_path = imagecache_create_url($presetname, $path);
225      }      }

Legend:
Removed from v.1.18.2.17  
changed lines
  Added in v.1.18.2.18

  ViewVC Help
Powered by ViewVC 1.1.2