Project

General

Profile

Bug #24312 ยป 16706.patch

Administrator Admin, 2010-12-09 13:12

View differences:

typo3/template.php (revision )
return $pageInfo;
}
/**
* Makes a collapseable section. See reports module for an example
*
* @param string $title
* @param string $html
* @param string $id
* @param string $saveStatePointer
* @return string
*/
public function collapsesableSection($title, $html, $id, $saveStatePointer = '') {
$hasSave = $saveStatePointer ? TRUE : FALSE;
$collapsedStyle = $collapsedClass = '';
if ($hasSave) {
/** @var $settings extDirect_DataProvider_BackendUserSettings */
$settings = t3lib_div::makeInstance('extDirect_DataProvider_BackendUserSettings');
$value = $settings->get($saveStatePointer . '.' . $id);
if ($value) {
$collapsedStyle = ' style="display: none"';
$collapsedClass = ' collapsed';
} else {
$collapsedStyle = '';
$collapsedClass = ' expanded';
}
}
$this->pageRenderer->loadExtJS();
$this->pageRenderer->addExtOnReadyCode('
Ext.select("h2.section-header").each(function(element){
element.on("click", function(event, tag) {
var state = 0,
el = Ext.fly(tag),
div = el.next("div"),
saveKey = el.getAttribute("rel");
if (el.hasClass("collapsed")) {
el.removeClass("collapsed").addClass("expanded");
div.slideIn("t", {
easing: "easeIn",
duration: .5
});
} else {
el.removeClass("expanded").addClass("collapsed");
div.slideOut("t", {
easing: "easeOut",
duration: .5,
remove: false,
useDisplay: true
});
state = 1;
}
if (saveKey) {
try {
top.TYPO3.BackendUserSettings.ExtDirect.set(saveKey + "." + tag.id, state, function(response) {});
} catch(e) {}
}
});
});
');
return '
<h2 id="' . $id . '" class="section-header' . $collapsedClass . '" rel="' . $saveStatePointer . '"> ' . $title . '</h2>
<div' . $collapsedStyle . '>' . $html . '</div>
';
}
}
}
// ******************************
t3lib/core_autoload.php (revision )
't3lib_tceformsinlinehook' => PATH_t3lib . 'interfaces/interface.t3lib_tceformsinlinehook.php',
't3lib_tcemain_checkmodifyaccesslisthook' => PATH_t3lib . 'interfaces/interface.t3lib_tcemain_checkmodifyaccesslisthook.php',
't3lib_tcemain_processuploadhook' => PATH_t3lib . 'interfaces/interface.t3lib_tcemain_processuploadhook.php',
't3lib_mail_mboxtransport' => PATH_t3lib . 'mail/class.t3lib_mail_mboxtransport.php',
't3lib_mail_mboxtransport' => PATH_t3lib . 'mail/class.t3lib_mail_mboxtransport.php',
't3lib_mail_message' => PATH_t3lib . 'mail/class.t3lib_mail_message.php',
't3lib_mail_mailer' => PATH_t3lib . 'mail/class.t3lib_mail_mailer.php',
'tx_t3lib_mail_hooks' => PATH_t3lib . 'mail/class.tx_t3lib_mail_hooks.php',
......
't3lib_tree_tca_databasetreedataprovider' => PATH_t3lib . 'tree/tca/class.t3lib_tree_tca_databasetreedataprovider.php',
't3lib_tree_tca_dataproviderfactory' => PATH_t3lib . 'tree/tca/class.t3lib_tree_tca_dataproviderfactory.php',
't3lib_tree_tca_tcatree' => PATH_t3lib . 'tree/tca/class.t3lib_tree_tca_tcatree.php',
'extdirect_dataprovider_backendusersettings' => PATH_t3lib . 'extjs/dataprovider/class.extdirect_dataprovider_beusersettings.php',
);
$tslibClasses = require(PATH_typo3 . 'sysext/cms/ext_autoload.php');
typo3/sysext/reports/reports/class.tx_reports_reports_status.php (revision )
$providerState = $this->sortStatuses($providerStatus);
$id = str_replace(' ', '-', $provider);
if (isset($GLOBALS['BE_USER']->uc['reports']['states'][$id]) && $GLOBALS['BE_USER']->uc['reports']['states'][$id]) {
$collapsedStyle = 'style="display: none"';
$collapsedClass = 'collapsed';
} else {
$collapsedStyle = '';
$collapsedClass = 'expanded';
}
$classes = array(
tx_reports_reports_status_Status::NOTICE => 'notice',
tx_reports_reports_status_Status::INFO => 'information',
......
if ($sectionSeverity > 0) {
$headerIcon = $icon[$sectionSeverity];
}
$content .= '<h2 id="' . $id . '" class="section-header ' . $collapsedClass . '">' . $headerIcon . $provider . '</h2>
<div ' . $collapsedStyle . '>' . $messages . '</div>';
$content .= $GLOBALS['TBE_TEMPLATE']->collapsesableSection($headerIcon . $provider, $messages, $id, 'reports.states');
}
return $content;
......
return $statuses;
}
/**
* Saves the section toggle state in the backend user's uc.
*
* @param array Array of parameters from the AJAX interface, currently unused
* @param TYPO3AJAX Object of type TYPO3AJAX
*/
public function saveCollapseState(array $params, TYPO3AJAX $ajaxObj) {
$item = t3lib_div::_POST('item');
$state = (bool)t3lib_div::_POST('state');
$GLOBALS['BE_USER']->uc['reports']['states'][$item] = $state;
$GLOBALS['BE_USER']->writeUC();
}
}
}
if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/reports/reports/class.tx_reports_reports_status.php'])) {
typo3/sysext/reports/mod/index.php (revision )
t3lib_extMgm::extPath('reports') . 'mod/mod_template.html'
);
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->getPageRenderer()->loadScriptaculous('effects');
$this->doc->addStyleSheet(
'tx_reports',
'../' . t3lib_extMgm::siteRelPath('reports') . 'mod/mod_styles.css'
......
function jumpToUrl(URL) {
document.location = URL;
}
var state;
Event.observe(document, "dom:loaded", function(){
$$("h2.section-header").invoke("observe", "click", function(event){
var item = Event.element(event);
// possible icon inside h2
if (item.hasClassName("t3-icon")) {
item = item.up("h2");
}
if (item.hasClassName("expanded")) {
item.removeClassName("expanded").addClassName("collapsed");
Effect.BlindUp(item.next("div"), {duration : 0.5});
state = 1;
} else {
item.removeClassName("collapsed").addClassName("expanded");
Effect.BlindDown(item.next("div"), {duration : 0.5});
state = 0;
}
event.stop();
new Ajax.Request("ajax.php", {
parameters : "ajaxID=Reports::saveCollapseState&item=" + item.id + "&state=" + state
});
});
});
';
$this->doc->postCode='
<script language="javascript" type="text/javascript">
typo3/sysext/reports/ext_tables.php (revision )
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['security'][] = 'tx_reports_reports_status_SecurityStatus';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['configuration'][] = 'tx_reports_reports_status_ConfigurationStatus';
$GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']['Reports::saveCollapseState'] = 'EXT:reports/reports/class.tx_reports_reports_status.php:tx_reports_reports_Status->saveCollapseState';
}
?>
    (1-1/1)