浏览代码

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 年之前
父节点
当前提交
61401cc06c
共有 1 个文件被更改,包括 10 次插入0 次删除
  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