public function doAddPackage($data, Form $form) {
        $record=new SnippetPackage();
        if($record->canEdit()) {
            $form->saveInto($record);
            $record->write();
            
            
            Requirements::customScript("window.parent.jQuery('#".$this->getName()."').entwine('ss').handleSuccessResult(".$record->ID.");");
            return $this->renderWith('CMSDialog', array('Form'=>''));
        }
        
        return Controller::curr()->redirectBack();
    }
public function doAddPackage($data, Form $form) {
        $record=new SnippetPackage();
        if($record->canEdit()) {
            $form->saveInto($record);
            $record->write();
            
            
            Requirements::customScript("window.parent.jQuery('#".$this->getName()."').entwine('ss').handleSuccessResult(".$record->ID.");");
            return $this->renderWith('CMSDialog', array('Form'=>''));
        }
        
        return Controller::curr()->redirectBack();
    }
public function doAddPackage ( $ data , Form $ form ) { $ record = new SnippetPackage ( ) ; if ( $ record -> canEdit ( ) ) { $ form -> saveInto ( $ record ) ; $ record -> write ( ) ; Requirements :: customScript ( "window.parent.jQuery('#" . $ this -> getName ( ) . "').entwine('ss').handleSuccessResult(" . $ record -> ID . ");" ) ; return $ this -> renderWith ( 'CMSDialog' , array ( 'Form' => '' ) ) ; } return Controller :: curr ( ) -> redirectBack ( ) ; }
Handles adding of the package
@param {array} $data Submitted data
@param {Form} $form Submitting form
@return {mixed}
Handles adding of the package