Documentation TYPO3 par Ameos

template Class Reference

Inheritance diagram for template:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 template ()
 wrapClickMenuOnIcon ($str, $table, $uid='', $listFr=1, $addParams='', $enDisItems='', $returnOnClick=FALSE)
 viewPageIcon ($id, $backPath, $addParams='hspace="3"')
 issueCommand ($params, $rUrl='')
 isCMlayers ()
 thisBlur ()
 helpStyle ()
 getHeader ($table, $row, $path, $noViewPageIcon=0, $tWrap=array('',''))
 getFileheader ($title, $path, $iconfile)
 makeShortcutIcon ($gvList, $setList, $modName, $motherModName="")
 makeShortcutUrl ($gvList, $setList)
 formWidth ($size=48, $textarea=0, $styleOverride='')
 formWidthText ($size=48, $styleOverride='', $wrap='')
 redirectUrls ($thisLocation='')
 formatTime ($tstamp, $type)
 parseTime ()
 startPage ($title)
 endPage ()
 header ($text)
 section ($label, $text, $nostrtoupper=FALSE, $sH=FALSE, $type=0, $allowHTMLinHeader=FALSE)
 divider ($dist)
 spacer ($dist)
 sectionHeader ($label, $sH=FALSE, $addAttrib='')
 sectionBegin ()
 sectionEnd ()
 middle ()
 endPageJS ()
 docBodyTagBegin ()
 docStyle ()
 insertStylesAndJS ($content)
 initCharset ()
 generator ()
 icons ($type, $styleAttribValue='')
 t3Button ($onClick, $label)
 dfw ($string)
 rfw ($string)
 wrapInCData ($string)
 wrapScriptTags ($string, $linebreak=TRUE)
 table ($arr, $layout='')
 menuTable ($arr1, $arr2=array(), $arr3=array())
 funcMenu ($content, $menu)
 clearCacheMenu ($id, $addSaveOptions=0)
 getContextMenuCode ()
 getTabMenu ($mainParams, $elementName, $currentValue, $menuItems, $script='', $addparams='')
 getTabMenuRaw ($menuItems)
 getDynTabMenu ($menuItems, $identString, $toggle=0, $foldout=FALSE, $newRowCharLimit=50, $noWrap=1, $fullWidth=FALSE, $defaultTabIndex=1)
 getDynTabMenuJScode ()
 getVersionSelector ($id, $noAction=FALSE)

Public Attributes

 $backPath = ''
 $form = ''
 $JScode = ''
 $JScodeArray = array()
 $postCode = ''
 $docType = ''
 $scriptID = ''
 $bodyTagId = ''
 $bodyTagAdditions = ''
 $inDocStyles = ''
 $inDocStylesArray = array()
 $form_rowsToStylewidth = 9.58
 $form_largeComp = 1.33
 $endJS = 1
 $bgColor = '#F7F3EF'
 $bgColor2 = '#9BA1A8'
 $bgColor3 = '#F6F2E6'
 $bgColor4 = '#D9D5C9'
 $bgColor5 = '#ABBBB4'
 $bgColor6 = '#E7DBA8'
 $hoverColor = '#254D7B'
 $styleSheetFile = 'stylesheet.css'
 $styleSheetFile2 = ''
 $styleSheetFile_post = ''
 $backGroundImage = ''
 $inDocStyles_TBEstyle = ''
 $parseTimeFlag = 0
 $charset = 'iso-8859-1'
 $sectionFlag = 0
 $divClass = ''
 $tableLayout
 $table_TR = '<tr>'
 $table_TABLE = '<table border="0" cellspacing="0" cellpadding="0" id="typo3-tmpltable">'

Detailed Description

Definition at line 161 of file template.php.


Constructor & Destructor Documentation

template::template  ) 
 

Constructor Imports relevant parts from global $TBE_STYLES (colorscheme)

Returns:
void

Definition at line 216 of file template.php.


Member Function Documentation

