Source for file data.img.php
Documentation is available at data.img.php
* @subpackage plugins_data
define( 'PLUGIN_GUID_DATAIMG', 'dataimg' );
'requires_pair' => FALSE,
'load_function' => 'data_img',
'help_page' => 'DataPluginImg',
'description' => tra( "Allows you to insert an image into your page with little effort and a multitude of styling options." ),
'help_function' => 'data_img_help',
'syntax' => "{img src=http://www.google.at/logos/olympics06_ski_jump.gif}",
'booticon' => '{booticon iname="icon-picture" iexplain="Web Image"}',
'taginsert' => '{img src= width= height= align= description= link=}'
'<table class="data help">'
. '<th>'. tra( "Key" ). '</th>'
. '<th>'. tra( "Type" ). '</th>'
. '<th>'. tra( "Comments" ). '</th>'
. '<td>'. tra( "string"). '<br />'. tra("(required)"). '</td>'
. '<td>'. tra( "Specify where the path to the image."). '</td>'
. '<td>'. tra( "string"). '<br />'. tra("(optional)"). '</td>'
. '<td>'. tra( "If you want your image to link to a web address, use link='link/to/page'." ). '</td>'
. '<td>'. tra( "styling" ). '</td>'
. '<td>'. tra( "string"). '<br />'. tra("(optional)"). '</td>'
. '<td>'. tra( "Multiple styling options available: padding, margin, background, border, text-align, color, font, font-size, font-weight, font-family, align. Please view CSS guidelines on what values these settings take."). '</td>'
. tra( "Example: "). "{img src=http://www.google.at/logos/olympics06_ski_jump.gif float=right border=\"3px solid blue\"}";
foreach( $pParams as $key => $value ) {
// rename a couple of parameters
$cssStyle .= $key. ':'. $value. ';';
$cssStyle .= $key. ':'. $value. 'px;';
// remove values from the hash that they don't get used in the div as well
// check if we have a source to load an image from
if( !empty( $pParams['src'] ) ) {
$alt = ( !empty( $wrapper['description'] ) ? $wrapper['description'] : tra( 'Image' ) );
' src="' . $pParams['src']. '"'.
' style="'. $cssStyle. '"'.
' class="'. $cssClass. '"'.
// if this image is linking to something, wrap the image with the <a>
if( !empty( $wrapper['link'] ) ) {
$ret = '<a href="'. trim( $wrapper['link'] ). '">'. $ret. '</a>';
// finally, wrap the image
if( !empty( $wrapper['style'] ) || !empty( $class ) || !empty( $wrapper['description'] ) ) {
$ret = '<'. $wrapper['wrapper']. ' class="'. ( !empty( $wrapper['class'] ) ? $wrapper['class'] : "img-plugin" ). '" style="'. $wrapper['style']. '">'. $ret. ( !empty( $wrapper['description'] ) ? '<br />'. $wrapper['description'] : '' ). '</'. $wrapper['wrapper']. '>';
$ret = '<span class="warning">'. tra( 'When using <strong>{img}</strong> the <strong>src</strong> parameter is required.' ). '</span>';
|