Explorar o código

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 %!s(int64=10) %!d(string=hai) anos
pai
achega
61401cc06c
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      Mapper/BaseGroupedMapper.php

+ 10 - 0
Mapper/BaseGroupedMapper.php

@@ -219,6 +219,16 @@ abstract class BaseGroupedMapper extends BaseMapper
 
         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