template::clearCacheMenu id,
addSaveOptions = 0
 

Creates a selector box with clear-cache items. Rather specialized functions - at least don't use it with $addSaveOptions unless you know what you do...

Parameters:
integer The page uid of the "current page" - the one that will be cleared as "clear cache for this page".
boolean If $addSaveOptions is set, then also the array of save-options for TCE_FORMS will appear.
Returns:
string <select> tag with content - a selector box for clearing the cache

Definition at line 1185 of file template.php.

template::dfw string  ) 
 

dimmed-fontwrap. Returns the string wrapped in a -tag defining the color to be gray/dimmed

Parameters:
string Input string
Returns:
string Output string

Definition at line 1017 of file template.php.

template::divider dist  ) 
 

Inserts a divider image Ends a section (if open) before inserting the image

Parameters:
integer The margin-top/-bottom of the
ruler.
Returns:
string HTML content

Definition at line 741 of file template.php.

template::docBodyTagBegin  ) 
 

Creates the bodyTag. You can add to the bodyTag by $this->bodyTagAdditions

Returns:
string HTML body tag

Definition at line 860 of file template.php.

template::docStyle  ) 
 

Outputting document style

Returns:
string HTML style section/link tags

Definition at line 870 of file template.php.

template::endPage  ) 
 

Returns page end; This includes finishing form, div, body and html tags.

Returns:
string The HTML end of a page
See also:
startPage()

Definition at line 667 of file template.php.

References t3lib_div::devLog(), and t3lib_BEfunc::getSetUpdateSignal().

template::endPageJS  ) 
 

If a form-tag is defined in ->form then and end-tag for that <form> element is outputted Further a JavaScript section is outputted which will update the top.busy session-expiry object (unless $this->endJS is set to false)

Returns:
string HTML content (<script> tag section)

Definition at line 843 of file template.php.

template::formatTime tstamp,
type
 

Returns a formatted string of $tstamp Uses $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] and $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] to format date and time

Parameters:
integer UNIX timestamp, seconds since 1970
integer How much data to show: $type = 1: hhmm, $type = 10: ddmmmyy
Returns:
string Formatted timestamp

Definition at line 546 of file template.php.

template::formWidth size = 48,
textarea = 0,
styleOverride = ''
 

Returns <input> attributes to set the width of an text-type input field. For client browsers with no CSS support the cols/size attribute is returned. For CSS compliant browsers (recommended) a ' style="width: ...px;"' is returned.

Parameters:
integer A relative number which multiplied with approx. 10 will lead to the width in pixels
boolean A flag you can set for textareas - DEPRECIATED, use ->formWidthText() for textareas!!!
string A string which will be returned as attribute-value for style="" instead of the calculated width (if CSS is enabled)
Returns:
string Tag attributes for an <input> tag (regarding width)
See also:
formWidthText()

Definition at line 480 of file template.php.

template::formWidthText size = 48,
styleOverride = '',
wrap = ''
 

This function is dedicated to textareas, which has the wrapping on/off option to observe. EXAMPLE: <textarea rows="10" wrap="off" '.$GLOBALS["TBE_TEMPLATE"]->formWidthText(48,"","off").'> or <textarea rows="10" wrap="virtual" '.$GLOBALS["TBE_TEMPLATE"]->formWidthText(48,"","virtual").'>

Parameters:
integer A relative number which multiplied with approx. 10 will lead to the width in pixels
string A string which will be returned as attribute-value for style="" instead of the calculated width (if CSS is enabled)
string Pass on the wrap-attribute value you use in your <textarea>! This will be used to make sure that some browsers will detect wrapping alright.
Returns:
string Tag attributes for an <input> tag (regarding width)
See also:
formWidth()

Definition at line 505 of file template.php.

template::funcMenu content,
menu
 

Returns a one-row/two-celled table with $content and $menu side by side. The table is a 100% width table and each cell is aligned left / right

Parameters:
string Content cell content (left)
string Menu cell content (right)
Returns:
string HTML output

