if(!isset($_POST['Apartment'])){
$categories = Apartment::getCategories($this->_model->id, $this->_model->type);
}
if(isset($_POST['category']) && is_array($_POST['category'])) {
$categories = Apartment::getCategories('', $this->_model->type);
foreach($_POST['category'] as $cat => $cat_arr){
foreach($cat_arr as $cat_key => $cat_value){
$categories[$cat]['values'][$cat_key]['selected'] = 1;
}
}
} else $categories = Apartment::getCategories($this->_model->id, $this->_model->type);
if($model->active == Apartment::STATUS_DRAFT){
Yii::app()->user->setState('menu_active', 'apartments.create');
$this->render('create', array(
'model' => $model,
'categories' => Apartment::getCategories($id, $model->type),
));
return;
}
$this->render('update',
array(
'model'=>$model,
'categories' => Apartment::getCategories($id, $model->type),
)
);
//========== CORNIL - bug
if(isset($_POST['category']) && is_array($_POST['category'])) {
$categories = Apartment::getCategories('', $model->type);
foreach($_POST['category'] as $cat => $cat_arr){
foreach($cat_arr as $cat_key => $cat_value){
$categories[$cat]['values'][$cat_key]['selected'] = 1;
}
}
} else $categories = Apartment::getCategories($id, $model->type);
//========== /CORNIL - bug
if($model->active == Apartment::STATUS_DRAFT){
Yii::app()->user->setState('menu_active', 'apartments.create');
$this->render('create', array(
'model' => $model,
'categories' => $categories, //---------- cornil - bug
));
return;
}
$this->render('update',
array(
'model'=>$model,
'categories' => $categories, //---------- cornil - bug
)
);
protected function afterSave(){
if ($this->active == Comment::STATUS_APPROVED){
$this->_updateRating();
}
return parent::afterSave();
}
public function afterDelete(){
if ($this->active == Comment::STATUS_APPROVED){
$this->_updateRating();
}
return parent::afterDelete();
}
protected function afterSave(){
// if ($this->active == Comment::STATUS_APPROVED){
$this->_updateRating();
// }
return parent::afterSave();
}
public function afterDelete(){
// if ($this->active == Comment::STATUS_APPROVED){
$this->_updateRating();
// }
return parent::afterDelete();
}
Cornil писал(а):А вот еще мелкая неприятность... Присутствует и на демо и в дистрибутиве.
fisher писал(а):решение viewtopic.php?f=3&t=1139
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 2