aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muamba.module14
1 files changed, 14 insertions, 0 deletions
diff --git a/muamba.module b/muamba.module
index f951210..b35949d 100644
--- a/muamba.module
+++ b/muamba.module
@@ -334,3 +334,17 @@ function muamba_form_alter(&$form, &$form_state, $form_id) {
unset($form['flag']);
}
}
+
+/**
+ * Implements hook_views_pre_render()
+ */
+function muamba_views_pre_render(&$view) {
+ // Filter out unavailable items from view.
+ if ($view->name == 'muambas' && substr($view->current_display, 0, 11) == 'disponiveis') {
+ foreach ($view->result as $key => $result) {
+ if (!muamba_check_availability($result->nid)) {
+ unset($view->result[$key]);
+ }
+ }
+ }
+}