Definition at line 1167 of file template.php.

template::generator  ) 
 

Returns generator meta tag

Returns:
string <meta> tag with name "GENERATOR"

Definition at line 944 of file template.php.

template::getContextMenuCode  ) 
 

Returns an array with parts (JavaScript, init-functions,

-layers) for use on pages which displays the clickmenu layers (context sensitive menus)

Returns:
array If values are present: [0] = A <script> section for the HTML page header, [1] = onmousemove/onload handler for HTML tag or alike, [2] = Two empty
layers for the context menu

Definition at line 1221 of file template.php.

template::getDynTabMenu menuItems,
identString,
toggle = 0,
foldout = FALSE,
newRowCharLimit = 50,
noWrap = 1,
fullWidth = FALSE,
defaultTabIndex = 1
 

Creates a DYNAMIC tab-menu where the tabs are switched between with DHTML. Should work in MSIE, Mozilla, Opera and Konqueror. On Konqueror I did find a serious problem: <textarea> fields loose their content when you switch tabs!

Parameters:
array Numeric array where each entry is an array in itself with associative keys: "label" contains the label for the TAB, "content" contains the HTML content that goes into the div-layer of the tabs content. "description" contains description text to be shown in the layer. "linkTitle" is short text for the title attribute of the tab-menu link (mouse-over text of tab). "stateIcon" indicates a standard status icon (see ->icon(), values: -1, 1, 2, 3). "icon" is an image tag placed before the text.
string Identification string. This should be unique for every instance of a dynamic menu!
integer If "1", then enabling one tab does not hide the others - they simply toggles each sheet on/off. This makes most sense together with the $foldout option. If "-1" then it acts normally where only one tab can be active at a time BUT you can click a tab and it will close so you have no active tabs.
boolean If set, the tabs are rendered as headers instead over each sheet. Effectively this means there is no tab menu, but rather a foldout/foldin menu. Make sure to set $toggle as well for this option.
integer Character limit for a new row.
boolean If set, tab table cells are not allowed to wrap their content
boolean If set, the tabs will span the full width of their position
integer Default tab to open (for toggle <=0). Value corresponds to integer-array index + 1 (index zero is "1", index "1" is 2 etc.). A value of zero (or something non-existing) will result in no default tab open.
Returns:
string JavaScript section for the HTML header.

Definition at line 1507 of file template.php.

template::getDynTabMenuJScode  ) 
 

Returns dynamic tab menu header JS code.

Returns:
string JavaScript section for the HTML header.

Definition at line 1630 of file template.php.

template::getFileheader title,
path,
iconfile
 

Like ->getHeader() but for files in the File>* main module/submodules Returns the file-icon with the path of the file set in the alt/title attribute. Shows the file-name after the icon.

Parameters:
string Title string, expected to be the filepath
string Alt text
string The icon file (relative to TYPO3 dir)
Returns:
string HTML content

Definition at line 411 of file template.php.

References t3lib_div::fixed_lgd_cs(), and t3lib_div::split_fileref().

template::getHeader table,
row,
path,
noViewPageIcon = 0,
tWrap = array('','')
 

Makes the header (icon+title) for a page (or other record). Used in most modules under Web>* $table and $row must be a tablename/record from that table $path will be shown as alt-text for the icon. The title will be truncated to 45 chars.

Parameters:
string Table name
array Record row
string Alt text
boolean Set $noViewPageIcon true if you don't want a magnifier-icon for viewing the page in the frontend
array $tWrap is an array with indexes 0 and 1 each representing HTML-tags (start/end) which will wrap the title
Returns:
string HTML content

Definition at line 385 of file template.php.

References t3lib_div::fixed_lgd_cs(), and t3lib_iconWorks::getIconImage().

template::getTabMenu mainParams,
elementName,
currentValue,
menuItems,
script = '',
addparams = ''
 

Creates a tab menu from an array definition

Returns a tab menu for a module Requires the JS function jumpToUrl() to be available

