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

Procedural File: function.smartlink.php

Source Location: /themes/smartyplugins/function.smartlink.php



Page Details:

Smarty plugin



Tags:

author:  xing <xing$synapse.plus.com>
link:  function.smartlink
filesource:  Source Code for this file








smarty_function_smartlink [line 49]

void smarty_function_smartlink( $params, &$gBitSmarty)

Smarty {smartlink} function plugin

Type: function
Name: smartlink
Input:

  • ititle (required) words that are displayed
  • iatitle (optional) alternative text for the link title (rollover, etc.)
  • ianchor (optional) set the anchor where the link should point to
  • isort (optional) name of the sort column without the orientation (e.g.: title)
  • isort_mode(optional) this can be used to manually pass the sort mode to smartlink
    overrides the value given in $_REQUEST['sort_mode'], which is the default
  • iorder (optional) if set to asc or desc, it sets the default sorting order of this particular column
    asc is default
  • idefault (optional) if set, it will highlight this link if no $isort_mode is given
    this should only be set once per sorting group since it represents the default sorting column
  • itra (optional) if present then don't translate
  • itype (optional) can be set to
    url --> outputs only url
    li --> outputs link as &lt;li&gt;&lt;a ... &gt;&lt;/li&gt;
  • ionclick (optional) pass in any actions that should occur onclick
  • ibiticon (optional) if you want to display an icon instead of text use ibiticon
    format is: '&lt;ipackage&gt;/&lt;iname&gt;'
    e.g.: 'liberty/edit'
  • iforce (optional) pass iforce parameter through to biticon
  • iurl (optional) pass in a full url
  • ifile (optional) set the file where the link should point (default is the current file)
  • ipackage (optional) set the package the link should point to (default is the current package)
  • icontrol (optional) the hash sent out by postGetList()
  • * (optional) anything else that gets added to the pile of items is appended using &amp;$key=$val
  • ihash (optional) you can pass in all the above as an array called ihash or secondary * items common to all links
Output: any kind of link. especially useful when it comes to links used to sort a table, due to the simplified syntax and loss of cumbersome if clauses also useful if the you want to display an icon as link since smartlink takes biticon parameters
Example - {smartlink ititle="Page Name" isort="title"}
  • {smartlink ititle="Page Name" isort="title" iorder="desc" idefault=1}
setting iorder and idefault here, makes this link sort in a descending order by default (iorder)
and it is highlighted when $isort_mode ( or $_REQUEST['sort_mode'] ) is not set (idefault)
Note Be careful if ititle is generated dynamically since it is passed through tra() by default, use itra to override




Parameters

   $params  
   &$gBitSmarty  
[ Top ]



Documentation generated on Wed, 29 Jul 2015 13:56:40 +0000 by phpDocumentor 1.5.0-lsces