5 * PostCalendar::PostNuke Events Calendar Module
6 * Copyright (C) 2002 The PostCalendar Team
7 * http://postcalendar.tv
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * To read the license please read the docs/license.txt or visit
24 * http://www.gnu.org/copyleft/gpl.html
27 function smarty_function_pc_url($args)
30 //print "<br />args<br />";
32 //print "<br />args<br />";
36 if (!isset($action)) {
37 $action = _SETTING_DEFAULT_VIEW
;
47 if ($setdeftime == 1) {
56 $template_view = pnVarCleanFromInput('tplview');
57 $viewtype = strtolower(pnVarCleanFromInput('viewtype'));
58 // pnVarCleanFromInput('pc_username'); //(CHEMED) replaced by the code below
59 //(CHEMED) Facility filtering
60 $pc_username = $_SESSION['pc_username'];
61 $pc_facility = $_SESSION['pc_facility'];
64 $category = pnVarCleanFromInput('pc_category');
65 $topic = pnVarCleanFromInput('pc_topic');
66 $popup = pnVarCleanFromInput('popup');
68 $Date = postcalendar_getDate();
73 // some extra cleanup if necessary
74 $Date = str_replace('-', '', $Date);
76 $pcModInfo = pnModGetInfo(pnModGetIDFromName(__POSTCALENDAR__
));
77 $pcDir = pnVarPrepForOS($pcModInfo['directory']);
81 if (!empty($starth)) {
82 $link = pnModURL(__POSTCALENDAR__
, 'user', 'submit', array('tplview'=>$template_view,'Date'=>$Date, 'event_starttimeh' => $starth, 'event_startampm' => $ampm));
84 $link = pnModURL(__POSTCALENDAR__
, 'user', 'submit', array('tplview'=>$template_view,'Date'=>$Date));
89 $link = pnModURL(__POSTCALENDAR__
, 'admin', 'submit', array('tplview'=>$template_view,'Date'=>$Date));
93 $link = pnModURL(__POSTCALENDAR__
, 'user', 'search');
97 $link = pnModURL(__POSTCALENDAR__
, 'user', 'view', array('tplview'=>$template_view,
100 'pc_facility'=>$pc_facility,
101 'pc_username'=>$pc_username,
102 'pc_category'=>$category,
104 'print'=>$print), $localpath);
108 $link = pnModURL(__POSTCALENDAR__
, 'user', 'view', array('tplview'=>$template_view,
111 'pc_facility'=>$pc_facility,
112 'pc_username'=>$pc_username,
113 'pc_category'=>$category,
119 $link = pnModURL(__POSTCALENDAR__
, 'user', 'view', array('tplview'=>$template_view,
122 'pc_facility'=>$pc_facility,
123 'pc_username'=>$pc_username,
124 'pc_category'=>$category,
130 $link = pnModURL(__POSTCALENDAR__
, 'user', 'view', array('tplview'=>$template_view,
133 'pc_facility'=>$pc_facility,
134 'pc_username'=>$pc_username,
135 'pc_category'=>$category,
142 if (_SETTING_OPEN_NEW_WINDOW
&& !$popup) {
143 $link = "javascript:opencal($eid,'$Date');";
145 $link = pnModURL(__POSTCALENDAR__
, 'user', 'view', array('Date'=>$Date,
146 'tplview'=>$template_view,
147 'viewtype'=>'details',
149 'print'=>$print), $localpath);
158 $link .= '" target="_blank"';
159 } elseif (_SETTING_OPEN_NEW_WINDOW
&& $viewtype == 'details') {
160 $link .= '" target="csCalendar"';