Changeset 20093
- Timestamp:
- Jan 12, 2013, 7:23:05 PM (11 years ago)
- Location:
- extensions/UserCollections
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserCollections/admin/template/export.tpl
r20090 r20093 48 48 49 49 <p class="formButtons"> 50 <input type="submit" name="generate" value="{' Generate'|@translate}">50 <input type="submit" name="generate" value="{'Preview'|@translate}"> 51 51 <input type="submit" name="download" value="{'Download CSV file'|@translate}"> 52 52 </p> … … 54 54 55 55 <fieldset id="iframeWrapper" style="display:none;"> 56 <legend>{' Output'|@translate}</legend>56 <legend>{'Preview'|@translate}</legend> 57 57 <iframe src="" id="invokeFrame" name="invokeFrame"></iframe> 58 58 </fieldset> -
extensions/UserCollections/include/UserCollection.class.php
r20090 r20093 418 418 if ($result == false) 419 419 { 420 $_SESSION['page_errors'][] = l10n('Error while sending e-mail'); 421 } 422 else 423 { 424 $_SESSION['page_infos'][] = l10n('E-mail sent successfully'); 425 } 426 427 redirect(); 420 array_push($errors, l10n('Error while sending e-mail')); 421 } 428 422 } 429 423 … … 509 503 */ 510 504 function serialize($params) 511 { 505 { 506 $params = array_intersect($params, array('id','file','name','url','path')); 507 512 508 $content = null; 513 509 … … 532 528 533 529 $fp = fopen('php://temp', 'r+'); 530 fputcsv($fp, $params); 531 534 532 foreach ($pictures as $row) 535 533 { -
extensions/UserCollections/include/collections.inc.php
r20090 r20093 5 5 6 6 global $page, $template, $conf, $user, $tokens, $pwg_loaded_plugins; 7 8 $template->assign(array( 9 'USER_COLLEC_PATH' => USER_COLLEC_PATH, 10 'USER_COLLEC_ABS_PATH' => realpath(USER_COLLEC_PATH).'/', 11 )); 7 12 8 13 switch ($page['sub_section']) … … 158 163 159 164 $self_url = USER_COLLEC_PUBLIC . 'edit/'.$page['col_id']; 165 160 166 $template->assign(array( 161 167 'user_collections' => $conf['user_collections'], 162 'USER_COLLEC_PATH' => USER_COLLEC_PATH,163 168 'F_ACTION' => $self_url, 164 169 'collection_toggle_url' => $self_url, … … 222 227 $template->assign('uc_mail_errors', $errors); 223 228 } 229 else 230 { 231 array_push($page['infos'], l10n('E-mail sent successfully')); 232 } 224 233 } 225 234 … … 241 250 } 242 251 252 243 253 // add links for colorbox 244 254 add_event_handler('loc_end_index_thumbnails', 'user_collections_thumbnails_in_collection', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); … … 246 256 // add remove item links 247 257 $template->set_prefilter('index_thumbnails', 'user_collections_thumbnails_list_prefilter'); 248 249 // collection content250 $col = $UserCollection->getCollectionInfo();251 $col['DATE_CREATION'] = format_date($col['DATE_CREATION'], true);252 $col['U_CLEAR'] = $self_url.'&action=clear';253 $col['U_DELETE'] = add_url_params(USER_COLLEC_PUBLIC, array('action'=>'delete','col_id'=>$page['col_id']));254 $template->assign('collection', $col);255 $page['items'] = $UserCollection->getImages();256 257 // toolbar buttons258 $buttons = null;259 if ($conf['user_collections']['allow_public'] and $conf['user_collections']['allow_mails'])260 {261 $buttons.= '<li><a class="mail_colorbox_open" href="#mail_form" title="'.l10n('Send this collection my mail').'" class="pwg-state-default pwg-button" rel="nofollow" '.(!$col['PUBLIC']?'onClick="alert(\''.l10n('The collection must be public in order to send it').'\');return false;"':null).'>262 <span class="pwg-icon user-collections-delete-icon" style="background:url(\'' . get_root_url().USER_COLLEC_PATH . 'template/resources/mail.png\') center center no-repeat;"> </span><span class="pwg-button-text">'.l10n('Send').'</span>263 </a></li>';264 }265 $buttons.= '266 <li><a href="'. $col['U_CLEAR'] .'" title="'.l10n('Clear this collection').'" class="pwg-state-default pwg-button" rel="nofollow" onClick="return confirm(\''.l10n('Are you sure?').'\');">267 <span class="pwg-icon user-collections-delete-icon" style="background:url(\'' . get_root_url().USER_COLLEC_PATH . 'template/resources/bin.png\') center center no-repeat;"> </span><span class="pwg-button-text">'.l10n('Clear').'</span>268 </a></li>269 <li><a href="'. $col['U_DELETE'] .'" title="'.l10n('Delete this collection').'" class="pwg-state-default pwg-button" rel="nofollow" onClick="return confirm(\''.l10n('Are you sure?').'\');">270 <span class="pwg-icon user-collections-delete-icon" style="background:url(\'' . get_root_url().USER_COLLEC_PATH . 'template/resources/delete.png\') center center no-repeat;"> </span><span class="pwg-button-text">'.l10n('Delete').'</span>271 </a></li>';272 $template->concat('COLLECTION_ACTIONS', $buttons);273 258 274 259 // thumbnails … … 276 261 include(USER_COLLEC_PATH . '/include/display_thumbnails.inc.php'); 277 262 278 $template->concat('TITLE', $conf['level_separator'].$UserCollection->getParam('name')); 263 264 // collection properties 265 $col = $UserCollection->getCollectionInfo(); 266 $col['DATE_CREATION'] = format_date($col['DATE_CREATION'], true); 267 $template->assign('collection', $col); 268 269 // toolbar buttons 270 if (!empty($page['items'])) 271 { 272 $template->assign('U_CLEAR', 273 add_url_params($self_url, array('action'=>'clear') ) 274 ); 275 } 276 $template->assign('U_DELETE', 277 add_url_params(USER_COLLEC_PUBLIC, array('action'=>'delete','col_id'=>$page['col_id'])) 278 ); 279 if ($conf['user_collections']['allow_public'] and $conf['user_collections']['allow_mails']) 280 { 281 $template->assign('U_MAIL', true); 282 } 283 284 285 $template->concat('TITLE', 286 $conf['level_separator'].$UserCollection->getParam('name') 287 ); 279 288 } 280 289 catch (Exception $e) … … 302 311 try { 303 312 $UserCollection = new UserCollection($page['col_id']); 304 $page[' items'] = $UserCollection->getImages();313 $page['col_id'] = $UserCollection->getParam('id'); 305 314 306 315 // thumbnails … … 322 331 } 323 332 } 324 325 326 $template->assign(array(327 'USER_COLLEC_PATH' => USER_COLLEC_PATH,328 'USER_COLLEC_ABS_PATH' => realpath(USER_COLLEC_PATH).'/',329 ));330 333 331 334 -
extensions/UserCollections/include/display_thumbnails.inc.php
r20090 r20093 2 2 defined('USER_COLLEC_PATH') or die('Hacking attempt!'); 3 3 4 if (defined('USER_COLLEC_REMOVE_GTHUMB')) 4 5 // caddie 6 if (isset($_GET['uc_caddie'])) 5 7 { 6 global $uc_nb_image_page_save; 8 fill_caddie($page['items']); 9 redirect($self_url); 10 } 7 11 8 $user['nb_image_page'] = $uc_nb_image_page_save['user']; 9 $page['nb_image_page'] = $uc_nb_image_page_save['page']; 10 remove_event_handler('loc_end_index_thumbnails', 'process_GThumb', 50); 11 remove_event_handler('loc_end_index', 'GThumb_remove_thumb_size'); 12 // image order 13 if (isset($_GET['uc_image_order'])) 14 { 15 if ( (int)$_GET['uc_image_order'] > 0) 16 { 17 pwg_set_session_var('uc_image_order', (int)$_GET['uc_image_order']); 18 } 19 else 20 { 21 pwg_unset_session_var('uc_image_order'); 22 } 23 redirect($self_url); 12 24 } 25 26 // get sorted elements 27 $image_order_id = pwg_get_session_var('uc_image_order', 0); 28 $orders = get_collection_preferred_image_orders(); 29 30 $query = ' 31 SELECT i.id 32 FROM '.IMAGES_TABLE.' AS i 33 JOIN '.COLLECTION_IMAGES_TABLE.' AS ci 34 ON i.id = ci.image_id 35 AND ci.col_id = '.$page['col_id'].' 36 ORDER BY '.$orders[$image_order_id][1].' 37 ;'; 38 $page['items'] = array_from_query($query, 'id'); 39 40 // image order menu 41 if ( $conf['index_sort_order_input'] 42 and count($page['items']) > 0) 43 { 44 $url = add_url_params($self_url, array('uc_image_order' => '')); 45 46 foreach ($orders as $order_id => $order) 47 { 48 if ($order[2]) 49 { 50 $template->append( 51 'image_orders', 52 array( 53 'DISPLAY' => $order[0], 54 'URL' => $url.$order_id, 55 'SELECTED' => ($image_order_id == $order_id ? true:false), 56 ) 57 ); 58 } 59 } 60 } 61 13 62 14 63 // navigation bar … … 26 75 } 27 76 77 28 78 // display 79 if (defined('USER_COLLEC_REMOVE_GTHUMB')) 80 { 81 global $uc_nb_image_page_save; 82 83 $user['nb_image_page'] = $uc_nb_image_page_save['user']; 84 $page['nb_image_page'] = $uc_nb_image_page_save['page']; 85 remove_event_handler('loc_end_index_thumbnails', 'process_GThumb', 50); 86 remove_event_handler('loc_end_index', 'GThumb_remove_thumb_size'); 87 } 88 29 89 include(PHPWG_ROOT_PATH . 'include/category_default.inc.php'); 30 90 31 // multisize link32 $url = add_url_params(33 $self_url,34 array('display' => '')35 );36 37 $selected_type = $template->get_template_vars('derivative_params')->type;38 $template->clear_assign( 'derivative_params' );39 $type_map = ImageStdParams::get_defined_type_map();40 unset($type_map[IMG_XXLARGE], $type_map[IMG_XLARGE]);41 91 42 foreach($type_map as $params) 92 // multisize menu 93 if ( !empty($page['items']) ) 43 94 { 44 $template->append( 45 'image_derivatives', 46 array( 47 'DISPLAY' => l10n($params->type), 48 'URL' => $url.$params->type, 49 'SELECTED' => ($params->type == $selected_type ? true:false), 50 ) 95 $url = add_url_params($self_url, array('display' => '')); 96 97 $selected_type = $template->get_template_vars('derivative_params')->type; 98 $template->clear_assign( 'derivative_params' ); 99 $type_map = ImageStdParams::get_defined_type_map(); 100 unset($type_map[IMG_XXLARGE], $type_map[IMG_XLARGE]); 101 102 foreach($type_map as $params) 103 { 104 $template->append( 105 'image_derivatives', 106 array( 107 'DISPLAY' => l10n($params->type), 108 'URL' => $url.$params->type, 109 'SELECTED' => ($params->type == $selected_type ? true:false), 110 ) 111 ); 112 } 113 } 114 115 116 // caddie link 117 if (is_admin() and !empty($page['items'])) 118 { 119 $template->assign('U_CADDIE', 120 add_url_params($self_url, array('uc_caddie'=>1) ) 51 121 ); 52 122 } -
extensions/UserCollections/include/events.inc.php
r20090 r20093 182 182 $button = ' 183 183 <a href="'.$url.'" title="'.($collection?l10n('Remove from collection'):l10n('Add to collection')).'" class="pwg-state-default pwg-button" rel="nofollow"> 184 <span class="pwg-icon" style="background:url(\''.get_root_url().USER_COLLEC_PATH.'template/ image_'.($collection?'delete':'add').'.png\') center center no-repeat;"> </span>184 <span class="pwg-icon" style="background:url(\''.get_root_url().USER_COLLEC_PATH.'template/resources/image_'.($collection?'delete':'add').'.png\') center center no-repeat;"> </span> 185 185 <span class="pwg-button-text">'.($collection?l10n('Remove from collection'):l10n('Add to collection')).'</span> 186 186 </a>'; -
extensions/UserCollections/include/functions.inc.php
r20090 r20093 52 52 } 53 53 54 function get_collection_preferred_image_orders() 55 { 56 global $conf, $page; 57 58 return trigger_event('get_category_preferred_image_orders', array( 59 array(l10n('Date added to collection, new → old'), 'add_date DESC', true), 60 array(l10n('Date added to collection, old → new'), 'add_date ASC', true), 61 array(l10n('Photo title, A → Z'), 'name ASC', true), 62 array(l10n('Photo title, Z → A'), 'name DESC', true), 63 array(l10n('Date created, new → old'), 'date_creation DESC', true), 64 array(l10n('Date created, old → new'), 'date_creation ASC', true), 65 array(l10n('Date posted, new → old'), 'date_available DESC', true), 66 array(l10n('Date posted, old → new'), 'date_available ASC', true), 67 array(l10n('Rating score, high → low'), 'rating_score DESC', $conf['rate']), 68 array(l10n('Rating score, low → high'), 'rating_score ASC', $conf['rate']), 69 array(l10n('Visits, high → low'), 'hit DESC', true), 70 array(l10n('Visits, low → high'), 'hit ASC', true), 71 )); 72 } 73 54 74 ?> -
extensions/UserCollections/language/en_UK/plugin.lang.php
r20090 r20093 33 33 $lang['Active'] = 'Active'; 34 34 $lang['Inactive'] = 'Inactive'; 35 $lang['Generate'] = 'Generate';36 35 $lang['Download CSV file'] = 'Download CSV file'; 37 $lang[' Output'] = 'Output';36 $lang['Preview'] = 'Preview'; 38 37 $lang['Number of images'] = 'Number of images'; 39 38 $lang['Edit this collection'] = 'Edit this collection'; … … 57 56 $lang['Hello <b>%s</b>, %s sent you a photos collection from <a href="%s">%s</a>'] = 'Hello <b>%s</b>, %s sent you a photos collection from <a href="%s">%s</a>'; 58 57 $lang['Click here to view the complete collection'] = 'Click here to view the complete collection'; 58 $lang['Date added to collection, new → old'] = 'Date added to collection, new → old'; 59 $lang['Date added to collection, old → new'] = 'Date added to collection, old → new'; 60 59 61 60 62 ?> -
extensions/UserCollections/language/fr_FR/plugin.lang.php
r20090 r20093 33 33 $lang['Active'] = 'Actifs'; 34 34 $lang['Inactive'] = 'Inactifs'; 35 $lang['Generate'] = 'Générer';36 35 $lang['Download CSV file'] = 'Télécharger le fichier CSV'; 37 $lang[' Output'] = 'Aperçu';36 $lang['Preview'] = 'Aperçu'; 38 37 $lang['Number of images'] = 'Nombre d\'images'; 39 38 $lang['Edit this collection'] = 'Editer celle collection'; … … 57 56 $lang['Hello <b>%s</b>, %s sent you a photos collection from <a href="%s">%s</a>'] = 'Bonjour <b>%s</b>, %s vous a envoyé une collection de photos depuis <a href="%s">%s</a>'; 58 57 $lang['Click here to view the complete collection'] = 'Cliquez ici pour voir la collection complète'; 58 $lang['Date added to collection, new → old'] = 'Date d\'ajout à la collection, récent → ancien'; 59 $lang['Date added to collection, old → new'] = 'Date d\'ajout à la collection, ancien → récent'; 59 60 60 61 ?> -
extensions/UserCollections/template/themes/default.tpl
r20090 r20093 5 5 <div class="titrePage"> 6 6 <ul class="categoryActions"> 7 {if !empty($image_orders)} 8 <li>{strip}<a id="sortOrderLink" title="{'Sort order'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> 9 <span class="pwg-icon pwg-icon-sort"> </span><span class="pwg-button-text">{'Sort order'|@translate}</span> 10 </a> 11 <div id="sortOrderBox" class="switchBox"> 12 <div class="switchBoxTitle">{'Sort order'|@translate}</div> 13 {foreach from=$image_orders item=image_order name=loop}{if !$smarty.foreach.loop.first}<br>{/if} 14 {if $image_order.SELECTED} 15 <span>✔ </span>{$image_order.DISPLAY} 16 {else} 17 <span style="visibility:hidden">✔ </span><a href="{$image_order.URL}" rel="nofollow">{$image_order.DISPLAY}</a> 18 {/if} 19 {/foreach} 20 </div> 21 {footer_script require='jquery'}{literal} 22 jQuery("#sortOrderLink").click(function() { 23 var elt = jQuery("#sortOrderBox"); 24 elt.css("left", Math.min( jQuery(this).offset().left, jQuery(window).width() - elt.outerWidth(true) - 5)) 25 .css("top", jQuery(this).offset().top + jQuery(this).outerHeight(true)) 26 .toggle(); 27 }); 28 jQuery("#sortOrderBox").on("mouseleave", function() { 29 jQuery(this).hide(); 30 }); 31 {/literal}{/footer_script} 32 {/strip}</li> 33 {/if} 7 34 {if !empty($image_derivatives)} 8 35 <li>{strip}<a id="derivativeSwitchLink" title="{'Photo sizes'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> … … 32 59 {/strip}</li> 33 60 {/if} 61 {if isset($U_CADDIE)} 62 <li><a href="{$U_CADDIE}" title="{'Add to caddie'|@translate}" class="pwg-state-default pwg-button"> 63 <span class="pwg-icon pwg-icon-caddie-add"> </span><span class="pwg-button-text">{'Caddie'|@translate}</span> 64 </a></li> 65 {/if} 66 67 {if $U_MAIL} 68 <li><a href="#mail_form" title="{'Send this collection my mail'|@translate}" class="mail_colorbox_open pwg-state-default pwg-button" rel="nofollow" 69 {if not $collection.PUBLIC}onClick="alert('{'The collection must be public in order to send it'|@translate|escape:javascript}');return false;"{/if}> 70 <span class="pwg-icon user-collections-mail-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/mail.png') center center no-repeat;"> </span><span class="pwg-button-text">{'Send'|@translate}</span> 71 </a></li> 72 {/if} 73 {if $U_CLEAR} 74 <li><a href="{$U_CLEAR}" title="{'Clear this collection'|@translate}" class="pwg-state-default pwg-button" rel="nofollow" onClick="return confirm('{'Are you sure?'|@translate|escape:javascript}');"> 75 <span class="pwg-icon user-collections-clear-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/bin.png') center center no-repeat;"> </span><span class="pwg-button-text">{'Clear'|@translate}</span> 76 </a></li> 77 {/if} 78 {if $U_DELETE} 79 <li><a href="{$U_DELETE}" title="{'Delete this collection'|@translate}" class="pwg-state-default pwg-button" rel="nofollow" onClick="return confirm('{'Are you sure?'|@translate|escape:javascript}');"> 80 <span class="pwg-icon user-collections-delete-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/delete.png') center center no-repeat;"> </span><span class="pwg-button-text">{'Delete'|@translate}</span> 81 </a></li> 82 {/if} 34 83 35 84 {if !empty($COLLECTION_ACTIONS)} -
extensions/UserCollections/template/themes/simple.tpl
r17519 r20093 3 3 <h2>{$TITLE}</h2> 4 4 5 <ul class="categoryActions"> 6 {if $U_MAIL} 7 <li><a href="#mail_form" title="{'Send this collection my mail'|@translate}" class="mail_colorbox_open pwg-state-default pwg-button" rel="nofollow" 8 {if not $collection.PUBLIC}onClick="alert('{'The collection must be public in order to send it'|@translate|escape:javascript}');return false;"{/if}> 9 <span class="pwg-icon user-collections-mail-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/mail.png') center center no-repeat;"> </span><span class="pwg-button-text">{'Send'|@translate}</span> 10 </a></li> 11 {/if} 12 {if $U_CLEAR} 13 <li><a href="{$U_CLEAR}" title="{'Clear this collection'|@translate}" class="pwg-state-default pwg-button" rel="nofollow" onClick="return confirm('{'Are you sure?'|@translate|escape:javascript}');"> 14 <span class="pwg-icon user-collections-clear-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/bin.png') center center no-repeat;"> </span><span class="pwg-button-text">{'Clear'|@translate}</span> 15 </a></li> 16 {/if} 17 {if $U_DELETE} 18 <li><a href="{$U_DELETE}" title="{'Delete this collection'|@translate}" class="pwg-state-default pwg-button" rel="nofollow" onClick="return confirm('{'Are you sure?'|@translate|escape:javascript}');"> 19 <span class="pwg-icon user-collections-delete-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/delete.png') center center no-repeat;"> </span><span class="pwg-button-text">{'Delete'|@translate}</span> 20 </a></li> 21 {/if} 22 5 23 {if !empty($COLLECTION_ACTIONS)} 6 <ul class="categoryActions">7 24 {$COLLECTION_ACTIONS} 25 {/if} 8 26 </ul> 9 {/if}10 27 </div> 11 28 -
extensions/UserCollections/template/themes/stripped.tpl
r17519 r20093 5 5 </div> 6 6 7 {if !empty($COLLECTION_ACTIONS)} 8 <div class="categoryActionsContainer"> 9 <ul class="categoryActions group1"> 10 {$COLLECTION_ACTIONS} 11 </ul> 12 </div> 13 {/if} 7 <div class="categoryActionsContainer"> 8 <ul class="categoryActions group1"> 9 {if isset($U_CADDIE) } 10 <li class="mainAction"><a href="{$U_CADDIE}" title="{'add to caddie'|@translate}">{'caddie'|@translate}</a></li> 11 {/if} 12 13 {if $U_MAIL} 14 <li><a href="#mail_form" title="{'Send this collection my mail'|@translate}" class="mail_colorbox_open pwg-state-default pwg-button" rel="nofollow" 15 {if not $collection.PUBLIC}onClick="alert('{'The collection must be public in order to send it'|@translate|escape:javascript}');return false;"{/if}> 16 <span class="pwg-icon user-collections-mail-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/mail.png') center center no-repeat;"> </span><span class="pwg-button-text">{'Send'|@translate}</span> 17 </a></li> 18 {/if} 19 {if $U_CLEAR} 20 <li><a href="{$U_CLEAR}" title="{'Clear this collection'|@translate}" class="pwg-state-default pwg-button" rel="nofollow" onClick="return confirm('{'Are you sure?'|@translate|escape:javascript}');"> 21 <span class="pwg-icon user-collections-clear-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/bin.png') center center no-repeat;"> </span><span class="pwg-button-text">{'Clear'|@translate}</span> 22 </a></li> 23 {/if} 24 {if $U_DELETE} 25 <li><a href="{$colelction.U_DELETE}" title="{'Delete this collection'|@translate}" class="pwg-state-default pwg-button" rel="nofollow" onClick="return confirm('{'Are you sure?'|@translate|escape:javascript}');"> 26 <span class="pwg-icon user-collections-delete-icon" style="background:url('{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/delete.png') center center no-repeat;"> </span><span class="pwg-button-text">{'Delete'|@translate}</span> 27 </a></li> 28 {/if} 29 30 {if !empty($COLLECTION_ACTIONS)} 31 {$COLLECTION_ACTIONS} 32 {/if} 33 </ul> 34 </div> 14 35 </div> 15 36
Note: See TracChangeset
for help on using the changeset viewer.