Changeset 1059 for trunk/include/functions_calendar.inc.php
- Timestamp:
- Feb 28, 2006, 5:28:06 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_calendar.inc.php
r1057 r1059 53 53 //------------------ initialize the condition on items to take into account --- 54 54 $inner_sql = ' FROM ' . IMAGES_TABLE; 55 55 56 56 if (!isset($page['cat']) or is_numeric($page['cat'])) 57 57 { // we will regenerate the items by including subcats elements … … 60 60 $inner_sql .= ' 61 61 INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id'; 62 62 63 63 if (isset($page['cat']) and is_numeric($page['cat'])) 64 64 { … … 67 67 explode(',', $user['forbidden_categories']) 68 68 ); 69 69 70 70 if (empty($sub_ids)) 71 71 { … … 102 102 // Created 103 103 'created' => array( 104 // TODO change next line when calendar_datefield disapears 105 'default_link' => ( $conf['calendar_datefield']=='date_creation' ? '' : 'created-' ), 104 'default_link' => 'created-', 106 105 'label' => l10n('Creation date'), 107 106 'db_field' => 'date_creation', … … 109 108 // Posted 110 109 'posted' => array( 111 // TODO change next line when calendar_datefield disapears 112 'default_link' => ( $conf['calendar_datefield']=='date_available' ? '' : 'posted-' ), 113 'label' => l10n('Availability date'), 110 'default_link' => 'posted-', 111 'label' => l10n('Post date'), 114 112 'db_field' => 'date_available', 115 113 ), … … 120 118 'monthly' => array( 121 119 'default_link' => '', 122 'label' => l10n('Monthly'),123 120 'include' => 'calendar_monthly.class.php', 124 121 'view_calendar' => true, 125 122 ), 126 // Weekly style 123 // Weekly style 127 124 'weekly' => array( 128 125 'default_link' => 'weekly-', 129 'label' => l10n('Weekly'),130 126 'include' => 'calendar_weekly.class.php', 131 127 'view_calendar' => false, … … 137 133 CAL_VIEW_LIST => array( 138 134 'default_link' => '', 139 'label' => l10n('List')140 135 ), 141 136 // calendar view 142 137 CAL_VIEW_CALENDAR => array( 143 138 'default_link' => CAL_VIEW_CALENDAR.'-', 144 'label' => l10n('calendar')145 139 ), 146 140 ); 147 141 148 142 $requested = explode('-', $_GET['calendar']); 149 143 150 144 // Retrieve calendar field 151 145 $cal_field = get_calendar_parameter($fields, $requested); 152 146 153 147 // Retrieve style 154 148 $cal_style = get_calendar_parameter($styles, $requested); … … 191 185 } 192 186 } 187 else 188 { 189 $requested[$i] = (int)$requested[$i]; 190 } 193 191 } 194 192 if ($any_count == 3) … … 196 194 array_pop($requested); 197 195 } 198 196 199 197 $calendar->initialize($fields[$cal_field]['db_field'], $inner_sql, $requested); 200 201 //echo ('<pre>'. var_export($fields, true) . '</pre>'); 202 198 199 //echo ('<pre>'. var_export($calendar, true) . '</pre>'); 200 201 $url_base = get_query_string_diff(array('start', 'calendar')); 203 202 $url_base = 204 203 PHPWG_ROOT_PATH.'category.php' 205 . get_query_string_diff(array('start', 'calendar'))204 .$url_base 206 205 .(empty($url_base) ? '?' : '&') 207 206 .'calendar='.$cal_field.'-' 208 207 ; 209 210 208 $must_show_list = true; // true until calendar generates its own display 211 209 if (basename($_SERVER["PHP_SELF"]) == 'category.php') … … 224 222 $page['cat_nb_images'] 225 223 ); 226 224 227 225 $must_show_list = false; 228 226 } 229 227 230 228 $template->assign_block_vars( 'calendar.views', array() ); 231 229 foreach ($styles as $style => $style_data) … … 256 254 array( 257 255 'VALUE' => $url, 258 'CONTENT' => $style_data['label'].' ('.$view_data['label'].')',256 'CONTENT' => l10n('calendar_'.$style.'_'.$view), 259 257 'SELECTED' => $selected, 260 258 ) … … 265 263 } // end category calling 266 264 267 $calendar_title = 265 $calendar_title = 268 266 '<a href="'.$url_base.$cal_style.'-'.$cal_view.'">' 269 267 .$fields[$cal_field]['label'].'</a>'; … … 272 270 'calendar', 273 271 array( 274 'TITLE' => $calendar_title,272 'TITLE' => '<br/>'.$calendar_title, 275 273 ) 276 274 ); 277 275 278 276 if ($must_show_list) 279 277 { … … 290 288 $order_by = str_replace( 291 289 'ORDER BY ', 292 'ORDER BY '.$calendar->date_field.' ,', $conf['order_by']290 'ORDER BY '.$calendar->date_field.' DESC,', $conf['order_by'] 293 291 ); 294 292 $query .= $order_by;
Note: See TracChangeset
for help on using the changeset viewer.