Ignore:
Timestamp:
Aug 14, 2012, 9:55:13 PM (12 years ago)
Author:
grum
Message:

bug:2723
+ improve some GPC framework functionnalities

File:
1 edited

Legend:

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

    r7142 r17562  
    22/* -----------------------------------------------------------------------------
    33  class name     : GPCTabSheet
    4   class version  : 1.1.1
    5   plugin version : 3.2.1
    6   date           : 2010-10-01
     4  class version  : 1.1.2
     5  plugin version : 3.5.3
     6  date           : 2012-08-14
    77  ------------------------------------------------------------------------------
    88  author: grum at piwigo.org
     
    1919| 1.1.1   | 2010/10/01 | * add attribute 'id' for tabs (<li> items)
    2020|         |            |
    21 |         |            |
     21| 1.1.2   | 2012/08/14 | * bug:2723 - set select() function to be compatible with
     22|         |            |   piwigo 2.4.3
    2223|         |            |
    2324|         |            |
     
    5253    $this->classes=$classes;
    5354    $this->id=$id;
     55    $this->set_id($this->id);
    5456    $this->setTplFile($tplFile);
    5557  }
     
    139141  }
    140142
     143
     144  public function select($name)
     145  {
     146    /*
     147     * override the tabsheet->select() function (to fix bug:2723)
     148     */
     149    if($this->id!='')
     150    {
     151      $this->sheets = trigger_event('gpc_tabsheet_before_select', $this->sheets, $this->id);
     152      if (!array_key_exists($name, $this->sheets))
     153      {
     154        $keys = array_keys($this->sheets);
     155        if(isset($keys[0]))
     156          $name = $keys[0];
     157      }
     158    }
     159    $this->selected = $name;
     160  }
     161
     162  function set_id($id)
     163  {
     164    /*
     165     * override the tabsheet->select() function (to fix bug:2723)
     166     */
     167    if(method_exists('tabsheet', 'set_id'))
     168    {
     169      parent::set_id($id);
     170    }
     171    else
     172    {
     173      $this->uniqid = $id;
     174    }
     175  }
    141176
    142177  /*
Note: See TracChangeset for help on using the changeset viewer.