Project

General

Profile

Feature #22226 ยป indexed_search_daterange.diff

Administrator Admin, 2010-03-03 13:44

View differences:

typo3/sysext/indexed_search/pi/indexed_search.tmpl (working copy)
</tr>
<!-- ###SELECT_SEARCH_IN### end -->
<!-- ###SELECT_DATERANGE### begin -->
<tr>
<td>###FORM_DATERANGE###</td>
<td colspan="2">
<select name="tx_indexedsearch[dateRange]" class="tx-indexedsearch-selectbox-daterange daterange">
###SELECTBOX_DATERANGE_VALUES###
</select>
</td>
</tr>
<!-- ###SELECT_DATERANGE### end -->
<!-- ###SELECT_SECTION### begin -->
<tr>
<td>###FORM_FROMSECTION###</td>
typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (working copy)
*/
var $indexerObj;
var $templateCode; // Will hold the content of $conf['templateFile']
var $hiddenFieldList = 'ext, type, defOp, media, order, group, lang, desc, results';
var $hiddenFieldList = 'ext, type, defOp, media, order, group, lang, desc, results, dateRange';
/**
......
'20' => '20',
'50' => '50',
'100' => '100',
),
'dateRange' => array(
'' => $this->pi_getLL('opt_dateRange_no_limit'),
'86400' => $this->pi_getLL('opt_dateRange_last_day'),
'259200' => $this->pi_getLL('opt_dateRange_last_3days'),
'604800' => $this->pi_getLL('opt_dateRange_last_week'),
'2592000' => $this->pi_getLL('opt_dateRange_last_month'),
'7776000' => $this->pi_getLL('opt_dateRange_last_quarter'),
)
);
......
}
/**
* Returns an AND statement for date range selection
*
* @return string AND statement for date range selection
*/
protected function dateRangeWhere() {
$dateRange = trim((string)$this->piVars['dateRange']);
if (empty($dateRange) || !is_numeric($dateRange) || $dateRange <= 0) {
$out = '';
} else {
$out = 'AND IP.item_mtime>=' . (time() - intval($dateRange));
}
return $out;
}
/**
* Returns AND statement for selection of langauge
*
* @return string AND statement for selection of langauge
......
$page_join,
$wordSel.'
IP.phash IN ('.$list.') '.
$this->dateRangeWhere(). ' ' .
$this->mediaTypeWhere().' '.
$this->languageWhere().
$freeIndexUidClause.'
......
'ISEC.*, IP.*',
'index_phash IP,index_section ISEC'.$page_join,
'IP.phash IN ('.$list.') '.
$this->dateRangeWhere(). ' ' .
$this->mediaTypeWhere().' '.
$this->languageWhere().
$freeIndexUidClause.'
......
$html = $this->cObj->getSubpart($this->templateCode, '###SEARCH_FORM###');
// Multilangual text
$substituteArray = array('legend', 'searchFor', 'extResume', 'atATime', 'orderBy', 'fromSection', 'searchIn', 'match', 'style', 'freeIndexUid');
$substituteArray = array('legend', 'searchFor', 'extResume', 'atATime', 'orderBy', 'fromSection', 'searchIn', 'match', 'style', 'freeIndexUid', 'dateRange');
foreach ($substituteArray as $marker) {
$markerArray['###FORM_'.t3lib_div::strtoupper($marker).'###'] = $this->pi_getLL('form_'.$marker,'',1);
}
......
$markerArray['###EXT_RESUME_CHECKED###'] = $this->piVars['extResume'] ? ' checked="checked"' : '';
}
if (!is_array($optValues['dateRange']) || $this->conf['blind.']['dateRange']) {
$html = $this->cObj->substituteSubpart($html, '###SELECT_DATERANGE###', '');
} else {
unset($hiddenFieldArr['dateRange']);
$markerArray['###SELECTBOX_DATERANGE_VALUES###'] = $this->renderSelectBoxValues($this->piVars['dateRange'], $optValues['dateRange']);
}
} else { // Extended search
$html = $this->cObj->substituteSubpart($html, '###SEARCH_FORM_EXTENDED###', '');
}
typo3/sysext/indexed_search/pi/locallang.xml (working copy)
<label index="opt_RL1ALL">All pages on level 1</label>
<label index="opt_RL2">- Level 2:</label>
<label index="opt_RL2ALL">- All pages on level 2</label>
<label index="opt_dateRange_no_limit">No limit</label>
<label index="opt_dateRange_last_day">Last day</label>
<label index="opt_dateRange_last_3days">Last 3 days</label>
<label index="opt_dateRange_last_week">Last week</label>
<label index="opt_dateRange_last_month">Last month</label>
<label index="opt_dateRange_last_quarter">Last quarter</label>
<label index="form_legend">Search form</label>
<label index="form_searchFor">Search for:</label>
<label index="form_extResume">Extended resume</label>
......
<label index="form_searchIn">Search in:</label>
<label index="form_match">Match:</label>
<label index="form_style">Style:</label>
<label index="form_dateRange">Date range:</label>
<label index="rules_header">Rules:</label>
<label index="rules_text">
Only words with 2 or more characters are accepted
typo3/sysext/indexed_search/pi/template_css.tmpl (working copy)
</div>
<!-- ###SELECT_SEARCH_IN### end -->
<!-- ###SELECT_DATERANGE### begin -->
<div class="tx-indexedsearch-search-select-daterange">
<label for="tx-indexedsearch-selectbox-daterange">###FORM_DATERANGE###</label>
<select name="tx_indexedsearch[dateRange]" id="tx-indexedsearch-selectbox-daterange" class="tx-indexedsearch-selectbox-daterange daterange">###SELECTBOX_DATERANGE_VALUES###</select>
</div>
<!-- ###SELECT_DATERANGE### end -->
<!-- ###SELECT_SECTION### begin -->
<div class="tx-indexedsearch-search-select-section">
<label for="tx-indexedsearch-selectbox-sections">###FORM_FROMSECTION###</label>
    (1-1/1)