Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / plugins / transformations / abstract / TextLinkTransformationsPlugin.class.php
blobfdc33b29b66f8704c6e8f6c4a34582ced9a79dec
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Abstract class for the link transformations plugins
6 * @package PhpMyAdmin-Transformations
7 * @subpackage Link
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 link transformations plugins.
21 * @package PhpMyAdmin
23 abstract class TextLinkTransformationsPlugin 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 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.'
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 = '')
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)
58 . '</a>'
61 $buffer = PMA_transformation_global_html_replace(
62 $buffer,
63 $transform_options
66 return $buffer;
69 /**
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
74 * of an update.
76 * @todo implement
77 * @return void
79 public function update (SplSubject $subject)
85 /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
88 /**
89 * Gets the transformation name of the specific plugin
91 * @return string
93 public static function getName()
95 return "Link";