include/TemplateHandler/TemplateHandler.php

Show: inherited
Table of Contents

\TemplateHandler

Package: SugarCRM

TemplateHandler builds templates using SugarFields and a generic view.

Currently it handles EditViews and DetailViews. It creates a smarty template cached in cache/modules/moduleName/view

Api
 

Properties

Propertypublic  $cacheDir= ''
Details
Type
n/a
Propertypublic  $ss= ''
Details
Type
n/a
Propertypublic  $templateDir= ''modules/''
Default value'modules/'Details
Type
n/a

Methods

methodpublicTemplateHandler( ) : void

methodpublicbuildTemplate( \module $module, \view $view, \tpl $tpl, \ajaxSave $ajaxSave, \metaDataDefs $metaDataDefs ) : void

Builds a template This is a private function that should be called only from checkTemplate method

Parameters
Name Type Description
$module \module

string module name

$view \view

string view need (eg DetailView, EditView, etc)

$tpl \tpl

string generic tpl to use

$ajaxSave \ajaxSave

boolean parameter indicating whether or not this is coming from an Ajax call

$metaDataDefs \metaDataDefs

metadata definition as Array

methodpubliccheckTemplate( \module $module, \view $view,  $checkFormName = false,  $formName = '' ) : void

Checks if a template exists

Parameters
Name Type Description
$module \module

string module name

$view \view

string view need (eg DetailView, EditView, etc)

$checkFormName
$formName
methodpublicclearAll( ) : void

clearAll Helper function to remove all .tpl files in the cache directory

methodpublicclearCache( String $module, String $view = '' ) : void

clearCache Helper function to remove cached .tpl files for a particular module

Parameters
Name Type Description
$module String

The module directory to clear

$view String

Optional view value (DetailView, EditView, etc.)

methodpubliccreateDependencyJavascript( array $fieldDefs, array $viewDefs, string $view,  $module = null ) : void

createDependencyJavascript Builds the javascript required to execute calculated/dependent fields and module-view dependences.

Parameters
Name Type Description
$fieldDefs array

The fields defs for the current module.

$viewDefs array

the viewdefs for the current view.

$view string

the current view type.

$module
methodpubliccreateQuickSearchCode(  $defs, array $defs2, string $view = '', \strign $module = '' ) : string

createQuickSearchCode This function creates the $sqs_objects array that will be used by the quicksearch Javascript code. The $sqs_objects array is wrapped in a $json->encode call.

Parameters
Name Type Description
$defs
$defs2 array

The Meta-Data file definitions

$view string
$module \strign
Returns
Type Description
string
methodpublicdeleteTemplate( \module $module, \view $view ) : void

Deletes an existing template

Parameters
Name Type Description
$module \module

string module name

$view \view

string view need (eg DetailView, EditView, etc)

methodpublicdisplayTemplate( \module $module, \view $view, \tpl $tpl, \ajaxSave $ajaxSave = false, \metaData $metaDataDefs = null ) : void

Retreives and displays a template

Parameters
Name Type Description
$module \module

string module name

$view \view

string view need (eg DetailView, EditView, etc)

$tpl \tpl

string generic tpl to use

$ajaxSave \ajaxSave

boolean parameter indicating whether or not this is from an Ajax operation

$metaDataDefs \metaData

Optional metadata definition Array

methodprotectedgetQSDLookup( ) : array

Get lookup array for QuickSearchDefaults custom class

Returns
Type Description
array
Details
See
\QuickSearchDefaults::getQuickSearchDefaults()  
methodpublicloadSmarty( ) : void

Documentation was generated by DocBlox 0.18.1.