TYPO3 CMS  TYPO3_6-2
FrontendFormEngine.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Backend\Form;
3 
18 
25 
29  public function __construct() {
31  parent::__construct();
32  }
33 
40  public function wrapLabels($str) {
41  return '<font face="verdana" size="1" color="black">' . $str . '</font>';
42  }
43 
50  public function printPalette(array $paletteArray) {
51  $out = '';
52  $bgColor = ' bgcolor="#D6DAD0"';
53  foreach ($paletteArray as $content) {
54  $hRow[] = '<td' . $bgColor . '><font face="verdana" size="1">&nbsp;</font></td><td nowrap="nowrap"' . $bgColor . '><font color="#666666" face="verdana" size="1">' . $content['NAME'] . '</font></td>';
55  $iRow[] = '<td valign="top">' . '<img name="req_' . $content['TABLE'] . '_' . $content['ID'] . '_' . $content['FIELD'] . '" src="clear.gif" width="10" height="10" alt="" />' . '<img name="cm_' . $content['TABLE'] . '_' . $content['ID'] . '_' . $content['FIELD'] . '" src="clear.gif" width="7" height="10" alt="" />' . '</td><td nowrap="nowrap" valign="top">' . $content['ITEM'] . $content['HELP_ICON'] . '</td>';
56  }
57  $out = '<table border="0" cellpadding="0" cellspacing="0">
58  <tr><td><img src="clear.gif" width="' . (int)$this->paletteMargin . '" height="1" alt="" /></td>' . implode('', $hRow) . '</tr>
59  <tr><td></td>' . implode('', $iRow) . '</tr>
60  </table>';
61  return $out;
62  }
63 
70  public function setFancyDesign() {
71  $this->fieldTemplate = '
72  <tr>
73  <td nowrap="nowrap" bgcolor="#F6F2E6">###FIELD_HELP_ICON###<font face="verdana" size="1" color="black"><strong>###FIELD_NAME###</strong></font>###FIELD_HELP_TEXT###</td>
74  </tr>
75  <tr>
76  <td nowrap="nowrap" bgcolor="#ABBBB4"><img name="req_###FIELD_TABLE###_###FIELD_ID###_###FIELD_FIELD###" src="clear.gif" width="10" height="10" alt="" /><img name="cm_###FIELD_TABLE###_###FIELD_ID###_###FIELD_FIELD###" src="clear.gif" width="7" height="10" alt="" /><font face="verdana" size="1" color="black">###FIELD_ITEM###</font>###FIELD_PAL_LINK_ICON###</td>
77  </tr> ';
78  $this->totalWrap = '<table border="0" cellpadding="1" cellspacing="0" bgcolor="black"><tr><td><table border="0" cellpadding="2" cellspacing="0">|</table></td></tr></table>';
79  $this->palFieldTemplate = '
80  <tr>
81  <td nowrap="nowrap" bgcolor="#ABBBB4"><font face="verdana" size="1" color="black">###FIELD_PALETTE###</font></td>
82  </tr> ';
83  $this->palFieldTemplateHeader = '
84  <tr>
85  <td nowrap="nowrap" bgcolor="#F6F2E6"><font face="verdana" size="1" color="black"><strong>###FIELD_HEADER###</strong></font></td>
86  </tr> ';
87  }
88 
97  public function loadJavascriptLib($lib) {
99  $pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
100  $pageRenderer->addJsLibrary($lib, $this->prependBackPath($lib));
101  }
102 
112  public function addStyleSheet($key, $href, $title = '', $relation = 'stylesheet') {
114  $pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
115  $pageRenderer->addCssFile($this->prependBackPath($href), $relation, 'screen', $title);
116  }
117 
124  public function initializeTemplateContainer() {
125  $GLOBALS['TBE_TEMPLATE'] = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\FrontendDocumentTemplate');
126  $GLOBALS['TBE_TEMPLATE']->getPageRenderer()->addInlineSetting('', 'PATH_typo3', GeneralUtility::dirname(GeneralUtility::getIndpEnv('SCRIPT_NAME')) . '/' . TYPO3_mainDir);
127  $GLOBALS['SOBE'] = new \stdClass();
128  $GLOBALS['SOBE']->doc = $GLOBALS['TBE_TEMPLATE'];
129  }
130 
137  private function prependBackPath($url) {
138  if (strpos($url, '://') !== FALSE || $url[0] === '/') {
139  return $url;
140  } else {
141  return $this->backPath . $url;
142  }
143  }
144 
145 }
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
addStyleSheet($key, $href, $title='', $relation='stylesheet')