Client

# Class: Smarty_Cartoclient Source Location: /client/Smarty_Cartoclient.php
### Class Overview
    Smarty
       |
       --Smarty_Cartoclient
Specific Smarty engine for Cartoclient | ### Variables $cartoclient $headerSent $projectHandler | ### Methods __construct assignCommonVariables smartyResource smartyTranslate smartyTranslateModifier strarg _get_compile_path
### Child classes: Smarty_Plugin Specific Smarty engine for plugins
### Class Details [line 33] Specific Smarty engine for Cartoclient [ Top ] ### Class Variables #### $cartoclient = [line 38] #### Tags:
access: | private
Type: | Cartoclient
[ Top ] #### $headerSent = false [line 48] #### Tags:
var: | True if the headers were already sent to the client.
static: |
access: | private
Type: | boolean
[ Top ] #### $projectHandler = [line 43] #### Tags:
access: | private
Type: | ClientProjectHandler
[ Top ] ### Class Methods ### constructor __construct [line 57]
`Smarty_Cartoclient __construct( Cartoclient $cartoclient)`
Constructor Initializes dirs and cache, and registers block functions (resources and i18n). #### Tags:
access: | public
Overridden in child classes as: Smarty_Plugin::__construct() Constructor #### Parameters:
Cartoclient | $cartoclient | the current cartoclient
[ Top ] ### method assignCommonVariables [line 98]
`void assignCommonVariables( Cartoclient $cartoclient)`
Fills some smarty variables common to all template objects #### Tags:
access: | private
#### Parameters:
Cartoclient | $cartoclient | cartoclient object used to fill common smarty variables.
[ Top ] ### method smartyResource [line 149]
`string smartyResource( array $params, string $resource, Smarty &$smarty)`
Smarty block function for resources Transforms {r type=css plugin=myplugin}toto.css{/r} to myplugin/css/toto.css or currentproject/myplugin/css/toto.css . #### Tags:
return: | resource path
access: | public
#### Parameters:
array | $params | block parameters
string | $resource | block text
Smarty | &$smarty | Smarty engine
[ Top ] ### method smartyTranslate [line 217]
`string smartyTranslate( array $params, string $text, Smarty &$smarty)`
Smarty block function, provides gettext support for Smarty Original code was written by Sagi Bashari <sagi@boom.org.il> The block content is the text that should be translated. Any parameter that is sent to the function will be represented as %n in the translation text, where n is 1 for the first parameter. The following parameters are reserved: 'html' for HTML escaping, this is the default. 'js' for javascript escaping. plural - The plural version of the text (2nd parameter of ngettext()) count - The item count for plural mode (3rd parameter of ngettext()) #### Tags:
return: | translated text
access: | public
#### Parameters:
array | $params | parameters
string | $text | text to translate
Smarty | &$smarty | Smarty engine
[ Top ] ### method smartyTranslateModifier [line 265]
`string smartyTranslateModifier( string $text)`
Smarty modifier function, provides gettext support for Smarty #### Tags:
return: | translated text
access: | public
#### Parameters:
string | $text | text to translate
[ Top ] ### method strarg [line 178]
`string strarg( string $str, mixed 1)`
Replace arguments in a string with their values Arguments are represented by % followed by their number. Original code was written by Sagi Bashari <sagi@boom.org.il> #### Tags:
return: | Modified string
access: | private
#### Parameters:
mixed | 1 | Arguments, can be passed in an array or through single variables.
string | $str | Source string
[ Top ] ### method _get_compile_path [line 118]
`string _get_compile_path( string $resource_name)`
Overrides Smarty's resource compile path Updates template dir to point to the right project and insert a compile id to have one cache file per project and per template. #### Tags:
return: | path to resource
access: | public
#### Parameters:
string | $resource_name | resource name
[ Top ] Documentation generated on Fri, 21 Sep 2007 13:31:08 +0200 by phpDocumentor 1.3.0RC3