Parameters:
mixed $id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
string $elementName it the form elements name, probably something like "SET[...]"
string $currentValue is the value to be selected currently.
array $menuItems is an array with the menu items for the selector box
string $script is the script to send the &id to, if empty it's automatically found
string $addParams is additional parameters to pass to the script.
Returns:
string HTML code for tab menu
Author:
René Fritz <r.fritz@colorcube.de>

Definition at line 1408 of file template.php.

References t3lib_div::deHSCentities(), and t3lib_div::implodeArrayForUrl().

template::getTabMenuRaw menuItems  ) 
 

Creates the HTML content for the tab menu

Parameters:
array Menu items for tabs
Returns:
string Table HTML private

Definition at line 1438 of file template.php.

template::getVersionSelector id,
noAction = FALSE
 

Creates the version selector for the page id inputted. Requires the core version management extension, "version" to be loaded.

Parameters:
integer Page id to create selector for.
boolean If set, there will be no button for swapping page.
Returns:
void

Definition at line 1687 of file template.php.

References t3lib_BEfunc::getRecord(), t3lib_extMgm::isLoaded(), and t3lib_BEfunc::selectVersionsOfRecord().

template::header text  ) 
 

Returns the header-bar in the top of most backend modules Closes section if open.

Parameters:
string The text string for the header
Returns:
string HTML content

Definition at line 696 of file template.php.

template::helpStyle  ) 
 

Returns ' style='cursor:help;'' if the client supports CSS styles Use for -links to help texts

Returns:
string

Definition at line 368 of file template.php.

template::icons type,
styleAttribValue = ''
 

Returns an image-tag with an 18x16 icon of the following types:

$type: -1: OK icon (Check-mark) 1: Notice (Speach-bubble) 2: Warning (Yellow triangle) 3: Fatal error (Red stop sign)

Parameters:
integer See description
string Value for style attribute
Returns:
string HTML image tag (if applicable)

Definition at line 977 of file template.php.

template::initCharset  ) 
 

Initialize the charset. Sets the internal $this->charset variable to the charset defined in $GLOBALS["LANG"] (or the default as set in this class) Returns the meta-tag for the document header

Returns:
string <meta> tag with charset from $this->charset or $GLOBALS['LANG']->charSet

Definition at line 932 of file template.php.

template::insertStylesAndJS content  ) 
 

Insert post rendering document style into already rendered content This is needed for extobjbase

Parameters:
string style-content to insert.
Returns:
string content with inserted styles

Definition at line 912 of file template.php.

template::isCMlayers  ) 
 

Returns true if click-menu layers can be displayed for the current user/browser Use this to test if click-menus (context sensitive menus) can and should be displayed in the backend.

Returns:
boolean

Definition at line 348 of file template.php.

template::issueCommand params,
rUrl = ''
 

Returns a URL with a command to TYPO3 Core Engine (tce_db.php) See description of the API elsewhere.

Parameters:
string $params is a set of GET params to send to tce_db.php. Example: "&cmd[tt_content][123][move]=456" or "&data[tt_content][123][hidden]=1&data[tt_content][123][title]=Hello%20World"
string Redirect URL if any other that t3lib_div::getIndpEnv('REQUEST_URI') is wished
Returns:
string URL to tce_db.php + parameters (backpath is taken from $this->backPath)
See also:
t3lib_BEfunc::editOnClick()

Definition at line 333 of file template.php.

References t3lib_div::getIndpEnv().

template::makeShortcutIcon gvList,
setList,
modName,
motherModName = ""
 

Returns a linked shortcut-icon which will call the shortcut frame and set a shortcut there back to the calling page/module

Parameters:
string Is the list of GET variables to store (if any)
string Is the list of SET[] variables to store (if any) - SET[] variables a stored in $GLOBALS["SOBE"]->MOD_SETTINGS for backend modules
string Module name string
string Is used to enter the "parent module name" if the module is a submodule under eg. Web>* or File>*. You can also set this value to "1" in which case the currentLoadedModule is sent to the shortcut script (so - not a fixed value!) - that is used in file_edit.php and wizard_rte.php scripts where those scripts are really running as a part of another module.
Returns:
string HTML content

