Changeset 16597 for extensions/UserCollections/include/collections.inc.php
- Timestamp:
- Jul 10, 2012, 5:37:33 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserCollections/include/collections.inc.php
r16591 r16597 8 8 switch ($page['sub_section']) 9 9 { 10 /* list */ 10 11 case 'list': 11 12 { 13 if (is_a_guest()) access_denied(); 14 12 15 $template->set_filename('index', dirname(__FILE__) . '/../template/list.tpl'); 13 16 … … 125 128 { 126 129 $col['date_creation'] = format_date($col['date_creation'], true); 127 $col['U_VIEW'] = USER_COLLEC_PUBLIC.'view/'.$col['id'];128 130 $col['U_EDIT'] = USER_COLLEC_PUBLIC.'edit/'.$col['id']; 129 131 $col['U_ACTIVE'] = USER_COLLEC_PUBLIC.'&action=set_active&col_id='.$col['id']; … … 133 135 { 134 136 $col['name'] = 'temp #'.$col['id']; 137 $col['U_VIEW'] = $col['U_EDIT']; 135 138 $col['U_SAVE'] = USER_COLLEC_PUBLIC.'&action=save&col_id='.$col['id']; 136 139 $template->append('temp_col', $col); … … 138 141 else 139 142 { 143 $col['U_VIEW'] = USER_COLLEC_PUBLIC.'view/'.$col['id']; 140 144 $template->append('collections', $col); 141 145 } … … 145 149 break; 146 150 } 147 151 152 /* edit */ 148 153 case 'edit': 149 154 { … … 165 170 try { 166 171 $UserCollection = new UserCollection($page['col_id']); 172 173 if (!is_admin() and $UserCollection->getParam('user_id') != $user['id']) 174 { 175 access_denied(); 176 } 167 177 168 178 // save properties … … 199 209 200 210 include(PHPWG_ROOT_PATH . 'include/category_default.inc.php'); 211 212 $template->concat('TITLE', $conf['level_separator'].$UserCollection->getParam('name')); 201 213 } 202 214 catch (Exception $e) … … 208 220 } 209 221 222 /* view */ 210 223 case 'view': 211 224 { … … 234 247 235 248 $template->assign('collection', $UserCollection->getCollectionInfo()); 236 237 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');238 $template->assign('OWNER', get_username($UserCollection->getParam('user_id')));239 249 240 250 $page['start'] = isset($_GET['start']) ? $_GET['start'] : 0; … … 254 264 255 265 include(PHPWG_ROOT_PATH . 'include/category_default.inc.php'); 266 267 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 268 $template->concat('TITLE', 269 $conf['level_separator'].$UserCollection->getParam('name'). 270 ' ('.sprintf(l10n('by %s'), get_username($UserCollection->getParam('user_id'))).')' 271 ); 256 272 } 257 273 catch (Exception $e) 258 274 { 259 a rray_push($page['errors'], $e->getMessage());275 access_denied(); 260 276 } 261 277 262 278 break; 263 279 } 264 265 // case 'send':266 // {267 268 // break;269 // }270 280 } 271 281
Note: See TracChangeset
for help on using the changeset viewer.