Initial commit
This commit is contained in:
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Application OctetStream Download Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Download
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\plugins\transformations\abs\DownloadTransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the download transformation for application octetstream
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Download
|
||||
*/
|
||||
class Application_Octetstream_Download extends DownloadTransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Application";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "OctetStream";
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Application OctetStream Hex Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Hex
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\plugins\transformations\abs\HexTransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the hex transformation for application octetstream
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Hex
|
||||
*/
|
||||
class Application_Octetstream_Hex extends HexTransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Application";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "OctetStream";
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Image JPEG Inline Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Inline
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\plugins\transformations\abs\InlineTransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the inline transformation for image jpeg
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Inline
|
||||
*/
|
||||
class Image_JPEG_Inline extends InlineTransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Image";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "JPEG";
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Image JPEG Link Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Link
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\plugins\transformations\abs\ImageLinkTransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the link transformation for image jpeg
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Link
|
||||
*/
|
||||
class Image_JPEG_Link extends ImageLinkTransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Image";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "JPEG";
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Image PNG Inline Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Inline
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\plugins\transformations\abs\InlineTransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the inline transformation for image png
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Inline
|
||||
*/
|
||||
class Image_PNG_Inline extends InlineTransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Image";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "PNG";
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Blob SQL Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage SQL
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\plugins\transformations\abs\SQLTransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the sql transformation for blob data
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage SQL
|
||||
*/
|
||||
class Text_Octetstream_Sql extends SQLTransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Text";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "Octetstream";
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Handles the binary to IPv4/IPv6 transformation for text plain
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage BinaryToIP
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\plugins\TransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the binary to IPv4/IPv6 transformation for text plain
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage BinaryToIP
|
||||
*/
|
||||
class Text_Plain_Binarytoip extends TransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* Gets the transformation description of the plugin
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getInfo()
|
||||
{
|
||||
return __(
|
||||
'Converts an Internet network address stored as a binary string'
|
||||
. ' into a string in Internet standard (IPv4/IPv6) format.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Does the actual work of each specific transformations plugin.
|
||||
*
|
||||
* @param string $buffer text to be transformed. a binary string containing
|
||||
* an IP address, as returned from MySQL's INET6_ATON
|
||||
* function
|
||||
* @param array $options transformation options
|
||||
* @param string $meta meta information
|
||||
*
|
||||
* @return string IP address
|
||||
*/
|
||||
public function applyTransformation($buffer, $options = array(), $meta = '')
|
||||
{
|
||||
$length = strlen($buffer);
|
||||
if ($length == 4 || $length == 16) {
|
||||
$val = @inet_ntop(pack('A' . $length, $buffer));
|
||||
if ($val !== false) {
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
|
||||
/* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
/**
|
||||
* Gets the transformation name of the plugin
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getName()
|
||||
{
|
||||
return "Binary To IPv4/IPv6";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Text";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "Plain";
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Text Plain Bool2Text Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Bool2Text
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\plugins\transformations\abs\Bool2TextTransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the Boolean to Text transformation for text plain.
|
||||
* Has one option: the output format (default 'T/F')
|
||||
* or 'Y/N'
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Bool2Text
|
||||
*/
|
||||
class Text_Plain_Bool2Text extends Bool2TextTransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Text";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "Plain";
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Text Plain Date Format Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage DateFormat
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\plugins\transformations\abs\DateFormatTransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the date format transformation for text plain
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage DateFormat
|
||||
*/
|
||||
class Text_Plain_Dateformat extends DateFormatTransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Text";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "Plain";
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Text Plain External Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage External
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\plugins\transformations\abs\ExternalTransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the external transformation for text plain
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage External
|
||||
*/
|
||||
class Text_Plain_External extends ExternalTransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Text";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "Plain";
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Text Plain Formatted Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Formatted
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\plugins\transformations\abs\FormattedTransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the formatted transformation for text plain
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage Formatted
|
||||
*/
|
||||
class Text_Plain_Formatted extends FormattedTransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Text";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "Plain";
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Text Plain Image Link Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage ImageLink
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\plugins\transformations\abs\TextImageLinkTransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the image link transformation for text plain
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage ImageLink
|
||||
*/
|
||||
class Text_Plain_Imagelink extends TextImageLinkTransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Text";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "Plain";
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Text Plain JSON Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage SQL
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA;
|
||||
use PMA\libraries\plugins\TransformationsPlugin;
|
||||
use PMA\libraries\Response;
|
||||
|
||||
/**
|
||||
* Handles the json transformation for text plain
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage JSON
|
||||
*/
|
||||
class Text_Plain_Json extends TransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* No-arg constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!empty($GLOBALS['cfg']['CodemirrorEnable'])) {
|
||||
$response = PMA\libraries\Response::getInstance();
|
||||
$scripts = $response->getHeader()
|
||||
->getScripts();
|
||||
$scripts->addFile('codemirror/lib/codemirror.js');
|
||||
$scripts->addFile('codemirror/mode/javascript/javascript.js');
|
||||
$scripts->addFile('codemirror/addon/runmode/runmode.js');
|
||||
$scripts->addFile('transformations/json.js');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the transformation description of the specific plugin
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getInfo()
|
||||
{
|
||||
return __(
|
||||
'Formats text as JSON with syntax highlighting.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Does the actual work of each specific transformations plugin.
|
||||
*
|
||||
* @param string $buffer text to be transformed
|
||||
* @param array $options transformation options
|
||||
* @param string $meta meta information
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function applyTransformation($buffer, $options = array(), $meta = '')
|
||||
{
|
||||
return '<code class="json"><pre>' . "\n"
|
||||
. htmlspecialchars($buffer) . "\n"
|
||||
. '</pre></code>';
|
||||
}
|
||||
|
||||
/* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Text";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "Plain";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the transformation name of the specific plugin
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getName()
|
||||
{
|
||||
return "JSON";
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Text Plain SQL Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage SQL
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA\libraries\Response;
|
||||
use PMA\libraries\plugins\transformations\abs\SQLTransformationsPlugin;
|
||||
|
||||
/**
|
||||
* Handles the sql transformation for text plain
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage SQL
|
||||
*/
|
||||
class Text_Plain_Sql extends SQLTransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* No-arg constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!empty($GLOBALS['cfg']['CodemirrorEnable'])) {
|
||||
$response = Response::getInstance();
|
||||
$scripts = $response->getHeader()
|
||||
->getScripts();
|
||||
$scripts->addFile('codemirror/lib/codemirror.js');
|
||||
$scripts->addFile('codemirror/mode/sql/sql.js');
|
||||
$scripts->addFile('codemirror/addon/runmode/runmode.js');
|
||||
$scripts->addFile('function.js');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Text";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "Plain";
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Text Plain XML Transformations plugin for phpMyAdmin
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage SQL
|
||||
*/
|
||||
namespace PMA\libraries\plugins\transformations\output;
|
||||
|
||||
use PMA;
|
||||
use PMA\libraries\plugins\TransformationsPlugin;
|
||||
use PMA\libraries\Response;
|
||||
|
||||
/**
|
||||
* Handles the XML transformation for text plain
|
||||
*
|
||||
* @package PhpMyAdmin-Transformations
|
||||
* @subpackage XML
|
||||
*/
|
||||
class Text_Plain_Xml extends TransformationsPlugin
|
||||
{
|
||||
/**
|
||||
* No-arg constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!empty($GLOBALS['cfg']['CodemirrorEnable'])) {
|
||||
$response = PMA\libraries\Response::getInstance();
|
||||
$scripts = $response->getHeader()
|
||||
->getScripts();
|
||||
$scripts->addFile('codemirror/lib/codemirror.js');
|
||||
$scripts->addFile('codemirror/mode/xml/xml.js');
|
||||
$scripts->addFile('codemirror/addon/runmode/runmode.js');
|
||||
$scripts->addFile('transformations/xml.js');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the transformation description of the specific plugin
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getInfo()
|
||||
{
|
||||
return __(
|
||||
'Formats text as XML with syntax highlighting.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Does the actual work of each specific transformations plugin.
|
||||
*
|
||||
* @param string $buffer text to be transformed
|
||||
* @param array $options transformation options
|
||||
* @param string $meta meta information
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function applyTransformation($buffer, $options = array(), $meta = '')
|
||||
{
|
||||
return '<code class="xml"><pre>' . "\n"
|
||||
. htmlspecialchars($buffer) . "\n"
|
||||
. '</pre></code>';
|
||||
}
|
||||
|
||||
/* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMEType()
|
||||
{
|
||||
return "Text";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin`s MIME subtype
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getMIMESubtype()
|
||||
{
|
||||
return "Plain";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the transformation name of the specific plugin
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getName()
|
||||
{
|
||||
return "XML";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user