function getURL($image_class = AMP_IMAGE_CLASS_ORIGINAL) { if (!isset($this->_image)) { return false; } return AMP_image_url($this->_image->getName(), $image_class); }
function render_image($source) { $image = $source->getImageFile(); if (!$image) { return false; } return $this->_renderer->image(AMP_image_url($image->getName(), AMP_IMAGE_CLASS_THUMB), $this->_thumb_attr); }
function _makeThumb(&$source, $column_name) { require_once 'AMP/Content/Image.inc.php'; $img = $source->getImageRef(); if (!$img) { return false; } return $this->_HTML_link(AMP_image_url($img->getName(), AMP_IMAGE_CLASS_ORIGINAL), $this->_HTML_image(AMP_image_url($img->getName(), AMP_IMAGE_CLASS_THUMB), $this->_thumb_attr), array('target' => 'blank')); }
function render_image(&$source) { $image = $source->getImageRef(); if (!$image) { return false; } $img_output = $this->_renderer->image(AMP_image_url($image->getName(), AMP_IMAGE_CLASS_THUMB)); $url = $this->url_for($source); if (!$url) { return $img_output; } return $this->_renderer->link($url, $img_output); }
function _renderItem(&$source) { $caption = $this->_renderer->p(converttext($source->getCaption()), array('class' => $this->_css_class_photocaption)); $imageRef =& $source->getImageRef(); if (!$imageRef) { return false; } $this->_image_count++; $image_height = $imageRef->height; $this->_height_total += $image_height; $this->_height_avg = $this->_height_total / $this->_image_count; if ($this->_height_max < $image_height && !($image_height > $this->_height_avg * 2)) { $this->_height_max = $image_height; } $image = $this->_renderer->link(AMP_image_url($imageRef->getName(), AMP_IMAGE_CLASS_ORIGINAL, array('height' => $image_height > 600 ? 600 : 0)), $this->_renderer->image($imageRef->getURL(), array()), array('alt' => AMP_TEXT_FULL_SIZE, 'border' => 0, 'rel' => 'lightbox[' . $this->_source_gallery->getName() . ']', 'title' => $this->render_photo_byline($source), 'target' => '_blank')); $image_byline = $this->render_byline($source, $imageRef); return $image . $image_byline . $caption; }
function _renderImage($image) { $image_url = AMP_image_url($image->getName()); return $this->_renderer->image($image_url, $this->_image_attr) . $this->_renderer->newline(); }
function _HTML_fullImageLink(&$image) { return $this->_HTML_link(AMP_image_url($image->getName(), AMP_IMAGE_CLASS_ORIGINAL), $this->_full_image_link_text); }
$current_page = AMP_params('page'); $folder = AMP_params('folder'); $thumbfinder = new ThumbFinder(); if ($current_index) { $filelist = $thumbfinder->find_by_index($current_index, $current_page); } elseif ($query) { $filelist = $thumbfinder->find_by_glob($query, $current_page); } elseif ($folder) { $filelist = $thumbfinder->find_by_folder($folder, $current_page); } else { $filelist = $thumbfinder->all($current_page); } $index = 0; foreach ($filelist as $picfile) { $index++; print "<div class='imgthumb'><a href='" . AMP_image_url($picfile->getName()) . "' title='" . $picfile->getName() . "'>" . "<img src=\"/image.php?image_class=thumb&filename=" . $picfile->getName() . "&action=resize&height=50&width=100&keep_proportions=1\">" . $picfile->getName() . "</a></div>\n"; } class ThumbFinder { var $images_per_page = 40; function __construct() { $this->filefinder = new AMP_System_File_Image(); } function ThumbFinder() { $this->__construct(); } function find_by_index($current_index, $current_page = 1) { $letters = implode(',', array(strtolower($current_index), strtoupper($current_index)));
function _render_column_footer() { static $arrow_link = ''; if ($this->is_last_column()) { return; } if ($arrow_link) { return $arrow_link; } if (AMP_ICON_COLUMN_FOOTER) { require_once "AMP/Content/Image.inc.php"; #$image = new Content_Image( AMP_ICON_COLUMN_FOOTER ); $icon_value = $this->_renderer->image(AMP_image_url(AMP_ICON_COLUMN_FOOTER, AMP_IMAGE_CLASS_ORIGINAL), array('align' => 'right', 'border' => '0')); } else { $icon_value = '↑'; } $arrow_link = $this->_renderer->newline() . $this->_renderer->link(AMP_Url_AddAnchor($_SERVER['REQUEST_URI'], 'column_top'), $icon_value, array('alt' => 'Next Column', 'border' => 0, 'style' => 'float:right;')); return $arrow_link; }
function makeCriteriaImageInBody($image_filename) { $image_conditions = array(); $condition = "test like %s"; foreach (AMP_lookup('image_classes') as $image_dir => $image_class) { $image_conditions[] = sprintf($condition, $this->dbcon->qstr('%' . AMP_image_url($image_filename, $image_dir) . '%')); } return join(' OR ', $image_conditions); }
function _commit_crop_thumbnail($real_sizes) { $target_path = AMP_image_path($this->_model->getName(), AMP_IMAGE_CLASS_CROP); #AMP_mkdir( substr( $target_path, 0, strlen( $target_path ) - strlen( $this->_model->getName() - 1))); AMP_mkdir(dirname($target_path)); $new_image =& $this->_model->crop($real_sizes['start_x'], $real_sizes['start_y'], $real_sizes['start_x'] + $real_sizes['width'], $real_sizes['start_y'] + $real_sizes['height']); if (!$new_image) { return $this->_commit_crop_failure(); } $this->_model->write_image_resource($new_image, $target_path); $cropped_image =& new AMP_System_File_Image($target_path); if (!$cropped_image->width) { return $this->_commit_crop_failure(); } $target_path = AMP_image_path($this->_model->getName(), AMP_IMAGE_CLASS_THUMB); $thumb_ratio = AMP_IMAGE_WIDTH_THUMB / $cropped_image->width; $thumb_sizes = $this->_resize_ratio(array('height' => $cropped_image->height, 'width' => $cropped_image->width), $thumb_ratio); $thumb_image =& $cropped_image->resize($thumb_sizes['width'], $thumb_sizes['height']); if (!$thumb_image) { return $this->_commit_crop_failure(AMP_TEXT_THUMBNAIL); } $cropped_image->write_image_resource($thumb_image, $target_path); $renderer =& new AMPDisplay_HTML(); $this->message($renderer->image(AMP_image_url($this->_model->getName(), AMP_IMAGE_CLASS_CROP), array('border' => 1)) . $renderer->newline(2) . sprintf(AMP_TEXT_DATA_SAVE_SUCCESS, $cropped_image->getName() . $renderer->space() . AMP_TEXT_CROP), $this->_unique_action_key(), $this->_model->get_url_edit()); return true; }
function _HTML_imageBlock(&$image) { $image_attributes = $this->_article->getImageData(); $align = $image_attributes['align']; if (!$align) { $align = AMP_IMAGE_DEFAULT_ALIGNMENT; } $style_attributes = array('align' => $align, 'class' => $this->_css_class_image); $output = '<table width="' . $image->width . '" border="0" align="' . $align . '"'; $output .= ' cellpadding="0" cellspacing="0"><tr><td>' . "\n"; $output .= '<a href="' . AMP_image_url($image->getName(), AMP_IMAGE_CLASS_ORIGINAL) . '" target="_blank">' . ' <img src="' . AMP_image_url($image->getName(), $image_attributes['image_size']) . '" alt="' . $image_attributes['alt'] . '"' . $this->_HTML_makeAttributes($style_attributes) . '></a>'; $output .= '</td></tr>' . $this->_HTML_photoCaption($image_attributes['caption'], $image->width); return $output . '</table>'; }
function _HTML_thumbnail(&$image) { if (!$image) { return false; } if (AMP_IMAGE_CLASS_THUMB == $this->_list_image_class) { $reg =& AMP_Registry::instance(); if ($thumb_attr = $reg->getEntry(AMP_REGISTRY_CONTENT_IMAGE_THUMB_ATTRIBUTES)) { $this->_thumb_attr = array_merge($this->_thumb_attr, $thumb_attr); } } return $this->_HTML_image(AMP_image_url($image->getName(), $this->_list_image_class), $this->_thumb_attr); }