Ignore:
Timestamp:
Jun 27, 2012, 9:19:07 PM (12 years ago)
Author:
mistic100
Message:

updated for Piwigo 2.4
new filters : name, author, level, hits

Location:
extensions/SmartAlbums/admin
Files:
4 added
3 edited
3 moved

Legend:

Unmodified
Added
Removed
  • extensions/SmartAlbums/admin/cat_list.php

    r12863 r16104  
    1111// |                            initialization                             |
    1212// +-----------------------------------------------------------------------+
    13 $base_url = get_root_url().'admin.php?page=';
    14 $self_url = SMART_ADMIN.'-albums';
     13$base_url = get_root_url() . 'admin.php?page=';
     14$self_url = SMART_ADMIN . '-cat_list';
    1515
    1616$categories = array();
    1717$query = '
    18 SELECT id, name, permalink, dir, rank, status
     18SELECT
     19    id,
     20    name,
     21    permalink,
     22    dir,
     23    rank,
     24    status
    1925  FROM '.CATEGORIES_TABLE.' AS cat
    2026  INNER JOIN '.CATEGORY_FILTERS_TABLE.' AS cf
     
    5056  {
    5157    $_SESSION['page_infos'] = array(l10n('SmartAlbum added'));
    52     $redirect_url = $base_url.'cat_modify&cat_id='.$output_create['id'].'&new_smart';
     58    $redirect_url = SMART_ADMIN . '-album&cat_id='.$output_create['id'].'&new_smart';
    5359    redirect($redirect_url);
    5460  }
     
    5763else if (isset($_GET['smart_generate']))
    5864{
    59   /* regenerate photo list | all (sub) categories */
     65  /* regenerate photo list | all categories */
    6066  if ($_GET['smart_generate'] == 'all')
    6167  {
     
    6369    {
    6470      $associated_images = smart_make_associations($category['id']);
    65       array_push(
    66         $page['infos'],
    67         sprintf(
    68           l10n('%d photos associated to album %s'),
     71      array_push($page['infos'],
     72        sprintf(l10n('%d photos associated to album %s'),
    6973          count($associated_images),
    70           '«'.trigger_event(
    71             'render_category_name',
    72             $category['name'],
    73             'admin_cat_list'
    74             ).'»'
     74          '«'.trigger_event('render_category_name', $category['name'], 'admin_cat_list').'»'
    7575          )
    7676        );
     
    8181  {
    8282    $associated_images = smart_make_associations($_GET['smart_generate']);   
    83     array_push(
    84       $page['infos'],
    85       sprintf(
    86         l10n('%d photos associated to album %s'),
     83    array_push($page['infos'],
     84      sprintf(l10n('%d photos associated to album %s'),
    8785        count($associated_images),
    88         '«'.trigger_event(
    89           'render_category_name',
    90           $categories[$_GET['smart_generate']]['name'],
    91           'admin_cat_list'
    92           ).'»'
     86        '«'.trigger_event('render_category_name', $categories[ $_GET['smart_generate'] ]['name'], 'admin_cat_list').'»'
    9387        )
    9488      );
     
    122116{
    123117  array_push($page['warnings'], l10n('Only SmartAlbums are displayed on this page'));
    124   array_push($page['warnings'], l10n('To order albums please go the main albums management page'));
     118  array_push($page['warnings'], sprintf(l10n('To order albums please go the main albums <a href="%s">management page</a>'), $base_url.'cat_list'));
    125119  array_push($page['warnings'], '<a href="'.$self_url.'&hide_messages">['.l10n('Don\'t show this message again').']</a>');
    126120}
     
    147141  $tpl_cat =
    148142    array(
    149       'NAME'       => get_cat_display_name_from_id($category['id'], $base_url.'cat_modify&amp;cat_id='),
     143      'NAME'       => get_cat_display_name_from_id($category['id'], $base_url.'album-'),
    150144      'ID'         => $category['id'],
    151145      'RANK'       => $category['rank']*10,
     
    157151        ),
    158152
    159       'U_EDIT'     => $base_url.'cat_modify&amp;cat_id='.$category['id'],
     153      'U_EDIT'     => $base_url.'album-'.$category['id'],
    160154      'U_DELETE'   => $self_url.'&amp;delete='.$category['id'].'&amp;pwg_token='.get_pwg_token(),
    161155      'U_SMART'    => $self_url.'&amp;smart_generate='.$category['id'],
     
    167161      $base_url.'batch_manager&amp;cat='.$category['id'];
    168162  }
    169 
    170   if ('private' == $category['status'])
    171   {
    172     $tpl_cat['U_MANAGE_PERMISSIONS'] =
    173       $base_url.'cat_perm&amp;cat='.$category['id'];
    174   }
    175163 
    176164  $template->append('categories', $tpl_cat);
    177165}
    178166
     167$template->set_filename('SmartAlbums_content', dirname(__FILE__).'/template/cat_list.tpl');
     168
    179169?>
  • extensions/SmartAlbums/admin/config.php

    r12863 r16104  
    1515));
    1616
     17$template->set_filename('SmartAlbums_content', dirname(__FILE__).'/template/config.tpl');
     18
    1719?>
  • extensions/SmartAlbums/admin/index.php

    r11392 r16104  
    11<?php
    2 // +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based photo gallery                                    |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2011 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 );
  • extensions/SmartAlbums/admin/template/cat_list.tpl

    r12863 r16104  
     1{footer_script require='jquery.ui.sortable'}{literal}
     2jQuery(document).ready(function(){
     3  jQuery("#addAlbumOpen").click(function(){
     4    jQuery("#createAlbum").toggle();
     5    jQuery("input[name=virtual_name]").focus();
     6    jQuery("#autoOrder").hide();
     7  });
     8
     9  jQuery("#addAlbumClose").click(function(){
     10    jQuery("#createAlbum").hide();
     11  });
     12});
     13{/literal}{/footer_script}
     14
     15{* è *}
     16
    117<div class="titrePage">
    218        <h2>SmartAlbums</h2>
    319</div>
    420
    5 <h3>
    6   <a href="{$F_ACTION}">{'All SmartAlbums'|@translate}</a>
    7   {if count($categories)>9 }
    8   <a href="#EoP" class="button" style="border:0;">
    9   <img src="{$themeconf.admin_icon_dir}/page_end.png" title="{'Page end'|@translate}" class="button" alt="page_end" style="margin-bottom:-0.6em;"></a>
    10   {/if}
    11 </h3>
     21<form id="categoryOrdering" action="{$F_ACTION}" method="post">
     22<input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
    1223
    13 <form id="addVirtual" action="{$F_ACTION}" method="post">
    14   <fieldset>
    15     <legend>{'Add a SmartAlbum'|@translate}</legend>
    16  
    17     <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
    18     {'Album name'|@translate} : <input type="text" name="virtual_name">
    19     {'Parent album'|@translate} :
     24<p class="showCreateAlbum">
     25  <span id="notManualOrder">
     26    <a href="#" id="addAlbumOpen">{'create a new SmartAlbum'|@translate}</a>
     27    | <a href="{$F_ACTION}&amp;smart_generate=all">{'Regenerate photos list of all SmartAlbums'|@translate}</a>
     28  </span>
     29</p>
     30
     31<fieldset id="createAlbum" style="display:none;">
     32  <legend>{'create a new SmartAlbum'|@translate}</legend>
     33  <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
     34
     35  <p>
     36    <strong>{'Album name'|@translate}</strong> :
     37    <input type="text" name="virtual_name">
     38  </p>
     39  <p>
     40    <strong>{'Parent album'|@translate}</strong>  :
    2041    <select class="categoryDropDown" name="parent_id">
    2142      <option value="0">------------</option>
    2243      {html_options options=$category_options}
    2344    </select>
    24     <input class="submit" type="submit" value="{'Submit'|@translate}" name="submitAdd">
    25  
    26   </fieldset>
    27 </form>
     45  </p>
     46  <p class="actionButtons">
     47    <input class="submit" type="submit" value="{'Create'|@translate}" name="submitAdd">
     48    <a href="#" id="addAlbumClose">{'Cancel'|@translate}</a>
     49  </p>
     50</fieldset>
    2851
    2952{if count($categories) }
    30 <form id="categoryOrdering" action="{$F_ACTION}" method="post">
    31   <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
    3253
    3354  <ul class="categoryUl">
     
    3657    <li class="categoryLi virtual_cat" id="cat_{$category.ID}">
    3758      <!-- category {$category.ID} -->
    38       <ul class="categoryActions">
    39         {if cat_admin_access($category.ID)}
    40         <li><a href="{$category.U_JUMPTO}" title="{'jump to album'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_jump-to.png" class="button" alt="{'jump to album'|@translate}"></a></li>
    41         {/if}
    42         <li><a href="{$category.U_EDIT}" title="{'edit album'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'edit'|@translate}"></a></li>
    43         {if isset($category.U_MANAGE_ELEMENTS) }
    44         <li><a href="{$category.U_MANAGE_ELEMENTS}" title="{'manage album photos'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'Photos'|@translate}"></a></li>
    45         {/if}
    46         {if isset($category.U_MANAGE_PERMISSIONS) }
    47         <li><a href="{$category.U_MANAGE_PERMISSIONS}" title="{'edit album permissions'|@translate}" ><img src="{$themeconf.admin_icon_dir}/category_permissions.png" class="button" alt="{'Permissions'|@translate}"></a></li>
    48         {/if}
    49         <li><a href="{$category.U_SMART}" title="{'Regenerate photos list of this SmartAlbum'|@translate}"><img src="{$themeconf.admin_icon_dir}/synchronize.png" class="button" alt="{'Regenerate photos list of this SmartAlbum'|@translate}"></a></li>
    50         {if isset($category.U_DELETE) }
    51         <li><a href="{$category.U_DELETE}" title="{'delete album'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');"><img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'delete album'|@translate}"></a></li>
    52         {/if}
    53       </ul>
    54 
    55       <p>
    56         <strong>{$category.NAME}</strong>
     59      <p class="albumTitle">
     60        <strong><a href="{$category.U_CHILDREN}" title="{'manage sub-albums'|@translate}">{$category.NAME}</a></strong>
     61        <img src="{$SMART_PATH}admin/template/lightning.png">
    5762      </p>
    5863
     64      <p class="albumActions">
     65        <a href="{$category.U_EDIT}">{'Edit'|@translate}</a>
     66        | <a href="{$category.U_SMART}">{'Regenerate photos list of this SmartAlbum'|@translate}</a>
     67        {if isset($category.U_MANAGE_ELEMENTS) }
     68        | <a href="{$category.U_MANAGE_ELEMENTS}">{'manage album photos'|@translate}</a>
     69        {/if}
     70        {if isset($category.U_DELETE) }
     71        | <a href="{$category.U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'delete album'|@translate}</a>
     72        {/if}
     73        {if cat_admin_access($category.ID)}
     74        | <a href="{$category.U_JUMPTO}">{'jump to album'|@translate} ?</a>
     75        {/if}
     76      </p>
    5977    </li>
    6078    {/foreach}
    6179  </ul>
     80{/if}
    6281</form>
    63 {/if}
    64 
    65 <form method="post" action="{$F_ACTION}&amp;smart_generate=all">
    66   <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
    67   <p><input class="submit" type="submit" value="{'Regenerate photos list of all SmartAlbums'|@translate}"></p>
    68 </form>
    69 
    70 <a name="EoP"></a>
  • extensions/SmartAlbums/admin/template/config.tpl

    r11451 r16104  
    1111          <span class="property">{'Update albums on file upload'|@translate}</span>
    1212          <input type="checkbox" name="update_on_upload" value="true" {if $update_on_upload}checked="checked"{/if}/>
    13           {'(can cause slowdowns on admin pages)'|@translate}
     13          {'(can cause slowdowns)'|@translate}
    1414        </label>
    1515                        </li>
  • extensions/SmartAlbums/admin/template/index.php

    r11392 r16104  
    11<?php
    2 // +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based photo gallery                                    |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2011 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 );
Note: See TracChangeset for help on using the changeset viewer.