Skip to content
tform.inc.php 49 KiB
Newer Older
                        }
                } else {
                        $result = false;
                        if(@$this->formDef["auth_preset"]["userid"] == $_SESSION["s"]["user"]["userid"] && stristr($perm,$this->formDef["auth_preset"]["perm_user"])) $result = true;
                        if(@$this->formDef["auth_preset"]["groupid"] == $_SESSION["s"]["user"]["groupid"] && stristr($perm,$this->formDef["auth_preset"]["perm_group"])) $result = true;
                        if(@stristr($this->formDef["auth_preset"]["perm_other"],$perm)) $result = true;

                        // if preset == 0, everyone can insert a record of this type
                        if($this->formDef["auth_preset"]["userid"] == 0 AND $this->formDef["auth_preset"]["groupid"] == 0 AND (@stristr($this->formDef["auth_preset"]["perm_user"],$perm) OR @stristr($this->formDef["auth_preset"]["perm_group"],$perm))) $result = true;

                        return $result;

                }

        }

        function getNextTab() {
                // Welcher Tab wird angezeigt
                if($this->errorMessage == '') {
                    // wenn kein Fehler vorliegt
                    if(isset($_REQUEST["next_tab"]) && $_REQUEST["next_tab"] != '') {
                                // wenn nchster Tab bekannt
                                $active_tab = $_REQUEST["next_tab"];
                    } else {
                        // ansonsten ersten tab nehmen
                        $active_tab = $this->formDef['tab_default'];
                    }
                } else {
                    // bei Fehlern den gleichen Tab nochmal anzeigen
                    $active_tab = $_SESSION["s"]["form"]["tab"];
                }

                return $active_tab;
        }

        function getCurrentTab() {
                return $_SESSION["s"]["form"]["tab"];
        }
		function isReadonlyTab($tab) {
			if(isset($this->formDef['tabs'][$tab]['readonly']) && $this->formDef['tabs'][$tab]['readonly'] == true) {
				return true;
			} else {
				return false;
			}
        }
		
		
		// translation function for forms, tries the form wordbook first and if this fails, it tries the global wordbook
		function lng($msg) {
			global $app;
			
			if(isset($this->wordbook[$msg])) {
				return $this->wordbook[$msg];
			} else {
				return $app->lng($msg);
			}
			
		}
tbrehm's avatar
tbrehm committed
?>