protected function OnSuccess()
    {
        $newTemplate = $this->Value('Name');
        $action = Action::Create();
        if ($this->template)
        {
            $action = Action::Update();
            $this->UpdateUsages($newTemplate);
            $oldFile = $this->CalcFile($this->template);
            if (File::Exists($oldFile))
            {
                File::Delete($oldFile);
            }
        }
        $logger = new Logger(self::Guard()->GetUser());
        $logger->ReportTemplateAction($this->module->MyType(), $newTemplate, $action);
        if (!Folder::Exists($this->folder))
        {
            Folder::Create($this->folder);
        }
        File::CreateWithText($this->CalcFile($newTemplate), $this->Value('Contents', false));
        Response::Redirect($this->BackLink());
    }
protected function OnSuccess()
    {
        $newTemplate = $this->Value('Name');
        $action = Action::Create();
        if ($this->template)
        {
            $action = Action::Update();
            $this->UpdateUsages($newTemplate);
            $oldFile = $this->CalcFile($this->template);
            if (File::Exists($oldFile))
            {
                File::Delete($oldFile);
            }
        }
        $logger = new Logger(self::Guard()->GetUser());
        $logger->ReportTemplateAction($this->module->MyType(), $newTemplate, $action);
        if (!Folder::Exists($this->folder))
        {
            Folder::Create($this->folder);
        }
        File::CreateWithText($this->CalcFile($newTemplate), $this->Value('Contents', false));
        Response::Redirect($this->BackLink());
    }
protected function OnSuccess ( ) { $ newTemplate = $ this -> Value ( 'Name' ) ; $ action = Action :: Create ( ) ; if ( $ this -> template ) { $ action = Action :: Update ( ) ; $ this -> UpdateUsages ( $ newTemplate ) ; $ oldFile = $ this -> CalcFile ( $ this -> template ) ; if ( File :: Exists ( $ oldFile ) ) { File :: Delete ( $ oldFile ) ; } } $ logger = new Logger ( self :: Guard ( ) -> GetUser ( ) ) ; $ logger -> ReportTemplateAction ( $ this -> module -> MyType ( ) , $ newTemplate , $ action ) ; if ( ! Folder :: Exists ( $ this -> folder ) ) { Folder :: Create ( $ this -> folder ) ; } File :: CreateWithText ( $ this -> CalcFile ( $ newTemplate ) , $ this -> Value ( 'Contents' , false ) ) ; Response :: Redirect ( $ this -> BackLink ( ) ) ; }
Saves the template into the given file name
Saves the template into the given file name