summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt3
-rw-r--r--css/views-list.css3
-rw-r--r--includes/admin.inc26
3 files changed, 29 insertions, 3 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index bec2c3d..60696af 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -75,4 +75,5 @@ Views 2.3
o #327604 by mr.baileys: Fix improper use of multibyte library when mb library unavailable.
Other changes:
- o #288801 by drewish and eaton: Aggregator item support! Make views of feeds! \ No newline at end of file
+ o #288801 by drewish and eaton: Aggregator item support! Make views of feeds!
+ o #335647 by markus_petrux: Add memory and a reset button to the Views list page. \ No newline at end of file
diff --git a/css/views-list.css b/css/views-list.css
index 3155e66..75e4354 100644
--- a/css/views-list.css
+++ b/css/views-list.css
@@ -42,7 +42,8 @@ body form#views-ui-list-views-form {
clear: left;
}
-#edit-views-apply {
+#edit-views-apply,
+#edit-views-reset {
margin-top: 1.65em;
float: left;
}
diff --git a/includes/admin.inc b/includes/admin.inc
index 6965419..5648f98 100644
--- a/includes/admin.inc
+++ b/includes/admin.inc
@@ -50,6 +50,22 @@ function template_preprocess_views_ui_list_views(&$vars) {
$views = views_get_all_views();
+ // Respond to a reset command by clearing session and doing a drupal goto
+ // back to the base URL.
+ if (isset($_GET['op']) && $_GET['op'] == t('Reset')) {
+ unset($_SESSION['views']['#admin']);
+ drupal_goto('admin/build/views');
+ }
+ if (count($_GET) <= 1) {
+ if (isset($_SESSION['views']['#admin']) && is_array($_SESSION['views']['#admin'])) {
+ $_GET += $_SESSION['views']['#admin'];
+ }
+ }
+ else {
+ $_SESSION['views']['#admin'] = $_GET;
+ unset($_SESSION['views']['#admin']['q']);
+ }
+
$form_state = array(
'views' => $views,
'input' => $_GET,
@@ -150,7 +166,7 @@ function template_preprocess_views_ui_list_views(&$vars) {
$sort .= strtolower($view->name);
break;
case 'title':
- $sort .= strtolower($title);
+ $sort .= strtolower($item->title);
break;
case 'path':
$sort .= strtolower($raw_path); // $path;
@@ -295,6 +311,14 @@ function views_ui_list_views_form(&$form_state) {
'#value' => t('Apply'),
);
+ if (!empty($_SESSION['views']['#admin'])) {
+ $form['reset'] = array(
+ '#type' => 'submit',
+ '#id' => 'edit-views-reset',
+ '#value' => t('Reset'),
+ );
+ }
+
$form['#theme'] = array('views_ui_list_views_form');
return $form;
}