Zikula_Template_Plugins
[ class tree: Zikula_Template_Plugins ] [ index: Zikula_Template_Plugins ] [ all elements ]

Procedural File: function.pnicon.php

Source Location: /system/pnRender/plugins/function.pnicon.php



Page Details:

Zikula Application Framework



Tags:

version:  $Id: function.pnicon.php 24342 2008-06-06 12:03:14Z markwest $
copyright:  (c) 2004, Zikula Development Team
link:  http://www.zikula.org
filesource:  Source Code for this file
license:  GNU/GPL








smarty_function_pnicon [line 61]

string smarty_function_pnicon( array $params, object &$smarty)

Smarty function to provide easy access to an image

This function provides an easy way to include an image. The function will return the full source path to the image. It will as well provite the width and height attributes if none are set.

Available parameters:

  • type: The type of image to render (example: save)
  • size: The size of the image (extrasmall - small - large - default:extrasmall)
  • width, height: If set, they will be passed. If none is set, they are obtained from the 'size' parameter
  • alt: If not set, an empty string is being assigned
  • altml: If true then alt string is assumed to be a ML constant
  • title: If not set, an empty string is being assigned
  • titleml: If true then title string is assumed to be a ML constant
  • assign: If set, the results are assigned to the corresponding variable instead of printed out
  • optional If set then the plugin will not return an error if an image is not found
  • default If set then a default image is used should the requested image not be found (Note: full path required)
  • all remaining parameters are passed to the image tag
Example: <!--[pnicon type="save" size="extrasmall" altml="_SAVE"]--> Output: <img src="images/icons/extrasmall/save.png" alt="Save" />

Example: <!--[pnicon type="save" width="100" border="1" alt="foobar" ]--> Output: <img src="images/icons/extrasmall/save.png" width="100" border="1" alt="foobar" />

If the parameter assign is set, the results are assigned as an array. The components of this array are the same as the attributes of the img tag; additionally an entry 'imgtag' is set to the complete image tag.

Example: <!--[pnicon src="heading.gif" assign="myvar"]--> <!--[$myvar.src]--> <!--[$myvar.width]--> <!--[$myvar.imgtag]-->

Output: modules/Example/pnimages/eng/heading.gif 261 <img src="modules/Example/pnimages/eng/heading.gif" alt="" width="261" height="69" />




Tags:

return:  The img tag
author:  Joerg Napp / Simon Birtwistle
since:  05. Nov. 2003


Parameters

array   $params   All attributes passed to this function from the template
object   &$smarty   Reference to the Smarty object
[ Top ]



Documentation generated on Fri, 18 Jul 2008 21:46:03 +0200 by phpDocumentor 1.4.1