public function actionAdd() { if (CRequest::getInt("id", CRatingIndex::getClassName()) == 0) { $index = CFactory::createRatingIndex(); $index->year_id = CUtils::getCurrentYear()->getId(); } else { $index = CRatingManager::getRatingIndex(CRequest::getInt("id", CRatingIndex::getClassName())); } $this->addJSInclude("_modules/_rating/index.js"); $this->setData("index", $index); $this->renderView("_rating/index/add.tpl"); }