summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRdeBoer2013-07-29 04:24:18 (GMT)
committer RdeBoer2013-07-29 04:24:18 (GMT)
commitfda0501988d81422976c600827778788751dda3f (patch)
treedcadf9785b7fab61a55b1e4d0079e09bc3808358
parent19cb2a63c6630b2be4d4bc126836832feea32dfc (diff)
Update README to explain use with "created (posted)" and "updated" node properties.
-rwxr-xr-xREADME.txt20
-rw-r--r--global_filter.blocks.inc10
-rw-r--r--widgets/global_filter.datewidget.inc2
3 files changed, 21 insertions, 11 deletions
diff --git a/README.txt b/README.txt
index c4f4659..3951d76 100755
--- a/README.txt
+++ b/README.txt
@@ -105,12 +105,20 @@ set to "Australia, Victoria, Melbourne".
When you use the Hierarchical Select widget you do NOT need to tick "Allow
multiple values" on the contextual filter configuration panel.
-GLOBAL FILTER FOR DATE OR DATE RANGE
-====================================
-We assume that in addition to Views you have the Date module enabled.
-If your content does not already have a date field attached, add one as per
-normal via the Manage Fields tab on the content type page. You may pick any of
-three Date types, i.e. plain, ISO or Unix Timestamp. Just be aware of this bug
+GLOBAL FILTER FOR DATES OR DATE RANGES
+======================================
+The "created (posted)" and "updated (modified)" node PROPERTIES are
+architecturally different from Date FIELDS (discussed below). When used as
+contextual filters "created" and "updated" are supported as single values only.
+However you can use them as contextual ranges via the Views Contextual Range
+Filter module. When used this way, you can enter ranges for "created" and
+"updated" dates via the Range widget in Views Global Filter.
+
+As far as general date FIELDS go, here is how it works.
+We assume that in addition to Views you have the Date module enabled. If your
+content does not already have a date field attached, add one as per normal via
+the Manage Fields tab on the content type page. You may pick any of the three
+Date types, i.e. plain, ISO or Unix Timestamp. Just be aware of this bug
in the Date module: drupal.org/project/node/1477180. So until this is fixed,
maybe avoid Unix Timestamp. When prompted pick any of the available date
selection widgets, e.g popup calendar or the triple select list. You may tick
diff --git a/global_filter.blocks.inc b/global_filter.blocks.inc
index a31eb67..a27678a 100644
--- a/global_filter.blocks.inc
+++ b/global_filter.blocks.inc
@@ -84,14 +84,14 @@ function global_filter_block_configure($delta) {
}
}
elseif (drupal_substr($filter_parameters[$key]['block'], -1) == $block_number) {
- $form['all-filters'][$key] = _global_filter_configure_form($block_number, $key);
+ $form['all-filters'][$key] = _global_filter_configure_form($block_number, $key, $fieldset);
$keys[] = $key;
$fieldset++;
}
}
// Generate empty form for optional extra filter.
if (isset($first_free_key)) {
- $form['all-filters'][$first_free_key] = _global_filter_configure_form($block_number, $first_free_key);
+ $form['all-filters'][$first_free_key] = _global_filter_configure_form($block_number, $first_free_key, $fieldset);
$keys[] = $first_free_key;
}
return $form;
@@ -104,11 +104,13 @@ function global_filter_block_configure($delta) {
* the block number
* @param int $filter_key
* the filter key
+ * @param bool $expand_fieldset
+ * whetor to expand or collapse the fieldset holding the form
*
* @return array
* the $form array
*/
-function _global_filter_configure_form($block_number, $filter_key) {
+function _global_filter_configure_form($block_number, $filter_key, $expand_fieldset) {
$num_filters = count(global_filter_get_filters_for_block($block_number));
$name = ($num_filters == 0) ? '' : global_filter_get_parameter($filter_key, 'name');
@@ -119,7 +121,7 @@ function _global_filter_configure_form($block_number, $filter_key) {
'#title' => isset($name) ? t('Settings for global filter %name', array('%name' => $name)) : t('Optional additional global filter (currently not configured)'),
'#type' => 'fieldset',
'#collapsible' => TRUE,
- '#collapsed' => TRUE,
+ '#collapsed' => $expand_fieldset,
);
$form[$delta]['driver'] = array(
diff --git a/widgets/global_filter.datewidget.inc b/widgets/global_filter.datewidget.inc
index c408783..1adb848 100644
--- a/widgets/global_filter.datewidget.inc
+++ b/widgets/global_filter.datewidget.inc
@@ -103,7 +103,7 @@ function global_filter_extract_date_range($form_state, $filter_key) {
if (isset($values['value']['date'])) {
// From date_popup.
$date_string = $values['value']['date'];
- $time_string = empty($values['value']['time']) ? '' : $values['value']['time'];
+ //$time_string = empty($values['value']['time']) ? '' : $values['value']['time'];
if (!empty($date_string)) {
// @todo Add support for hours and minutes
$timestamp = strtotime($date_string);