Feature #20261 » enableFields.patch
t3lib/class.t3lib_page.php (working copy) | ||
---|---|---|
if ($show_hidden==-1) $show_hidden=0; // If show_hidden was not changed during the previous evaluation, do it here.
|
||
$ctrl = $GLOBALS['TCA'][$table]['ctrl'];
|
||
$query='';
|
||
$query = array();
|
||
if (is_array($ctrl)) {
|
||
// Delete field check:
|
||
if ($ctrl['delete']) {
|
||
$query.=' AND '.$table.'.'.$ctrl['delete'].'=0';
|
||
$query['delete'] = ' AND '.$table.'.'.$ctrl['delete'].'=0';
|
||
}
|
||
// Filter out new place-holder records in case we are NOT in a versioning preview (that means we are online!)
|
||
if ($ctrl['versioningWS'] && !$this->versioningPreview) {
|
||
$query.=' AND '.$table.'.t3ver_state<=0'; // Shadow state for new items MUST be ignored!
|
||
$query['versioningWS'] = ' AND '.$table.'.t3ver_state<=0'; // Shadow state for new items MUST be ignored!
|
||
}
|
||
// Enable fields:
|
||
... | ... | |
if (!$this->versioningPreview || !$ctrl['versioningWS'] || $noVersionPreview) { // In case of versioning-preview, enableFields are ignored (checked in versionOL())
|
||
if ($ctrl['enablecolumns']['disabled'] && !$show_hidden && !$ignore_array['disabled']) {
|
||
$field = $table.'.'.$ctrl['enablecolumns']['disabled'];
|
||
$query.=' AND '.$field.'=0';
|
||
$query['disabled'] =' AND '.$field.'=0';
|
||
}
|
||
if ($ctrl['enablecolumns']['starttime'] && !$ignore_array['starttime']) {
|
||
$field = $table.'.'.$ctrl['enablecolumns']['starttime'];
|
||
$query.=' AND ('.$field.'<='.$GLOBALS['SIM_ACCESS_TIME'].')';
|
||
$query['starttime'] = ' AND ('.$field.'<='.$GLOBALS['SIM_ACCESS_TIME'].')';
|
||
}
|
||
if ($ctrl['enablecolumns']['endtime'] && !$ignore_array['endtime']) {
|
||
$field = $table.'.'.$ctrl['enablecolumns']['endtime'];
|
||
$query.=' AND ('.$field.'=0 OR '.$field.'>'.$GLOBALS['SIM_ACCESS_TIME'].')';
|
||
$query['endtime'] = ' AND ('.$field.'=0 OR '.$field.'>'.$GLOBALS['SIM_ACCESS_TIME'].')';
|
||
}
|
||
if ($ctrl['enablecolumns']['fe_group'] && !$ignore_array['fe_group']) {
|
||
$field = $table.'.'.$ctrl['enablecolumns']['fe_group'];
|
||
$query.= $this->getMultipleGroupsWhereClause($field, $table);
|
||
$query['fe_group'] = $this->getMultipleGroupsWhereClause($field, $table);
|
||
}
|
||
// Call hook functions for additional enableColumns
|
||
... | ... | |
'ctrl' => $ctrl
|
||
);
|
||
foreach($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_page.php']['addEnableColumns'] as $_funcRef) {
|
||
$query .= t3lib_div::callUserFunction($_funcRef,$_params,$this);
|
||
$query[$_funcRef] = t3lib_div::callUserFunction($_funcRef,$_params,$this);
|
||
}
|
||
}
|
||
|
||
// Call hook functions for manipulating query
|
||
if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_page.php']['changeEnableColumns'])) {
|
||
$_params = array(
|
||
'table' => $table,
|
||
'show_hidden' => $show_hidden,
|
||
'ignore_array' => $ignore_array,
|
||
'query' => $query,
|
||
'ctrl' => $ctrl
|
||
);
|
||
foreach($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_page.php']['changeEnableColumns'] as $_funcRef) {
|
||
$query = t3lib_div::callUserFunction($_funcRef,$_params,$this);
|
||
}
|
||
}
|
||
|
||
$query = implode(' ', $query);
|
||
}
|
||
}
|
||
} else {
|
||
... | ... | |
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_page.php']);
|
||
}
|
||
?>
|
||
?>
|