Ignore:
Timestamp:
Aug 25, 2012, 3:22:45 PM (12 years ago)
Author:
mistic100
Message:

improve upgrade process (for manual upgrades and piwigo.com upgrades)
improve delete button visibility

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/header_manager/include/header_manager.inc.php

    r17012 r17644  
    88{
    99  global $conf, $user, $template, $page;
    10  
    11   if (defined('IN_ADMIN')) return $page_banner;
    1210 
    1311  // search banner for a specific category
     
    2826    if (count($cat_banners))
    2927    {
    30       function uppercats_sort($a, $b)
    31       {
    32         global $page;
    33         $ids = explode(',', $page['category']['uppercats']);
    34         return array_search($a['category_id'], $ids) < array_search($b['category_id'], $ids);
    35       }
    36       usort($cat_banners, 'uppercats_sort');
     28      usort($cat_banners, 'hm_uppercats_sort');
    3729     
    3830      foreach ($cat_banners as $cat_banner)
     
    10698}
    10799
    108 /**
    109  * Header Manager admin link
    110  */
    111 function header_manager_admin_menu($menu)
     100function hm_uppercats_sort($a, $b)
    112101{
    113   array_push($menu, array(
    114     'NAME' => 'Header Manager',
    115     'URL' => HEADER_MANAGER_ADMIN,
    116   ));
    117   return $menu;
    118 }
    119 
    120 /**
    121  * tab on album edition page
    122  */
    123 function header_manager_tab($sheets, $id)
    124 {
    125   if ($id == 'album')
    126   {
    127     load_language('plugin.lang', HEADER_MANAGER_PATH);
    128    
    129     $sheets['headermanager'] = array(
    130       'caption' => l10n('Banner'),
    131       'url' => HEADER_MANAGER_ADMIN.'-album&amp;cat_id='.$_GET['cat_id'],
    132       );
    133   }
    134  
    135   return $sheets;
     102  global $page;
     103  $ids = explode(',', $page['category']['uppercats']);
     104  return array_search($a['category_id'], $ids) < array_search($b['category_id'], $ids);
    136105}
    137106
Note: See TracChangeset for help on using the changeset viewer.