Changeset 16938


Ignore:
Timestamp:
07/23/12 17:21:46 (7 years ago)
Author:
mistic100
Message:

use Piwigo 2.4.2 tabsheets

Location:
extensions/SmartAlbums
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/SmartAlbums/admin.php

    r16104 r16938  
    44global $conf, $template, $page; 
    55 
    6 $page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'cat_list'; 
     6$page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : 'cat_list'; 
    77 
    88if ($page['tab'] == 'album') 
     
    1919  $tabsheet->assign(); 
    2020 
    21   $template->assign(array( 
    22     'SMART_PATH' => SMART_PATH, 
    23   )); 
    24  
    2521  include(SMART_PATH . 'admin/'.$page['tab'].'.php'); 
    2622} 
  • extensions/SmartAlbums/admin/album.php

    r16924 r16938  
    5353include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 
    5454$tabsheet = new tabsheet(); 
    55 $tabsheet->add('properties', l10n('Properties'), $admin_album_base_url.'-properties'); 
    56 $tabsheet->add('sort_order', l10n('Manage photo ranks'), $admin_album_base_url.'-sort_order'); 
    57 $tabsheet->add('permissions', l10n('Permissions'), $admin_album_base_url.'-permissions'); 
    58 $tabsheet->add('notification', l10n('Notification'), $admin_album_base_url.'-notification'); 
    59 $tabsheet->add('smartalbum', 'SmartAlbum', $self_url); 
     55$tabsheet->set_id('album'); 
    6056$tabsheet->select('smartalbum'); 
    6157$tabsheet->assign(); 
  • 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.