public function create($request, $match)
    {
        // initial content data
        $extra = array(
            'user' => $request->user,
            'model' => new CMS_Content()
        );

        // Create content and get its ID
        $form = new CMS_Form_ContentCreate($request->REQUEST, $extra);

        // Upload content file and extract information about it (by updating
        // content)
        $extra['model'] = $form->save();
        $form = new CMS_Form_ContentUpdate(array_merge($request->REQUEST, $request->FILES), $extra);
        try {
            $content = $form->save();
        } catch (Pluf_Exception $e) {
            $content = $extra['model'];
            $content->delete();
            throw $e;
        }
        return $content;
    }
public function create($request, $match)
    {
        // initial content data
        $extra = array(
            'user' => $request->user,
            'model' => new CMS_Content()
        );

        // Create content and get its ID
        $form = new CMS_Form_ContentCreate($request->REQUEST, $extra);

        // Upload content file and extract information about it (by updating
        // content)
        $extra['model'] = $form->save();
        $form = new CMS_Form_ContentUpdate(array_merge($request->REQUEST, $request->FILES), $extra);
        try {
            $content = $form->save();
        } catch (Pluf_Exception $e) {
            $content = $extra['model'];
            $content->delete();
            throw $e;
        }
        return $content;
    }
public function create ( $ request , $ match ) { // initial content data $ extra = array ( 'user' => $ request -> user , 'model' => new CMS_Content ( ) ) ; // Create content and get its ID $ form = new CMS_Form_ContentCreate ( $ request -> REQUEST , $ extra ) ; // Upload content file and extract information about it (by updating // content) $ extra [ 'model' ] = $ form -> save ( ) ; $ form = new CMS_Form_ContentUpdate ( array_merge ( $ request -> REQUEST , $ request -> FILES ) , $ extra ) ; try { $ content = $ form -> save ( ) ; } catch ( Pluf_Exception $ e ) { $ content = $ extra [ 'model' ] ; $ content -> delete ( ) ; throw $ e ; } return $ content ; }
Creates new content

@param Pluf_HTTP_Request $request
@param array $match
@throws Pluf_Exception
@return Pluf_HTTP_Response_Json
Creates new content