Changeset 25678 for extensions/UserCollections/admin
- Timestamp:
- Nov 24, 2013, 6:09:57 PM (11 years ago)
- Location:
- extensions/UserCollections/admin
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserCollections/admin/config.php
r24421 r25678 8 8 'allow_mails' => isset($_POST['allow_mails']) && isset($_POST['allow_public']), 9 9 ); 10 10 11 11 conf_update_param('user_collections', serialize($conf['user_collections'])); 12 12 } … … 18 18 19 19 $template->set_filename('user_collections', realpath(USER_COLLEC_PATH . 'admin/template/config.tpl')); 20 21 ?> -
extensions/UserCollections/admin/export.php
r24421 r25678 4 4 try { 5 5 $collection = new UserCollection($_GET['col_id']); 6 6 7 7 $template->assign('COL_ID', $_GET['col_id']); 8 8 } … … 19 19 pwg_set_session_var('uc_export_active_fields', $_POST['active']); 20 20 pwg_set_session_var('uc_export_inactive_fields', $_POST['inactive']); 21 21 22 22 $content = $collection->serialize($_POST['active']); 23 23 $filename = 'collection_'.$_GET['col_id'].'_'.date('Ymd-Hi').'.csv'; 24 24 25 25 header('Content-Type: application/force-download; name="'.$filename.'"'); 26 26 header('Content-Disposition: attachment; filename="'.$filename.'"'); … … 32 32 header('Pragma: no-cache'); 33 33 header('Expires: 0'); 34 34 35 35 echo $content; 36 36 exit; … … 55 55 $template->assign('inactive_fields', pwg_get_session_var('uc_export_inactive_fields', $default_inactive_fields)); 56 56 57 57 58 $template->set_filename('user_collections', realpath(USER_COLLEC_PATH . 'admin/template/export.tpl')); 58 59 ?> -
extensions/UserCollections/admin/index.php
r20090 r25678 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based photo gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2012 Piwigo Team http://piwigo.org |6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |8 // +-----------------------------------------------------------------------+9 // | This program is free software; you can redistribute it and/or modify |10 // | it under the terms of the GNU General Public License as published by |11 // | the Free Software Foundation |12 // | |13 // | This program is distributed in the hope that it will be useful, but |14 // | WITHOUT ANY WARRANTY; without even the implied warranty of |15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |16 // | General Public License for more details. |17 // | |18 // | You should have received a copy of the GNU General Public License |19 // | along with this program; if not, write to the Free Software |20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |21 // | USA. |22 // +-----------------------------------------------------------------------+23 24 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); … … 28 5 header( 'Location: '.$url ); 29 6 exit(); 30 ?> -
extensions/UserCollections/admin/sets.php
r24421 r25678 19 19 array_push($where_clauses, 'username LIKE "%'.$_POST['username'].'%"'); 20 20 } 21 21 22 22 if (!empty($_POST['name'])) 23 23 { 24 24 array_push($where_clauses, 'name LIKE "%'.$_POST['name'].'%"'); 25 25 } 26 26 27 27 $order_by = $_POST['order_by'].' '.$_POST['direction']; 28 28 } … … 31 31 // get sets 32 32 $query = ' 33 SELECT 33 SELECT 34 34 c.*, 35 35 u.'.$conf['user_fields']['username'].' AS username … … 46 46 { 47 47 $template->append('sets', array( 48 'NAME' => trigger_ event('render_category_name', $row['name']),48 'NAME' => trigger_change('render_category_name', $row['name']), 49 49 'NB_IMAGES' => $row['nb_images'], 50 50 'DATE_CREATION' => format_date($row['date_creation'], true), … … 74 74 'direction_options' => $page['direction_items'], 75 75 'direction_selected' => isset($_POST['direction']) ? $_POST['direction'] : '', 76 76 77 77 'F_USERNAME' => @htmlentities($_POST['username'], ENT_COMPAT, 'UTF-8'), 78 78 'F_NAME' => @htmlentities($_POST['name'], ENT_COMPAT, 'UTF-8'), … … 82 82 83 83 $template->set_filename('user_collections', realpath(USER_COLLEC_PATH . 'admin/template/sets.tpl')); 84 85 ?> -
extensions/UserCollections/admin/template/config.tpl
r24421 r25678 1 {combine_css path=$USER_COLLEC_PATH| @cat:"admin/template/style.css"}1 {combine_css path=$USER_COLLEC_PATH|cat:'admin/template/style.css'} 2 2 3 {footer_script} {literal}4 $( "input[name='allow_public']").on("change", function() {5 $( "#allow_mails").toggle($(this).is(":checked"));3 {footer_script} 4 $('input[name="allow_public"]').on('change', function() { 5 $('#allow_mails').toggle($(this).is(':checked')); 6 6 }); 7 {/ literal}{/footer_script}7 {/footer_script} 8 8 9 9 <div class="titrePage"> … … 17 17 <label> 18 18 <input type="checkbox" name="allow_public" {if $user_collections.allow_public}checked="checked"{/if}> 19 <b>{'Allow users to set their collections as public'| @translate}</b>19 <b>{'Allow users to set their collections as public'|translate}</b> 20 20 </label> 21 21 </li> … … 23 23 <label> 24 24 <input type="checkbox" name="allow_mails" {if $user_collections.allow_mails}checked="checked"{/if}> 25 <b>{'Allow users to send their public collections by mail'| @translate}</b>25 <b>{'Allow users to send their public collections by mail'|translate}</b> 26 26 </label> 27 27 </li> … … 29 29 </fieldset> 30 30 31 <p class="formButtons"><input type="submit" name="save_config" value="{'Save Settings'| @translate}"></p>31 <p class="formButtons"><input type="submit" name="save_config" value="{'Save Settings'|translate}"></p> 32 32 </form> -
extensions/UserCollections/admin/template/export.tpl
r20099 r25678 1 {combine_css path=$USER_COLLEC_PATH| @cat:"admin/template/style.css"}1 {combine_css path=$USER_COLLEC_PATH|cat:'admin/template/style.css'} 2 2 3 {footer_script require='jquery.ui.sortable'} {literal}4 $( "#fields_active, #fields_inactive").sortable({5 connectWith: ".connectedSortable",6 items: "> li",7 placeholder: "sortable-moving"3 {footer_script require='jquery.ui.sortable'} 4 $('#fields_active, #fields_inactive').sortable({ 5 connectWith: '.connectedSortable', 6 items: '> li', 7 placeholder: 'sortable-moving' 8 8 }).disableSelection(); 9 9 10 $( "input[name='generate']").click(function() {11 query = "ws.php?format=rest&method=pwg.collections.getSerialized&col_id={/literal}{$COL_ID}{literal}";12 $( "#fields_active li").each(function() {10 $('input[name="generate"]').click(function() { 11 query = 'ws.php?format=rest&method=pwg.collections.getSerialized&col_id={$COL_ID}'; 12 $('#fields_active li').each(function() { 13 13 query+= '&content[]='+ $(this).data('name'); 14 14 }); 15 16 $( "#iframeWrapper").show();17 $( "#invokeFrame").attr('src', query);18 15 16 $('#iframeWrapper').show(); 17 $('#invokeFrame').attr('src', query); 18 19 19 return false; 20 20 }); 21 21 22 $( "#invokeFrame").load(function() {22 $('#invokeFrame').load(function() { 23 23 $(this).css('height', $(this).contents().find('body').outerHeight(true)+10); 24 24 }); 25 25 26 $( "input[name='download']").click(function() {27 $( "#fields_active li").each(function() {28 $( "#export_form").append('<input type="hidden" name="active[]" value="'+ $(this).data('name') +'"/>');26 $('input[name="download"]').click(function() { 27 $('#fields_active li').each(function() { 28 $('#export_form').append('<input type="hidden" name="active[]" value="'+ $(this).data('name') +'"/>'); 29 29 }); 30 $( "#fields_inactive li").each(function() {31 $( "#export_form").append('<input type="hidden" name="inactive[]" value="'+ $(this).data('name') +'"/>');30 $('#fields_inactive li').each(function() { 31 $('#export_form').append('<input type="hidden" name="inactive[]" value="'+ $(this).data('name') +'"/>'); 32 32 }); 33 33 }); 34 {/ literal}{/footer_script}34 {/footer_script} 35 35 36 36 <div class="titrePage"> … … 41 41 <form method="post" action="" class="properties" id="export_form"> 42 42 <fieldset> 43 <legend>{'Fields'| @translate}</legend>43 <legend>{'Fields'|translate}</legend> 44 44 <ul id="fields_active" class="connectedSortable"> 45 <h4>{'Active'| @translate}</h4>45 <h4>{'Active'|translate}</h4> 46 46 {foreach from=$active_fields item=field} 47 47 <li data-name="{$field}"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> {$field}</li> … … 49 49 </ul> 50 50 <ul id="fields_inactive" class="connectedSortable"> 51 <h4>{'Inactive'| @translate}</h4>51 <h4>{'Inactive'|translate}</h4> 52 52 {foreach from=$inactive_fields item=field} 53 53 <li data-name="{$field}"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> {$field}</li> 54 54 {/foreach} 55 55 </ul> 56 56 57 57 <p class="formButtons"> 58 <input type="submit" name="generate" value="{'Preview'| @translate}">59 <input type="submit" name="download" value="{'Download CSV file'| @translate}">60 </p> 58 <input type="submit" name="generate" value="{'Preview'|translate}"> 59 <input type="submit" name="download" value="{'Download CSV file'|translate}"> 60 </p> 61 61 </fieldset> 62 62 63 63 <fieldset id="iframeWrapper" style="display:none;"> 64 <legend>{'Preview'| @translate}</legend>64 <legend>{'Preview'|translate}</legend> 65 65 <iframe src="" id="invokeFrame" name="invokeFrame"></iframe> 66 66 </fieldset> -
extensions/UserCollections/admin/template/index.php
r20090 r25678 1 1 <?php 2 // +-----------------------------------------------------------------------+3 // | Piwigo - a PHP based photo gallery |4 // +-----------------------------------------------------------------------+5 // | Copyright(C) 2008-2012 Piwigo Team http://piwigo.org |6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |8 // +-----------------------------------------------------------------------+9 // | This program is free software; you can redistribute it and/or modify |10 // | it under the terms of the GNU General Public License as published by |11 // | the Free Software Foundation |12 // | |13 // | This program is distributed in the hope that it will be useful, but |14 // | WITHOUT ANY WARRANTY; without even the implied warranty of |15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |16 // | General Public License for more details. |17 // | |18 // | You should have received a copy of the GNU General Public License |19 // | along with this program; if not, write to the Free Software |20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |21 // | USA. |22 // +-----------------------------------------------------------------------+23 24 // Recursive call25 2 $url = '../'; 26 3 header( 'Request-URI: '.$url ); … … 28 5 header( 'Location: '.$url ); 29 6 exit(); 30 ?> -
extensions/UserCollections/admin/template/sets.tpl
r24421 r25678 1 {combine_css path=$USER_COLLEC_PATH| @cat:"admin/template/style.css"}1 {combine_css path=$USER_COLLEC_PATH|cat:'admin/template/style.css'} 2 2 3 3 <div class="titrePage"> … … 7 7 <form class="filter" method="post" name="filter" action="{$F_FILTER_ACTION}"> 8 8 <fieldset> 9 <legend>{'Filter'| @translate}</legend>9 <legend>{'Filter'|translate}</legend> 10 10 <input type="hidden" name="page" value="user_list"> 11 11 12 <label>{'Name'| @translate} <input type="text" name="name" value="{$F_NAME}"></label>13 14 <label>{'Username'| @translate} <input type="text" name="username" value="{$F_USERNAME}"></label>12 <label>{'Name'|translate} <input type="text" name="name" value="{$F_NAME}"></label> 13 14 <label>{'Username'|translate} <input type="text" name="username" value="{$F_USERNAME}"></label> 15 15 16 16 <label> 17 {'Sort by'| @translate}17 {'Sort by'|translate} 18 18 {html_options name=order_by options=$order_options selected=$order_selected} 19 19 </label> 20 20 21 21 <label> 22 {'Sort order'| @translate}22 {'Sort order'|translate} 23 23 {html_options name=direction options=$direction_options selected=$direction_selected} 24 24 </label> … … 26 26 <label> 27 27 28 <span><input class="submit" type="submit" name="filter" value="{'Submit'| @translate}"> <a href="{$F_FILTER_ACTION}">{'Reset'|@translate}</a></span>28 <span><input class="submit" type="submit" name="filter" value="{'Submit'|translate}"> <a href="{$F_FILTER_ACTION}">{'Reset'|translate}</a></span> 29 29 </label> 30 30 … … 36 36 <thead> 37 37 <tr class="throw"> 38 <td class="name">{'Name'| @translate}</td>39 <td class="user">{'Username'| @translate}</td>40 <td class="date">{'Creation date'| @translate}</td>41 <td class="images">{'Number of images'| @translate}</td>42 <td class="action">{'Actions'| @translate}</td>38 <td class="name">{'Name'|translate}</td> 39 <td class="user">{'Username'|translate}</td> 40 <td class="date">{'Creation date'|translate}</td> 41 <td class="images">{'Number of images'|translate}</td> 42 <td class="action">{'Actions'|translate}</td> 43 43 </tr> 44 44 </thead> … … 53 53 <td>{$set.NB_IMAGES}</td> 54 54 <td style="padding-left:25px;"> 55 <a href="{$set.U_EDIT}" title="{'Edit this collection'| @translate}"><img src="{$themeconf.admin_icon_dir}/edit_s.png"></a>56 <a href="{$set.U_EXPORT}" title="{'Export image list'| @translate}"><img src="{$themeconf.admin_icon_dir}/plug_install.png"><span class="icon-upload"></span></a> <!-- temp 2.5/2.6 -->57 <a href="{$set.U_DELETE}" title="{'Delete this collection'| @translate}" onClick="return confirm('{'Are you sure?'|@translate}');"><img src="{$themeconf.admin_icon_dir}/delete.png"></a>55 <a href="{$set.U_EDIT}" title="{'Edit this collection'|translate}"><img src="{$themeconf.admin_icon_dir}/edit_s.png"></a> 56 <a href="{$set.U_EXPORT}" title="{'Export image list'|translate}"><img src="{$themeconf.admin_icon_dir}/plug_install.png"><span class="icon-upload"></span></a> <!-- temp 2.5/2.6 --> 57 <a href="{$set.U_DELETE}" title="{'Delete this collection'|translate}" onClick="return confirm('{'Are you sure?'|translate}');"><img src="{$themeconf.admin_icon_dir}/delete.png"></a> 58 58 </td> 59 59 </tr> 60 60 {/foreach} 61 61 62 62 {if not $sets} 63 63 <tr class="row2"> 64 <td colspan="8" style="text-align:center;font-style:italic;">{'No results'| @translate}</td>64 <td colspan="8" style="text-align:center;font-style:italic;">{'No results'|translate}</td> 65 65 </tr> 66 66 {/if} -
extensions/UserCollections/admin/template/style.css
r20099 r25678 93 93 opacity:0.5; 94 94 } 95 95 96 96 #invokeFrame { 97 97 width:100%;
Note: See TracChangeset
for help on using the changeset viewer.