Project

General

Profile

Feature #19809 » bug_10118_v3.diff

Administrator Admin, 2010-01-16 18:52

View differences:

typo3/sysext/cms/tslib/class.tslib_pibase.php (working copy)
}
/**
* Wraps the input string in a <div> tag with the class attribute set to the prefixId.
* All content returned from your plugins should be returned through this function so all content from your plugin is encapsulated in a <div>-tag nicely identifying the content of your plugin.
* Wraps the input string, ...
* - using pi_wrapInBaseClass (wrap/stdWrap) in the TypoScript setup of the plugin,
* - otherwise using a <div> tag with the class attribute set to the prefixId (which was standard for TYPO3 <= 4.3)
*
* @param string HTML content to wrap in the div-tags with the "main class" of the plugin
* The wrap can be disabled for all plugins using:
* # config.disable_pi_wrapInBaseClass = 1
* The wrap can be disabled for all plugins with empty content using:
* # config.disable_pi_wrapInBaseClass = ifEmpty
*
* All content returned from your plugins should be returned through this function
* so all content from your plugin is encapsulated in a <div>-tag
* nicely identifying the content of your plugin.
*
* @param string HTML content to wrap
* @return string HTML content wrapped, ready to return to the parent object.
*/
function pi_wrapInBaseClass($str) {
$content = '<div class="'.str_replace('_','-',$this->prefixId).'">
'.$str.'
</div>
';
function pi_wrapInBaseClass($str) {
if ($GLOBALS['TSFE']->config['config']['disable_pi_wrapInBaseClass'] === '1' || (!$str && $GLOBALS['TSFE']->config['config']['disable_pi_wrapInBaseClass'] === 'ifEmpty')) {
$content = $str;
} elseif ($this->conf['pi_wrapInBaseClass'] || $this->conf['pi_wrapInBaseClass.']) {
$content = $this->cObj->wrap($str, $this->cObj->stdWrap($this->conf['pi_wrapInBaseClass'], $this->conf['pi_wrapInBaseClass.']));
} else {
$content = '<div class="' . str_replace('_', '-', $this->prefixId) . '">
' . $str . chr(10) . '</div>';
}
if(!$GLOBALS['TSFE']->config['config']['disablePrefixComment']) {
if (!$GLOBALS['TSFE']->config['config']['disablePrefixComment']) {
$content = '
<!--
BEGIN: Content of extension "'.$this->extKey.'", plugin "'.$this->prefixId.'"
-->
'.$content.'
<!-- END: Content of extension "'.$this->extKey.'", plugin "'.$this->prefixId.'" -->
';
<!-- BEGIN: Content of extension "' . $this->extKey . '", plugin "' . $this->prefixId . '" -->
' . $content . '
<!-- END: Content of extension "' . $this->extKey . '", plugin "' . $this->prefixId . '" -->
';
}
return $content;
}
/***************************
*
* Frontend editing: Edit panel, edit icons
(2-2/5)