public function onBeforeWrite()
    {
        $maps = array(
            /** URL Mapping */
            'TagAction',
            'TagsAction',
            'ShowAction',
            'AuthorAction',
            'ArchiveAction',
        );
        foreach ($maps as $map) {
            if ($this->owner->$map) {
                $this->owner->$map = singleton('SiteTree')->generateURLSegment($this->owner->$map);
            }
        }
        $newsFolder = Folder::find_or_make(Config::inst()->get($this->class, 'uploads_folder'));
        $this->owner->NewsRootFolderID = $newsFolder->ID;
    }
public function onBeforeWrite()
    {
        $maps = array(
            /** URL Mapping */
            'TagAction',
            'TagsAction',
            'ShowAction',
            'AuthorAction',
            'ArchiveAction',
        );
        foreach ($maps as $map) {
            if ($this->owner->$map) {
                $this->owner->$map = singleton('SiteTree')->generateURLSegment($this->owner->$map);
            }
        }
        $newsFolder = Folder::find_or_make(Config::inst()->get($this->class, 'uploads_folder'));
        $this->owner->NewsRootFolderID = $newsFolder->ID;
    }
public function onBeforeWrite ( ) { $ maps = array ( /** URL Mapping */ 'TagAction' , 'TagsAction' , 'ShowAction' , 'AuthorAction' , 'ArchiveAction' , ) ; foreach ( $ maps as $ map ) { if ( $ this -> owner -> $ map ) { $ this -> owner -> $ map = singleton ( 'SiteTree' ) -> generateURLSegment ( $ this -> owner -> $ map ) ; } } $ newsFolder = Folder :: find_or_make ( Config :: inst ( ) -> get ( $ this -> class , 'uploads_folder' ) ) ; $ this -> owner -> NewsRootFolderID = $ newsFolder -> ID ; }
Make sure the chosen action by the user is safe for usage.
Make sure the chosen action by the user is safe for usage .