Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / plugins / transformations / abstract / TextImageLinkTransformationsPlugin.class.php
blob054b2f9b8dabcd3e4456adec278a4b42fc31eafd
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Abstract class for the image link transformations plugins
6 * @package PhpMyAdmin-Transformations
7 * @subpackage ImageLink
8 */
9 if (! defined('PHPMYADMIN')) {
10 exit;
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';
18 /**
19 * Provides common methods for all of the image link transformations plugins.
21 * @package PhpMyAdmin
23 abstract class TextImageLinkTransformationsPlugin extends TransformationsPlugin
25 /**
26 * Gets the transformation description of the specific plugin
28 * @return string
30 public static function getInfo()
32 return __(
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.'
39 /**
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
46 * @return void
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) . '" />'
56 . $buffer . '</a>'
59 $buffer = PMA_transformation_global_html_replace(
60 $buffer,
61 $transform_options
64 return $buffer;
67 /**
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
72 * of an update.
74 * @todo implement
75 * @return void
77 public function update (SplSubject $subject)
83 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
86 /**
87 * Gets the transformation name of the specific plugin
89 * @return string
91 public static function getName()
93 return "Image Link";