Skip to content

Commit

Permalink
Merge pull request #366 from DaSourcerer/issue-237
Browse files Browse the repository at this point in the history
Fix issue #237
  • Loading branch information
samdark committed Feb 22, 2012
2 parents 51f6d21 + 4dcf1b1 commit c85b8d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -8,6 +8,7 @@ Version 1.1.11 work in progress
- Enh #171: Added support for PUT and DELETE request tunneled through POST via parameter named _method in POST body (musterknabe)
- Enh #266: Add support for HTML5 url, email, number, range and date fields to CHtml (gregmolnar)
- Enh #369: Added $hashKey and $autoSerialize properties as well as serializeValue() and unserializeValue() methods to CCache (kidol)
- Enh #237: The tabs of CTabView now support the property 'visible' (DaSourcerer)
- Bug #193: Changed datetime column type for postgresql from 'time' to 'timestamp' (cebe)
- Enh: Added getIsFlashRequest(), proper handling of Flash/Flex request when using CWebLogRoute with FireBug (resurtm)
- Enh: Added CBreadcrumbs::$activeLinkTemplate and CBreadcrumbs::$inactiveLinkTemplate properties which allows to change each item's template (resurtm)
Expand Down
8 changes: 7 additions & 1 deletion framework/web/widgets/CTabView.php
Expand Up @@ -97,6 +97,8 @@ class CTabView extends CWidget
* <li>url: a URL that the user browser will be redirected to when clicking on this tab.</li>
* <li>data: array (name=>value), this will be passed to the view when 'view' is specified.
* This option is available since version 1.1.1.</li>
* <li>visible: whether this tab is visible. Defaults to true.
* this option is available since version 1.1.11.</li>
* </ul>
* <pre>
* array(
Expand All @@ -118,9 +120,13 @@ class CTabView extends CWidget
*/
public function run()
{
foreach($this->tabs as $id=>$tab)
if(isset($tab['visible']) && $tab['visible']==false)
unset($this->tabs[$id]);

if(empty($this->tabs))
return;

if($this->activeTab===null || !isset($this->tabs[$this->activeTab]))
{
reset($this->tabs);
Expand Down

0 comments on commit c85b8d7

Please sign in to comment.