Changeset 23551 for extensions/UserCollections/include/events.inc.php
- Timestamp:
- Jun 26, 2013, 12:09:21 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserCollections/include/events.inc.php
r23361 r23551 47 47 function user_collections_page() 48 48 { 49 global $page ;49 global $page, $template; 50 50 51 51 if (isset($page['section']) and $page['section'] == 'collections') 52 52 { 53 53 include(USER_COLLEC_PATH . '/include/collections.inc.php'); 54 } 55 56 if (!is_a_guest() && count($page['items'])) 57 { 58 $template->set_filename('uc_tumbnails_cssjs', realpath(USER_COLLEC_PATH . 'template/thumbnails_css_js.tpl')); 59 $template->parse('uc_tumbnails_cssjs'); 54 60 } 55 61 } … … 98 104 // get all collections 99 105 $query = ' 100 SELECT id, name, nb_images , active106 SELECT id, name, nb_images 101 107 FROM '.COLLECTIONS_TABLE.' 102 108 WHERE user_id = '.$user['id'].' … … 104 110 ;'; 105 111 $collections = hash_from_query($query, 'id'); 112 113 foreach ($collections as &$col) 114 { 115 $col["name"] = trigger_event("render_category_name", $col["name"]); 116 } 117 unset($col); 106 118 107 119 $template->assign(array( … … 112 124 // thumbnails buttons 113 125 $template->set_prefilter('index_thumbnails', 'user_collections_thumbnails_list_button'); 114 $template->set_prefilter('index', 'user_collections_thumbnails_list_cssjs');115 126 116 127 return $tpl_thumbnails_var; … … 133 144 } 134 145 135 // add css & js and menu136 function user_collections_thumbnails_list_cssjs($content, &$smarty)137 {138 $content.= file_get_contents(USER_COLLEC_PATH.'template/thumbnails_css_js.tpl');139 return $content;140 }141 142 146 143 147 // +-----------------------------------------------------------------------+ … … 167 171 // get all collections 168 172 $query = ' 169 SELECT id, name, nb_images , active173 SELECT id, name, nb_images 170 174 FROM '.COLLECTIONS_TABLE.' 171 175 WHERE user_id = '.$user['id'].' … … 173 177 ;'; 174 178 $collections = hash_from_query($query, 'id'); 179 180 foreach ($collections as &$col) 181 { 182 $col["name"] = trigger_event("render_category_name", $col["name"]); 183 } 184 unset($col); 175 185 176 186 $template->assign(array( … … 214 224 { 215 225 $query = ' 216 SELECT *226 SELECT id, name, nb_images 217 227 FROM '.COLLECTIONS_TABLE.' 218 228 WHERE user_id = '.$user['id'].' 219 ORDER BY 220 active DESC, 221 date_creation DESC 229 ORDER BY date_creation DESC 222 230 ;'; 223 231 $collections = array_values(hash_from_query($query, 'id')); … … 226 234 for ($i=0; $i<$max && $i<count($collections); $i++) 227 235 { 228 $collections[$i]['U_EDIT'] = USER_COLLEC_PUBLIC.'edit/'.$collections[$i]['id']; 236 $collections[$i]['name'] = trigger_event('render_category_name', $collections[$i]['name']); 237 $collections[$i]['u_edit'] = USER_COLLEC_PUBLIC.'edit/'.$collections[$i]['id']; 229 238 $data['collections'][] = $collections[$i]; 230 239 } … … 239 248 $data['U_CREATE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'new','col_id'=>'0','redirect'=>'true')); 240 249 241 $template->set_template_dir(USER_COLLEC_PATH . 'template/');242 250 $block->set_title('<a href="'.USER_COLLEC_PUBLIC.'">'.l10n('Collections').'</a>'); 243 $block->template = 'menublock_user_collec.tpl';251 $block->template = realpath(USER_COLLEC_PATH . 'template/menublock.tpl'); 244 252 $block->data = $data; 245 253 }
Note: See TracChangeset
for help on using the changeset viewer.