FML/Script/Features/ToggleInterface.php
protected function getOnInitScriptText()
    {
        $scriptText = null;
        if ($this->control) {
            $controlId  = Builder::escapeText($this->control->getId());
            $scriptText = "declare ToggleInterfaceControl <=> Page.GetFirstChild({$controlId});";
        } else {
            $scriptText = "declare ToggleInterfaceControl <=> Page.MainFrame;";
        }
        $stateVariableName = $this::VAR_STATE;
        return $scriptText . "
declare persistent {$stateVariableName} as CurrentState for LocalUser = True;
ToggleInterfaceControl.Visible = CurrentState;
";
    }
protected function getOnInitScriptText()
    {
        $scriptText = null;
        if ($this->control) {
            $controlId  = Builder::escapeText($this->control->getId());
            $scriptText = "declare ToggleInterfaceControl <=> Page.GetFirstChild({$controlId});";
        } else {
            $scriptText = "declare ToggleInterfaceControl <=> Page.MainFrame;";
        }
        $stateVariableName = $this::VAR_STATE;
        return $scriptText . "
declare persistent {$stateVariableName} as CurrentState for LocalUser = True;
ToggleInterfaceControl.Visible = CurrentState;
";
    }
protected function getOnInitScriptText ( ) { $ scriptText = null ; if ( $ this -> control ) { $ controlId = Builder :: escapeText ( $ this -> control -> getId ( ) ) ; $ scriptText = "declare ToggleInterfaceControl <=> Page.GetFirstChild({$controlId});" ; } else { $ scriptText = "declare ToggleInterfaceControl <=> Page.MainFrame;" ; } $ stateVariableName = $ this :: VAR_STATE ; return $ scriptText . "
declare persistent {$stateVariableName} as CurrentState for LocalUser = True;
ToggleInterfaceControl.Visible = CurrentState;
" ; }
Get the on init script text

@return string
Get the on init script text