]> gitweb.fluxo.info Git - drupal/calendario.git/commitdiff
Trying to avoid undefined parameter
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 10 Sep 2012 17:01:18 +0000 (14:01 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 10 Sep 2012 17:01:18 +0000 (14:01 -0300)
calendario.module

index c8e5665d22e40834c9389894f4043b30cbd23be2..ba36a10567330727f934c61b4012f73720324171 100644 (file)
@@ -31,33 +31,35 @@ function calendario_widget($view = NULL) {
   $display = $view->current_display;
   $path    = explode('/', $view->display[$display]->handler->options['path']);
 
-  switch ($path[1]) {
-    case 'dia':
-    case 'semana':
-    case 'mes':
-    case 'ano':
-      $type     = NULL;
-      $period   = $path[1];
-      //$date     = isset($path[2]) ? .'/'. $path[2] : '';
-      $date     = isset($view->args[0]) ? '/'. $view->args[0] : '';
-      $argument = NULL;
-      //$link     = $period . $date;
-      $link     = $period;
-      break;
+  if (!isset($path[1])) {
+    switch ($path[1]) {
+      case 'dia':
+      case 'semana':
+      case 'mes':
+      case 'ano':
+        $type     = NULL;
+        $period   = $path[1];
+        //$date     = isset($path[2]) ? .'/'. $path[2] : '';
+        $date     = isset($view->args[0]) ? '/'. $view->args[0] : '';
+        $argument = NULL;
+        //$link     = $period . $date;
+        $link     = $period;
+        break;
 
-    default:
-      $type     = $path[1];
-      $period   = $path[3];
-      //$date     = isset($path[4]) ? .'/'. $path[4] : '';
-      $date     = isset($view->args[1]) ? '/'. $view->args[1] : '';
-      //$argument = $path[2];
-      $argument = isset($view->args[0]) ? '/'. $view->args[0] : '';
-      //$link     = $type . $argument .'/'. $period . $date;
-      $link     = $type . $argument .'/'. $period;
-      break;
-  }
+      default:
+        $type     = $path[1];
+        $period   = $path[3];
+        //$date     = isset($path[4]) ? .'/'. $path[4] : '';
+        $date     = isset($view->args[1]) ? '/'. $view->args[1] : '';
+        //$argument = $path[2];
+        $argument = isset($view->args[0]) ? '/'. $view->args[0] : '';
+        //$link     = $type . $argument .'/'. $period . $date;
+        $link     = $type . $argument .'/'. $period;
+        break;
+    }
 
-  return theme('embed-widget', array('link' => $link));
+    return theme('embed-widget', array('link' => $link));
+  }
 }
 
 /**