*** img_assist.module Sat Jun 17 01:02:00 2006 --- img_assist.module-new Fri Oct 13 06:54:14 2006 *************** *** 87,93 **** * Implementation of hook_perm(). */ function img_assist_perm() { ! return array('access img_assist', 'access all images', 'access advanced options'); } /** --- 87,93 ---- * Implementation of hook_perm(). */ function img_assist_perm() { ! return array('access img_assist', 'access all images', 'access advanced options', 'use original size'); } /** *************** *** 769,774 **** --- 769,782 ---- } } + // Add a choice for 'original' if it's within the maximum size. + if ($img_assist_create_derivatives['custom_advanced'] && user_access('use original size')) { + + if ($properties_size['width'] <= $max_size[0] && $properties_size['height'] <= $max_size[1]) { + $derivatives[$properties_size['width'] .'x' . $properties_size['height']] = t('original'); + } + } + // Add a choice for 'other' if the user has the proper permission to create custom sizes if ($img_assist_create_derivatives['custom_advanced'] && user_access('access advanced options')) { $derivatives['other'] = t('other'); *************** *** 854,860 **** '#type' => 'select', '#title' => t('Alignment'), '#default_value' => variable_get('img_assist_default_alignment', 'left'), ! '#options' => array('left'=>'left', 'right'=>'right'), '#prefix' => '', '#suffix' => '' ); --- 862,868 ---- '#type' => 'select', '#title' => t('Alignment'), '#default_value' => variable_get('img_assist_default_alignment', 'left'), ! '#options' => array('left'=>'left', 'right'=>'right', 'none'=>'none', 'center'=>'center'), '#prefix' => '', '#suffix' => '' ); *************** *** 1262,1268 **** $node->title = strip_tags($caption); // change the node title because img_assist_display() uses the node title for alt and title $img_tag = img_assist_display($node, $size); ! $output = ""; $link = explode(',', $attributes['link']); if ($link[0] == 'node') { --- 1270,1280 ---- $node->title = strip_tags($caption); // change the node title because img_assist_display() uses the node title for alt and title $img_tag = img_assist_display($node, $size); ! if ( $attributes['align'] == "center" ) { ! $output = ""; ! } else { ! $output = ""; ! } $link = explode(',', $attributes['link']); if ($link[0] == 'node') { *************** *** 1648,1651 **** return "
\n \"%alt\"\n
%caption
\n
"; } ! ?> \ No newline at end of file --- 1660,1663 ---- return "
\n \"%alt\"\n
%caption
\n
"; } ! ?>