Definition at line 426 of file template.php.

References t3lib_div::getIndpEnv().

template::makeShortcutUrl gvList,
setList
 

MAKE url for storing Internal func

Parameters:
string Is the list of GET variables to store (if any)
string Is the list of SET[] variables to store (if any) - SET[] variables a stored in $GLOBALS["SOBE"]->MOD_SETTINGS for backend modules
Returns:
string private
See also:
makeShortcutIcon()

Definition at line 459 of file template.php.

References t3lib_div::_GET(), t3lib_div::compileSelectedGetVarsFromArray(), and t3lib_div::implodeArrayForUrl().

template::menuTable arr1,
arr2 = array(),
arr3 = array()
 

Constructs a table with content from the $arr1, $arr2 and $arr3. Used in eg. ext/belog/mod/index.php - refer to that for examples

Parameters:
array Menu elements on first level
array Secondary items
array Third-level items
Returns:
string HTML content,
..

Definition at line 1134 of file template.php.

template::middle  ) 
 

Originally it printed a kind of divider. Depreciated. Just remove function calls to it or call the divider() function instead.

Returns:
void

Definition at line 834 of file template.php.

template::parseTime  ) 
 

Returns script parsetime IF ->parseTimeFlag is set and user is "admin" Automatically outputted in page end

Returns:
string

Definition at line 559 of file template.php.

References t3lib_div::getIndpEnv().

template::redirectUrls thisLocation = ''  ) 
 

Returns JavaScript variables setting the returnUrl and thisScript location for use by JavaScript on the page. Used in fx. db_list.php (Web>List)

Parameters:
string URL to "this location" / current script
Returns:
string
See also:
typo3/db_list.php

Definition at line 522 of file template.php.

References t3lib_div::_GP(), and t3lib_div::linkThisScript().

template::rfw string  ) 
 

red-fontwrap. Returns the string wrapped in a -tag defining the color to be red

Parameters:
string Input string
Returns:
string Output string

Definition at line 1027 of file template.php.

template::section label,
text,
nostrtoupper = FALSE,
sH = FALSE,
type = 0,
allowHTMLinHeader = FALSE
 

Begins an output section and sets header and content

Parameters:
string The header
string The HTML-content
boolean A flag that will prevent the header from being converted to uppercase
boolean Defines the type of header (if set, "<h3>" rather than the default "h4")
integer The number of an icon to show with the header (see the icon-function). -1,1,2,3
boolean If set, HTML tags are allowed in $label (otherwise this value is by default htmlspecialchars()'ed)
Returns:
string HTML content
See also:
icons(), sectionHeader()

Definition at line 717 of file template.php.

template::sectionBegin  ) 
 

Begins an output section. Returns the

-begin tag AND sets the ->sectionFlag true (if the ->sectionFlag is not already set!) You can call this function even if a section is already begun since the function will only return something if the sectionFlag is not already set!

Returns:
string HTML content

Definition at line 793 of file template.php.

template::sectionEnd  ) 
 

Ends and output section Returns the -end tag AND clears the ->sectionFlag (but does so only IF the sectionFlag is set - that is a section is 'open') See sectionBegin() also.

Returns:
string HTML content

Definition at line 814 of file template.php.

template::sectionHeader label,
sH = FALSE,
addAttrib = ''
 

Make a section header. Begins a section if not already open.

Parameters:
string The label between the<h3> or<h4> tags. (Allows HTML)
boolean If set,

is used, otherwise<h4> string Additional attributes to h-tag, eg. ' class=""' string HTML content

Definition at line 776 of file template.php.

template::spacer dist  ) 
 

Returns a blank

-section with a height

