public function actionSave($id = NULL)
	{
		$asModel = NULL;

		if ($id == NULL)
		{
			$model = new Content;
	        $model->savePrototype(Yii::app()->user->id);

	        $this->redirect('/dashboard/content/save/id/' . $model->id);
		}
		else
		{
			$model = $this->loadModel($id);
			$asModel = ContentMetadata::model()->findByAttributes(array('content_id' => $model->id, 'key' => 'autosave'));
			if ($asModel != NULL)
			{
				$model->populate(CJSON::decode($asModel->value));
				$model->autosavedata = true;
			}
		}

		$this->render('save', array(
			'model' => $model
		));
	}
public function actionSave($id = NULL)
	{
		$asModel = NULL;

		if ($id == NULL)
		{
			$model = new Content;
	        $model->savePrototype(Yii::app()->user->id);

	        $this->redirect('/dashboard/content/save/id/' . $model->id);
		}
		else
		{
			$model = $this->loadModel($id);
			$asModel = ContentMetadata::model()->findByAttributes(array('content_id' => $model->id, 'key' => 'autosave'));
			if ($asModel != NULL)
			{
				$model->populate(CJSON::decode($asModel->value));
				$model->autosavedata = true;
			}
		}

		$this->render('save', array(
			'model' => $model
		));
	}
public function actionSave ( $ id = NULL ) { $ asModel = NULL ; if ( $ id == NULL ) { $ model = new Content ; $ model -> savePrototype ( Yii :: app ( ) -> user -> id ) ; $ this -> redirect ( '/dashboard/content/save/id/' . $ model -> id ) ; } else { $ model = $ this -> loadModel ( $ id ) ; $ asModel = ContentMetadata :: model ( ) -> findByAttributes ( array ( 'content_id' => $ model -> id , 'key' => 'autosave' ) ) ; if ( $ asModel != NULL ) { $ model -> populate ( CJSON :: decode ( $ asModel -> value ) ) ; $ model -> autosavedata = true ; } } $ this -> render ( 'save' , array ( 'model' => $ model ) ) ; }
Rndering action for the entry
@param int $id 	The content ID
Rndering action for the entry