Contains class with layout/output function for TYPO3 Backend Scripts
$Id: typo3_template.html,v 1.1 2003/12/28 22:13:46 typo3 Exp $
Revised for TYPO3 3.6 2/2003 by Kasper Skaarhoj
XHTML-trans compliant
Files: 1
Total filesizes: 55 Kbytes
Functions and classes: 50
Contains class with layout/output function for TYPO3 Backend Scripts
$Id: typo3_template.html,v 1.1 2003/12/28 22:13:46 typo3 Exp $
Revised for TYPO3 3.6 2/2003 by Kasper Skaarhoj
XHTML-trans compliant
@package: TYPO3
@subpackage: core
@todo: Update the HTML code to use the stylesheet.css instead.
Contains class with layout/output function for TYPO3 Backend Scripts
$Id: typo3_template.html,v 1.1 2003/12/28 22:13:46 typo3 Exp $
Revised for TYPO3 3.6 2/2003 by Kasper Skaarhoj
XHTML-trans compliant
Filesize: | 55 K |
Func/Classes: | 50 |
Tags: | @author Kasper Skaarhoj <kasper@typo3.com> |
Depreciated fontwrap function. Is just transparent now.
$str | string | Input string |
Returns: | string | Output string (in the old days this was wrapped in <font> tags) |
@depreciated |
TYPO3 Backend Template Class
This class contains functions for starting and ending the HTML of backend modules
It also contains methods for outputting sections of content.
Further there are functions for making icons, links, setting form-field widths etc.
Color scheme and stylesheet definitions are also available here.
Finally this file includes the language class for TYPO3's backend.
After this file $LANG and $TBE_TEMPLATE are global variables / instances of their respective classes.
This file is typically included right after the init.php file,
if language and layout is needed.
Please refer to Inside TYPO3 for a discussion of how to use this API.
Returns: | [type] | ... |
@author Kasper Skaarhoj <kasper@typo3.com> | ||
@package TYPO3 | ||
@subpackage core |
Constructor
Imports relevant parts from global $TBE_STYLES (colorscheme)
Returns: | void |
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)
$str | string | String to be wrapped in link, typ. image tag. |
$table | 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 |
$uid='' | integer | If icon is for database record this is the UID for the record from $table |
$listFr=1 | 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. |
Returns: | string | The link-wrapped input string. |
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)
$id | integer | The page id |
$backPath | string | The current "BACK_PATH" (the back relative to the typo3/ directory) |
$addParams='hspace="3"' | string | Additional parameters for the image tag(s) |
Returns: | string | HTML string with linked icon(s) |
Returns a URL with a command to TYPO3 Core Engine (tce_db.php)
See description of the API elsewhere.
$params | 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" |
$rUrl='' | 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) |
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 |
Returns 'this.blur();' if the client supports CSS styles
Use this in links to remove the underlining after being clicked
Returns: | string |
Returns ' style='cursor:help;'' if the client supports CSS styles
Use for <a>-links to help texts
Returns: | string |
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.
$table | string | Table name |
$row | array | Record row |
$path | string | Alt text |
$noViewPageIcon=0 | boolean | Set $noViewPageIcon true if you don't want a magnifier-icon for viewing the page in the frontend |
$tWrap=array('','') | 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 |
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.
$title | string | Title string, expected to be the filepath |
$path | string | Alt text |
$iconfile | string | The icon file (relative to TYPO3 dir) |
Returns: | string | HTML content |
Returns a linked shortcut-icon which will call the shortcut frame and set a shortcut there back to the calling page/module
$gvList | string | Is the list of GET variables to store (if any) |
$setList | string | Is the list of SET[] variables to store (if any) - SET[] variables a stored in $GLOBALS["SOBE"]->MOD_SETTINGS for backend modules |
$modName | string | Module name string |
$motherModName="" | 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 |
MAKE url for storing
Internal func
$gvList | string | Is the list of GET variables to store (if any) |
$setList | 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 | |
@see makeShortcutIcon() |
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.
$size=48 | integer | A relative number which multiplied with approx. 10 will lead to the width in pixels |
$textarea=0 | boolean | A flag you can set for textareas - DEPRECIATED, use ->formWidthText() for textareas!!! |
$styleOverride='' | 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 formWidthText() |
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").'>
$size=48 | integer | A relative number which multiplied with approx. 10 will lead to the width in pixels |
$styleOverride='' | string | A string which will be returned as attribute-value for style="" instead of the calculated width (if CSS is enabled) |
$wrap='' | 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 formWidth() |
Returns JavaScript variables setting the returnUrl and thisScript location for use by JavaScript on the page.
Used in fx. db_list.php (Web>List)
$thisLocation='' | string | URL to "this location" / current script |
Returns: | string | |
@see typo3/db_list.php |
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
$tstamp | integer | UNIX timestamp, seconds since 1970 |
$type | integer | How much data to show: $type = 1: hhmm, $type = 10: ddmmmyy |
Returns: | string | Formatted timestamp |
Returns script parsetime IF ->parseTimeFlag is set and user is "admin"
Automatically outputted in page end
Returns: | string |
Returns page start
This includes the proper header with charset, title, meta tag and beginning body-tag.
$title | 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 endPage() |
Returns page end; This includes finishing form, div, body and html tags.
Returns: | string | The HTML end of a page |
@see startPage() |
Returns the header-bar in the top of most backend modules
Closes section if open.
$text | string | The text string for the header |
Returns: | string | HTML content |
Begins an output section and sets header and content
$label | string | The header |
$text | string | The HTML-content |
$nostrtoupper=FALSE | boolean | A flag that will prevent the header from being converted to uppercase |
$sH=FALSE | boolean | Defines the type of header (if set, "<h3>" rather than the default "h4") |
$type=0 | integer | The number of an icon to show with the header (see the icon-function). -1,1,2,3 |
$allowHTMLinHeader=FALSE | boolean | If set, HTML tags are allowed in $label (otherwise this value is by default htmlspecialchars()'ed) |
Returns: | string | HTML content |
@see icons(), sectionHeader() |
Inserts a divider image
Ends a section (if open) before inserting the image
$dist | integer | The margin-top/-bottom of the <hr> ruler. |
Returns: | string | HTML content |
Returns a blank <div>-section with a height
$dist | integer | Padding-top for the div-section (should be margin-top but konquorer (3.1) don't like it :-( |
Returns: | string | HTML content |
Make a section header.
Begins a section if not already open.
$label | string | The label between the <h3> or <h4> tags. (Allows HTML) |
$sH=FALSE | boolean | If set, <h3> is used, otherwise <h4> |
$addAttrib='' | string | Additional attributes to h-tag, eg. ' class=""' |
Returns: | string | HTML content |
Begins an output section.
Returns the <div>-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 |
Ends and output section
Returns the </div>-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 |
Originally it printed a kind of divider.
Depreciated. Just remove function calls to it or call the divider() function instead.
Returns: | void | |
@internal | ||
@depreciated |
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) |
Creates the bodyTag.
You can add to the bodyTag by $this->bodyTagAdditions
Returns: | string | HTML body tag |
Insert post rendering document style into already rendered content
$content | string | style-content to insert. |
Returns: | string | content with inserted styles |
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 |
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)
$type | integer | See description |
Returns: | string | HTML image tag (if applicable) |
Returns an <input> button with the $onClick action and $label
$onClick | string | The value of the onclick attribute of the input tag (submit type) |
$label | string | The label for the button (which will be htmlspecialchar'ed) |
Returns: | string | A <input> tag of the type "submit" |
dimmed-fontwrap. Returns the string wrapped in a <span>-tag defining the color to be gray/dimmed
$string | string | Input string |
Returns: | string | Output string |
red-fontwrap. Returns the string wrapped in a <span>-tag defining the color to be red
$string | string | Input string |
Returns: | string | Output string |
Returns string wrapped in CDATA "tags" for XML / XHTML (wrap content of <script> and <style> sections in those!)
$string | string | Input string |
Returns: | string | Output string |
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.
$string | string | Input string |
$linebreak=TRUE | boolean | Wrap script element in linebreaks? Default is TRUE. |
Returns: | string | Output string |
Returns a table based on the input $arr
$arr | array | Multidim array with first levels = rows, second levels = cells |
Returns: | string | The HTML table. |
@internal |
Constructs a table with content from the $arr1, $arr2 and $arr3.
Used in eg. ext/belog/mod/index.php - refer to that for examples
$arr1 | array | Menu elements on first level |
$arr2=array() | array | Secondary items |
$arr3=array() | array | Third-level items |
Returns: | string | HTML content, <table>...</table> |
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
$content | string | Content cell content (left) |
$menu | string | Menu cell content (right) |
Returns: | string | HTML output |
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...
$id | integer | The page uid of the "current page" - the one that will be cleared as "clear cache for this page". |
$addSaveOptions=0 | 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 |
Returns an array with parts (JavaScript, init-functions, <div>-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 <div> layers for the context menu |
creates a tab menu from an array definition
Returns a tab menu for a module
Requires the JS function jumpToUrl() to be available
$id | string | $id is the "&id=" parameter value to be sent to the module |
$elementName | string | $elementName it the form elements name, probably something like "SET[...]" |
$currentValue | string | $currentValue is the value to be selected currently. |
$menuItems | array | $menuItems is an array with the menu items for the selector box |
$script='' | string | $script is the script to send the &id to, if empty it's automatically found |
$addparams='' | string | $addParams is additional parameters to pass to the script. |
Returns: | string | HTML code for tab menu |
@todo Update the HTML code to use the stylesheet.css instead. | ||
@author Ren� Fritz <r.fritz@colorcube.de> |
Extension
class for "template" - used for backend pages which are wide. Typically modules
taking up all the space in the "content" frame of the backend
The class were more significant in the past than today.
Returns: | [type] | ... |
Extension class for "template" - used for backend pages without the "document" background image
The class were more significant in the past than today.
Returns: | [type] | ... |
Extension
class for "template" - used for backend pages which were narrow (like the
Web>List modules list frame. Or the "Show details" pop up box)
The class were more significant in the past than today.
Returns: | [type] | ... |
Extension
class for "template" - used for backend pages which were medium wide. Typically
submodules to Web or File which were presented in the list-frame when the
content frame were divided into a navigation and list frame.
The class were more significant in the past than today. But probably you should use this one for most modules you make.
Returns: | [type] | ... |