Parameters:
integer Padding-top for the div-section (should be margin-top but konquorer (3.1) don't like it :-(
Returns:
string HTML content

Definition at line 757 of file template.php.

template::startPage title  ) 
 

Returns page start This includes the proper header with charset, title, meta tag and beginning body-tag.

Parameters:
string HTML Page title for the header
Returns:
string Returns the whole header section of a HTML-document based on settings in internal variables (like styles, javascript code, charset, generator and docType)
See also:
endPage()

Definition at line 592 of file template.php.

template::t3Button onClick,
label
 

Returns an <input> button with the $onClick action and $label

Parameters:
string The value of the onclick attribute of the input tag (submit type)
string The label for the button (which will be htmlspecialchar'ed)
Returns:
string A <input> tag of the type "submit"

Definition at line 1006 of file template.php.

template::table arr,
layout = ''
 

Returns a table based on the input $arr

Parameters:
array Multidim array with first levels = rows, second levels = cells
array If set, then this provides an alternative layout array instead of $this->tableLayout
Returns:
string The HTML table.

Definition at line 1092 of file template.php.

template::thisBlur  ) 
 

Returns 'this.blur();' if the client supports CSS styles Use this in links to remove the underlining after being clicked

Returns:
string

Definition at line 358 of file template.php.

template::viewPageIcon id,
backPath,
addParams = 'hspace="3"'
 

Makes link to page $id in frontend (view page) Returns an magnifier-glass icon which links to the frontend index.php document for viewing the page with id $id $id must be a page-uid If the BE_USER has access to Web>List then a link to that module is shown as well (with return-url)

Parameters:
integer The page id
string The current "BACK_PATH" (the back relative to the typo3/ directory)
string Additional parameters for the image tag(s)
Returns:
string HTML string with linked icon(s)

Definition at line 307 of file template.php.

References t3lib_div::getIndpEnv().

template::wrapClickMenuOnIcon str,
table,
uid = '',
listFr = 1,
addParams = '',
enDisItems = '',
returnOnClick = FALSE
 

Makes click menu link (context sensitive menu) Returns $str (possibly an <|img> tag/icon) wrapped in a link which will activate the context sensitive menu for the record ($table/$uid) or file ($table = file) The link will load the top frame with the parameter "&item" which is the table,uid and listFr arguments imploded by "|": rawurlencode($table.'|'.$uid.'|'.$listFr)

Parameters:
string String to be wrapped in link, typ. image tag.
string Table name/File path. If the icon is for a database record, enter the tablename from $TCA. If a file then enter the absolute filepath
integer If icon is for database record this is the UID for the record from $table
boolean Tells the top frame script that the link is coming from a "list" frame which means a frame from within the backend content frame.
string Additional GET parameters for the link to alt_clickmenu.php
string Enable / Disable click menu items. Example: "+new,view" will display ONLY these two items (and any spacers in between), "new,view" will display all BUT these two items.
boolean If set, will return only the onclick JavaScript, not the whole link.
Returns:
string The link-wrapped input string.

Definition at line 290 of file template.php.

References t3lib_div::shortMD5().

template::wrapInCData string  ) 
 

Returns string wrapped in CDATA "tags" for XML / XHTML (wrap content of <script> and <style> sections in those!)

Parameters:
string Input string
Returns:
string Output string

Definition at line 1037 of file template.php.

template::wrapScriptTags string,
linebreak = TRUE
 

Wraps the input string in script tags. Automatic re-identing of the JS code is done by using the first line as ident reference. This is nice for identing JS code with PHP code on the same level.

Parameters:
string Input string
boolean Wrap script element in linebreaks? Default is TRUE.
Returns:
string Output string

Definition at line 1054 of file template.php.


Member Data Documentation

template::$tableLayout
 

Initial value:

 Array (
                'defRow' => Array (
                        'defCol' => Array('<td valign="top">','</td>')
                )
        )

Definition at line 1076 of file template.php.


The documentation for this class was generated from the following file:


Généré par Les experts TYPO3 avec  doxygen 1.4.6