Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / plugins / transformations / abstract / InlineTransformationsPlugin.class.php
blobb1ef0ae4571678582555be582a68d5a2c1c02a1e
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Abstract class for the inline transformations plugins
6 * @package PhpMyAdmin-Transformations
7 * @subpackage Inline
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 inline transformations plugins.
21 * @package PhpMyAdmin
23 abstract class InlineTransformationsPlugin extends TransformationsPlugin
25 /**
26 * Gets the transformation description of the specific plugin
28 * @return string
30 public static function getInfo()
32 return __(
33 'Displays a clickable thumbnail. The options are the maximum width'
34 . ' and height in pixels. The original aspect ratio is preserved.'
38 /**
39 * Does the actual work of each specific transformations plugin.
41 * @param string $buffer text to be transformed
42 * @param array $options transformation options
43 * @param string $meta meta information
45 * @return void
47 public function applyTransformation($buffer, $options = array(), $meta = '')
49 if (PMA_IS_GD2) {
50 $transform_options = array (
51 'string' => '<a href="transformation_wrapper.php'
52 . $options['wrapper_link']
53 . '" target="_blank"><img src="transformation_wrapper.php'
54 . $options['wrapper_link'] . '&amp;resize=jpeg&amp;newWidth='
55 . (isset($options[0]) ? $options[0] : '100') . '&amp;newHeight='
56 . (isset($options[1]) ? $options[1] : 100)
57 . '" alt="[__BUFFER__]" border="0" /></a>'
59 } else {
60 $transform_options = array (
61 'string' => '<img src="transformation_wrapper.php'
62 . $options['wrapper_link']
63 . '" alt="[__BUFFER__]" width="320" height="240" />'
66 $buffer = PMA_transformation_global_html_replace(
67 $buffer,
68 $transform_options
71 return $buffer;
74 /**
75 * This method is called when any PluginManager to which the observer
76 * is attached calls PluginManager::notify()
78 * @param SplSubject $subject The PluginManager notifying the observer
79 * of an update.
81 * @todo implement
82 * @return void
84 public function update (SplSubject $subject)
90 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
93 /**
94 * Gets the transformation name of the specific plugin
96 * @return string
98 public static function getName()
100 return "Inline";