Ignore:
Timestamp:
Jul 23, 2012, 5:21:46 PM (12 years ago)
Author:
mistic100
Message:

use Piwigo 2.4.2 tabsheets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/SmartAlbums/main.inc.php

    r16126 r16938  
    3939  include_once(SMART_PATH.'include/cat_list.php');
    4040 
     41 
    4142  add_event_handler('loc_begin_cat_list', 'smart_cat_list');
    42   add_event_handler('loc_begin_admin_page', 'smart_add_admin_album_tab');
     43  add_event_handler('tabsheet_before_select','smart_tab', 50, 2);
    4344  add_event_handler('get_admin_plugin_menu_links', 'smart_admin_menu');
     45}
     46
     47function smart_tab($sheets, $id)
     48{
     49  if ($id == 'album')
     50  {
     51    $sheets['smartalbum'] = array(
     52      'caption' => 'SmartAlbum',
     53      'url' => SMART_ADMIN.'-album&cat_id='.$_GET['cat_id'],
     54      );
     55  }
     56 
     57  return $sheets;
    4458}
    4559
     
    5367}
    5468
    55 function smart_add_admin_album_tab()
    56 {
    57   global $page, $template;
    58   if ($page['page'] != 'album') return;
    59  
    60   $template->assign('SMART_CAT_ID', $_GET['cat_id']);
    61   $template->set_prefilter('tabsheet', 'smart_add_admin_album_tab_prefilter');
    62 }
    63 function smart_add_admin_album_tab_prefilter($content)
    64 {
    65   $search = '{/foreach}';
    66   $add = '
    67 <li class="{if false}selected_tab{else}normal_tab{/if}">
    68   <a href="'.SMART_ADMIN.'-album&amp;cat_id={$SMART_CAT_ID}"><span>SmartAlbum</span></a>
    69 </li>';
    70   return str_replace($search, $search.$add, $content);
    71 }
    7269?>
Note: See TracChangeset for help on using the changeset viewer.