Changeset 17178
- Timestamp:
- Jul 27, 2012, 4:47:29 PM (12 years ago)
- Location:
- extensions/UserCollections
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserCollections/include/UserCollection.class.php
r16688 r17178 292 292 'PUBLIC' => (bool)$this->data['public'], 293 293 'DATE_CREATION' => format_date($this->data['date_creation'], true), 294 'U_PUBLIC' => get_absolute_root_url(). USER_COLLEC_PUBLIC . 'view/'.$this->data['public_id'],294 'U_PUBLIC' => get_absolute_root_url().'collection/view/'.$this->data['public_id'], 295 295 'IS_TEMP' => $this->data['name'] == 'temp', 296 296 ); -
extensions/UserCollections/include/collections.inc.php
r16688 r17178 120 120 $col['date_creation'] = format_date($col['date_creation'], true); 121 121 $col['U_EDIT'] = USER_COLLEC_PUBLIC.'edit/'.$col['id']; 122 $col['U_ACTIVE'] = USER_COLLEC_PUBLIC.'&action=set_active&col_id='.$col['id'];123 $col['U_DELETE'] = USER_COLLEC_PUBLIC.'&action=delete&col_id='.$col['id'];122 $col['U_ACTIVE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'set_active','col_id'=>$col['id'])); 123 $col['U_DELETE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'delete','col_id'=>$col['id'])); 124 124 125 125 if (isset($pwg_loaded_plugins['BatchDownloader'])) 126 126 { 127 $col['U_DOWNLOAD'] = USER_COLLEC_PUBLIC.'view/'.$col['public_id'].'&action=advdown_set';127 $col['U_DOWNLOAD'] = add_url_params(USER_COLLEC_PUBLIC.'view/'.$col['public_id'], array('action'=>'advdown_set')); 128 128 } 129 129 … … 132 132 { 133 133 $col['name'] = 'temp #'.$col['id']; 134 $col['U_SAVE'] = USER_COLLEC_PUBLIC.'&action=save&col_id='.$col['id'];134 $col['U_SAVE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'save','col_id'=>$col['id'])); 135 135 $template->append('temp_col', $col); 136 136 } … … 141 141 } 142 142 143 $template->assign('U_CREATE', USER_COLLEC_PUBLIC.'&action=new&col_id=0');143 $template->assign('U_CREATE', add_url_params(USER_COLLEC_PUBLIC, array('action'=>'new','col_id'=>'0'))); 144 144 break; 145 145 } … … 202 202 $col = $UserCollection->getCollectionInfo(); 203 203 $col['U_CLEAR'] = $self_url.'&action=clear'; 204 $col['U_DELETE'] = USER_COLLEC_PUBLIC.'&action=delete&col_id='.$page['col_id'];204 $col['U_DELETE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'delete','col_id'=>$page['col_id'])); 205 205 $template->assign('collection', $col); 206 206 -
extensions/UserCollections/include/events.inc.php
r16698 r17178 16 16 global $tokens, $page, $conf; 17 17 18 define('USER_COLLEC_PUBLIC', make_index_url(array('section' => 'collections')) . '/'); 19 18 20 if ($tokens[0] == 'collections') 19 21 { … … 35 37 } 36 38 } 37 38 // if ( script_basename() == 'picture' and @$tokens[1] == 'collections' and preg_match('#^[0-9]+$#', @$tokens[2]) )39 // {40 // try41 // {42 // $UserCollection = new UserCollection($tokens[2]);43 // $page['title'].= $conf['level_separator'].l10n('Collection').': <a href="'.USER_COLLEC_PUBLIC . 'view/'.$tokens[2].'">'.$UserCollection->getParam('name').'</a>';44 // $page['items'] = $UserCollection->getImages();45 // $page['col_id'] = $tokens[2];46 // } catch (Exception $e) {}47 // }48 39 } 49 40 … … 125 116 $template->assign(array( 126 117 'USER_COLLEC_PATH' => USER_COLLEC_PATH, 127 'collection_toggle_url' => $self_url,118 'collection_toggle_url' => add_url_params($self_url, array('collection_toggle'=>'')), 128 119 )); 129 120 $template->set_prefilter('index_thumbnails', 'user_collections_thumbnails_list_prefilter'); … … 137 128 $search = '<span class="wrap1">'; 138 129 $replace = $search.' 139 {strip}<a class="addCollection" href="{$collection_toggle_url} &collection_toggle={$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow">130 {strip}<a class="addCollection" href="{$collection_toggle_url}{$thumbnail.id}" data-id="{$thumbnail.id}" rel="nofollow"> 140 131 {if $COL_ID or $thumbnail.COLLECTION_SELECTED} 141 {\'Remove from collection\'|@translate} <img src="{$ USER_COLLEC_PATH}template/image_delete.png" title="{\'Remove from collection\'|@translate}">132 {\'Remove from collection\'|@translate} <img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_delete.png" title="{\'Remove from collection\'|@translate}"> 142 133 {else} 143 {\'Add to collection\'|@translate} <img src="{$ USER_COLLEC_PATH}template/image_add.png" title="{\'Add to collection\'|@translate}">134 {\'Add to collection\'|@translate} <img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_add.png" title="{\'Add to collection\'|@translate}"> 144 135 {/if} 145 136 </a>{/strip}'; … … 186 177 } 187 178 188 $url = duplicate_picture_url().'&action=collection_toggle';179 $url = add_url_params(duplicate_picture_url(), array('action'=>'collection_toggle')); 189 180 190 181 $button = ' 191 182 <a href="'.$url.'" title="'.($collection?l10n('Remove from collection'):l10n('Add to collection')).'" class="pwg-state-default pwg-button" rel="nofollow"> 192 <span class="pwg-icon" style="background:url(\''. USER_COLLEC_PATH.'template/image_'.($collection?'delete':'add').'.png\') center center no-repeat;"> </span>183 <span class="pwg-icon" style="background:url(\''.get_root_url().USER_COLLEC_PATH.'template/image_'.($collection?'delete':'add').'.png\') center center no-repeat;"> </span> 193 184 <span class="pwg-button-text">'.($collection?l10n('Remove from collection'):l10n('Add to collection')).'</span> 194 185 </a>'; 195 186 // $template->add_picture_button($button, 50); 196 187 $template->concat('PLUGIN_PICTURE_ACTIONS', $button); 197 188 } … … 242 233 243 234 $data['U_LIST'] = USER_COLLEC_PUBLIC; 244 $data['U_CREATE'] = USER_COLLEC_PUBLIC.'&action=new&col_id=0&redirect=true';235 $data['U_CREATE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'new','col_id'=>'0','redirect'=>'true')); 245 236 246 237 $template->set_template_dir(USER_COLLEC_PATH . 'template/'); -
extensions/UserCollections/main.inc.php
r16688 r17178 17 17 define('COLLECTION_IMAGES_TABLE',$prefixeTable.'collection_images'); 18 18 define('USER_COLLEC_ADMIN', get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__))); 19 define('USER_COLLEC_PUBLIC', make_index_url(array('section' => 'collections')) . '/');20 21 19 22 20 add_event_handler('init', 'user_collections_init'); -
extensions/UserCollections/template/thumbnails_css_js.tpl
r16698 r17178 13 13 jQuery.ajax({ldelim} 14 14 type: "POST", 15 url: "{$ USER_COLLEC_PATH}toggle_image.php",15 url: "{$ROOT_URL}{$USER_COLLEC_PATH}toggle_image.php", 16 16 data: {ldelim} {if $COL_ID}"col_id": "{$COL_ID}", {/if}"toggle_id": toggle_id } 17 17 }).done(function(msg) {ldelim} 18 18 if (msg == "true") {ldelim} 19 $trigger.html('{'Remove from collection'|@translate} <img src="{$ USER_COLLEC_PATH}template/image_delete.png" title="{'Remove from collection'|@translate}">');19 $trigger.html('{'Remove from collection'|@translate} <img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_delete.png" title="{'Remove from collection'|@translate}">'); 20 20 jQuery(".nbImagesCollec").html(parseInt(jQuery(".nbImagesCollec").html()) +1); 21 21 } else if (msg == "false") {ldelim} … … 24 24 if (typeof batchdown_count != 'undefined') batchdown_count-=1; 25 25 {else} 26 $trigger.html('{'Add to collection'|@translate} <img src="{$ USER_COLLEC_PATH}template/image_add.png" title="{'Add to collection'|@translate}">');26 $trigger.html('{'Add to collection'|@translate} <img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/image_add.png" title="{'Add to collection'|@translate}">'); 27 27 {/if} 28 28 jQuery(".nbImagesCollec").html(parseInt(jQuery(".nbImagesCollec").html()) -1);
Note: See TracChangeset
for help on using the changeset viewer.