public function actionCreateRemapValue($id)
{
if (!($remap = XpathRemap::model()->findByPk($id))) {
throw new \CHttpException('404', 'Could not Xpath Remap');
}
$model = new RemapValue();
$model->xpath_id = $remap->id;
if (isset($_POST[\CHtml::modelName($model)])) {
$model->attributes = $_POST[\CHtml::modelName($model)];
if ($model->save()) {
\Audit::add('admin', 'create', serialize($model->attributes), false, array('module' => 'PASAPI', 'model' => '\\OEModule\\PASAPI\\models\\RemapValue'));
\Yii::app()->user->setFlash('success', 'Remap Value added to ' . $remap->name);
$this->redirect(array('viewRemapValues', 'id' => $id));
}
}
$this->render('update', array('model' => $model, 'title' => 'Add Xpath Remap', 'cancel_uri' => \Yii::app()->createUrl($this->module->getName() . '/admin/viewRemapValues', array('id' => $remap->id))));
}