Ignore:
Timestamp:
Nov 24, 2013, 6:09:57 PM (11 years ago)
Author:
mistic100
Message:

very big update for Piwigo 2.6

Location:
extensions/UserCollections/admin
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserCollections/admin/config.php

    r24421 r25678  
    88    'allow_mails'     => isset($_POST['allow_mails']) && isset($_POST['allow_public']),
    99    );
    10  
     10
    1111  conf_update_param('user_collections', serialize($conf['user_collections']));
    1212}
     
    1818
    1919$template->set_filename('user_collections', realpath(USER_COLLEC_PATH . 'admin/template/config.tpl'));
    20 
    21 ?>
  • extensions/UserCollections/admin/export.php

    r24421 r25678  
    44try {
    55  $collection = new UserCollection($_GET['col_id']);
    6  
     6
    77  $template->assign('COL_ID', $_GET['col_id']);
    88}
     
    1919  pwg_set_session_var('uc_export_active_fields', $_POST['active']);
    2020  pwg_set_session_var('uc_export_inactive_fields', $_POST['inactive']);
    21  
     21
    2222  $content = $collection->serialize($_POST['active']);
    2323  $filename = 'collection_'.$_GET['col_id'].'_'.date('Ymd-Hi').'.csv';
    24  
     24
    2525  header('Content-Type: application/force-download; name="'.$filename.'"');
    2626  header('Content-Disposition: attachment; filename="'.$filename.'"');
     
    3232  header('Pragma: no-cache');
    3333  header('Expires: 0');
    34  
     34
    3535  echo $content;
    3636  exit;
     
    5555$template->assign('inactive_fields', pwg_get_session_var('uc_export_inactive_fields', $default_inactive_fields));
    5656
     57
    5758$template->set_filename('user_collections', realpath(USER_COLLEC_PATH . 'admin/template/export.tpl'));
    58 
    59 ?>
  • extensions/UserCollections/admin/index.php

    r20090 r25678  
    11<?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 call
    252$url = '../';
    263header( 'Request-URI: '.$url );
     
    285header( 'Location: '.$url );
    296exit();
    30 ?>
  • extensions/UserCollections/admin/sets.php

    r24421 r25678  
    1919    array_push($where_clauses, 'username LIKE "%'.$_POST['username'].'%"');
    2020  }
    21  
     21
    2222  if (!empty($_POST['name']))
    2323  {
    2424    array_push($where_clauses, 'name LIKE "%'.$_POST['name'].'%"');
    2525  }
    26  
     26
    2727  $order_by = $_POST['order_by'].' '.$_POST['direction'];
    2828}
     
    3131// get sets
    3232$query = '
    33 SELECT 
     33SELECT
    3434    c.*,
    3535    u.'.$conf['user_fields']['username'].' AS username
     
    4646{
    4747  $template->append('sets', array(
    48     'NAME' => trigger_event('render_category_name', $row['name']),
     48    'NAME' => trigger_change('render_category_name', $row['name']),
    4949    'NB_IMAGES' => $row['nb_images'],
    5050    'DATE_CREATION' => format_date($row['date_creation'], true),
     
    7474  'direction_options' => $page['direction_items'],
    7575  'direction_selected' => isset($_POST['direction']) ? $_POST['direction'] : '',
    76  
     76
    7777  'F_USERNAME' => @htmlentities($_POST['username'], ENT_COMPAT, 'UTF-8'),
    7878  'F_NAME' => @htmlentities($_POST['name'], ENT_COMPAT, 'UTF-8'),
     
    8282
    8383$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'}
    22
    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'));
    66});
    7 {/literal}{/footer_script}
     7{/footer_script}
    88
    99<div class="titrePage">
     
    1717      <label>
    1818        <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>
    2020      </label>
    2121    </li>
     
    2323      <label>
    2424        <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>
    2626      </label>
    2727    </li>
     
    2929</fieldset>
    3030
    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>
    3232</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'}
    22
    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'
    88}).disableSelection();
    99
    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() {
    1313    query+= '&content[]='+ $(this).data('name');
    1414  });
    15  
    16   $("#iframeWrapper").show();
    17   $("#invokeFrame").attr('src', query);
    18  
     15
     16  $('#iframeWrapper').show();
     17  $('#invokeFrame').attr('src', query);
     18
    1919  return false;
    2020});
    2121
    22 $("#invokeFrame").load(function() {
     22$('#invokeFrame').load(function() {
    2323  $(this).css('height', $(this).contents().find('body').outerHeight(true)+10);
    2424});
    2525
    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') +'"/>');
    2929  });
    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') +'"/>');
    3232  });
    3333});
    34 {/literal}{/footer_script}
     34{/footer_script}
    3535
    3636<div class="titrePage">
     
    4141<form method="post" action="" class="properties" id="export_form">
    4242<fieldset>
    43   <legend>{'Fields'|@translate}</legend>
     43  <legend>{'Fields'|translate}</legend>
    4444  <ul id="fields_active" class="connectedSortable">
    45     <h4>{'Active'|@translate}</h4>
     45    <h4>{'Active'|translate}</h4>
    4646  {foreach from=$active_fields item=field}
    4747    <li data-name="{$field}"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> {$field}</li>
     
    4949  </ul>
    5050  <ul id="fields_inactive" class="connectedSortable">
    51     <h4>{'Inactive'|@translate}</h4>
     51    <h4>{'Inactive'|translate}</h4>
    5252  {foreach from=$inactive_fields item=field}
    5353    <li data-name="{$field}"><img src="{$themeconf.admin_icon_dir}/cat_move.png"> {$field}</li>
    5454  {/foreach}
    5555  </ul>
    56  
     56
    5757  <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>
    6161</fieldset>
    6262
    6363<fieldset id="iframeWrapper" style="display:none;">
    64   <legend>{'Preview'|@translate}</legend>
     64  <legend>{'Preview'|translate}</legend>
    6565  <iframe src="" id="invokeFrame" name="invokeFrame"></iframe>
    6666</fieldset>
  • extensions/UserCollections/admin/template/index.php

    r20090 r25678  
    11<?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 call
    252$url = '../';
    263header( 'Request-URI: '.$url );
     
    285header( 'Location: '.$url );
    296exit();
    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'}
    22
    33<div class="titrePage">
     
    77<form class="filter" method="post" name="filter" action="{$F_FILTER_ACTION}">
    88<fieldset>
    9   <legend>{'Filter'|@translate}</legend>
     9  <legend>{'Filter'|translate}</legend>
    1010  <input type="hidden" name="page" value="user_list">
    1111
    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>
    1515
    1616  <label>
    17   {'Sort by'|@translate}
     17  {'Sort by'|translate}
    1818  {html_options name=order_by options=$order_options selected=$order_selected}
    1919  </label>
    2020
    2121  <label>
    22   {'Sort order'|@translate}
     22  {'Sort order'|translate}
    2323  {html_options name=direction options=$direction_options selected=$direction_selected}
    2424  </label>
     
    2626  <label>
    2727  &nbsp;
    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>
    2929  </label>
    3030
     
    3636  <thead>
    3737    <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>
    4343    </tr>
    4444  </thead>
     
    5353    <td>{$set.NB_IMAGES}</td>
    5454    <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>
    5858    </td>
    5959  </tr>
    6060  {/foreach}
    61  
     61
    6262  {if not $sets}
    6363  <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>
    6565  </tr>
    6666  {/if}
  • extensions/UserCollections/admin/template/style.css

    r20099 r25678  
    9393    opacity:0.5;
    9494  }
    95  
     95
    9696#invokeFrame {
    9797  width:100%;
Note: See TracChangeset for help on using the changeset viewer.