2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Abstract class for the image link transformations plugins
6 * @package PhpMyAdmin-Transformations
7 * @subpackage ImageLink
9 if (! defined('PHPMYADMIN')) {
13 /* Get the transformations interface */
14 require_once 'libraries/plugins/TransformationsPlugin.class.php';
15 /* For PMA_transformation_global_html_replace */
16 require_once 'libraries/transformations.lib.php';
19 * Provides common methods for all of the image link transformations plugins.
23 abstract class TextImageLinkTransformationsPlugin
extends TransformationsPlugin
26 * Gets the transformation description of the specific plugin
30 public static function getInfo()
33 'Displays an image and a link; the column contains the filename. The'
34 . ' first option is a URL prefix like "http://www.example.com/". The'
35 . ' second and third options are the width and the height in pixels.'
40 * Does the actual work of each specific transformations plugin.
42 * @param string $buffer text to be transformed
43 * @param array $options transformation options
44 * @param string $meta meta information
48 public function applyTransformation($buffer, $options = array(), $meta = '')
50 $transform_options = array (
51 'string' => '<a href="' . (isset($options[0]) ?
$options[0] : '')
52 . $buffer . '" target="_blank"><img src="'
53 . (isset($options[0]) ?
$options[0] : '') . $buffer
54 . '" border="0" width="' . (isset($options[1]) ?
$options[1] : 100)
55 . '" height="' . (isset($options[2]) ?
$options[2] : 50) . '" />'
59 $buffer = PMA_transformation_global_html_replace(
68 * This method is called when any PluginManager to which the observer
69 * is attached calls PluginManager::notify()
71 * @param SplSubject $subject The PluginManager notifying the observer
77 public function update (SplSubject
$subject)
83 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
87 * Gets the transformation name of the specific plugin
91 public static function getName()