2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Abstract class for the link transformations plugins
6 * @package PhpMyAdmin-Transformations
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 link transformations plugins.
23 abstract class TextLinkTransformationsPlugin
extends TransformationsPlugin
26 * Gets the transformation description of the specific plugin
30 public static function getInfo()
33 'Displays a link; the column contains the filename. The first option'
34 . ' is a URL prefix like "http://www.example.com/". The second option'
35 . ' is a title for the link.'
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 = '')
51 $append_part = (isset($options[2]) && $options[2]) ?
'' : $buffer;
53 $transform_options = array (
54 'string' => '<a href="'
55 . PMA_linkURL((isset($options[0]) ?
$options[0] : '') . $append_part)
56 . '" title="' . (isset($options[1]) ?
$options[1] : '')
57 . '" target="_new">' . (isset($options[1]) ?
$options[1] : $buffer)
61 $buffer = PMA_transformation_global_html_replace(
70 * This method is called when any PluginManager to which the observer
71 * is attached calls PluginManager::notify()
73 * @param SplSubject $subject The PluginManager notifying the observer
79 public function update (SplSubject
$subject)
85 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
89 * Gets the transformation name of the specific plugin
93 public static function getName()