summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-09-10 14:01:18 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-09-10 14:01:18 -0300
commit7fcdb551422b985c1013f371ca0a725db14f0287 (patch)
treeb71f0d97f4a97505f41438ac6d6f8708244297b3
parent30d6d821f0d57ac09a5fcfe076ec1f24c8b8d4ae (diff)
downloadcalendario-7fcdb551422b985c1013f371ca0a725db14f0287.tar.gz
calendario-7fcdb551422b985c1013f371ca0a725db14f0287.tar.bz2
Trying to avoid undefined parameter
-rw-r--r--calendario.module52
1 files changed, 27 insertions, 25 deletions
diff --git a/calendario.module b/calendario.module
index c8e5665..ba36a10 100644
--- a/calendario.module
+++ b/calendario.module
@@ -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));
+ }
}
/**