Ignore:
Timestamp:
Jul 24, 2010, 5:30:17 PM (14 years ago)
Author:
grum
Message:

Version 3.2.0
Enhance GPCTabSheet functionnalities and add the simpleTip methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/GrumPluginClasses/classes/GPCTabSheet.class.inc.php

    r6174 r6702  
    22/* -----------------------------------------------------------------------------
    33  class name     : GPCTabSheet
    4   class version  : 1.0.0
    5   plugin version : 3.0.2
    6   date           : 2010-04-18
     4  class version  : 1.1.0
     5  plugin version : 3.2.0
     6  date           : 2010-06-20
    77  ------------------------------------------------------------------------------
    88  author: grum at piwigo.org
     
    1515| 1.0.0   | 2010/04/18 | * create class
    1616|         |            |
     17| 1.1.0   | 2010/06/20 | * add possibility to manage the class names for tabs
    1718|         |            |
    1819|         |            |
     
    2728   this class extends the Piwigo tabsheet class
    2829
    29     - constructor GPCPagesNavigation()
    30     - (public) function setNbItems($nbitems)
    31     - (public) function getNbItems()
    32     - (public) function setNbItemsPerPage($nbitems)
    33     - (public) function getNbItemsPerPage()
    34     - (public) function getNbPages()
    35     - (public) function setCurrentPage($page)
    36     - (public) function getCurrentPage()
    37     - (public) function setBaseUrl($url)
    38     - (public) function getBaseUrl()
    39     - (public) function setOptions($var)
    40     - (public) function getOptions()
    41     - (public) function makeNavigation()
    42     - (private) function calcNbPages()
    4330   ---------------------------------------------------------------------- */
    4431
     
    5037  protected $id;
    5138  protected $tplFile;
     39  protected $selectedTabClasses='selected_tab';
     40  protected $unselectedTabClasses='normal_tab';
     41  protected $normalTabClasses='';
     42
     43
    5244  /*
    5345    $name is the tabsheet's name inside the template .tpl file
     
    8274  {
    8375    return($this->classes);
     76  }
     77
     78  public function setTabsClasses($state, $classes)
     79  {
     80    if($state=='unselected')
     81    {
     82      $this->unselectedTabClasses=$classes;
     83      return($this->unselectedTabClasses);
     84    }
     85    elseif($state=='selected')
     86    {
     87      $this->selectedTabClasses=$classes;
     88      return($this->selectedTabClasses);
     89    }
     90    elseif($state=='normal')
     91    {
     92      $this->normalTabClasses=$classes;
     93      return($this->normalTabClasses);
     94    }
     95    return("");
     96  }
     97
     98  public function getTabsClasses($state)
     99  {
     100    if($state=='unselected')
     101    {
     102      return($this->unselectedTabClasses);
     103    }
     104    elseif($state=='selected')
     105    {
     106      return($this->selectedTabClasses);
     107    }
     108    elseif($state=='normal')
     109    {
     110      return($this->normalTabClasses);
     111    }
     112    return("");
    84113  }
    85114
     
    144173    if($this->id!="") $template->assign('tabsheet_id', $this->id);
    145174
     175    $template->assign('tab_classes',
     176      array(
     177        'unselected' => $this->getTabsClasses('unselected'),
     178        'selected' => $this->getTabsClasses('selected'),
     179        'normal' => $this->getTabsClasses('normal')
     180      )
     181    );
     182
    146183    $template->assign_var_from_handle($this->name, 'tabsheet');
    147184    $template->clear_assign('tabsheet');
Note: See TracChangeset for help on using the changeset viewer.