Browse Source

Add a way to see if a tab group is open

If an Admin didn't use tabs, the `default` tab will never be closed. This causes issues when an admin extension adds a tab to the formmapper (it'll result in the "there is a current open tab" exception).
Wouter J 10 years ago
parent
commit
61401cc06c
1 changed files with 10 additions and 0 deletions
  1. 10 0
      Mapper/BaseGroupedMapper.php

+ 10 - 0
Mapper/BaseGroupedMapper.php

@@ -219,6 +219,16 @@ abstract class BaseGroupedMapper extends BaseMapper
 
 
         return $this;
         return $this;
     }
     }
+    
+    /**
+     * Returns a boolean indicating if there is an open tab at the moment.
+     * 
+     * @return boolean
+     */
+    public function hasOpenTab()
+    {
+        return null !== $this->currentTab;
+    }
 
 
     /**
     /**
      * Add the fieldname to the current group
      * Add the fieldname to the current group