本文整理汇总了PHP中CRequest::getArray方法的典型用法代码示例。如果您正苦于以下问题:PHP CRequest::getArray方法的具体用法?PHP CRequest::getArray怎么用?PHP CRequest::getArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRequest
的用法示例。
在下文中一共展示了CRequest::getArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionSave
public function actionSave()
{
$quest = new CQuestion();
$quest->setAttributes(CRequest::getArray($quest::getClassName()));
if ($quest->validate()) {
if (!CSession::isAuth()) {
$user = "";
} else {
$user = CStaffManager::getUser(CSession::getCurrentUser()->getId())->getName();
}
$quest->contact_info .= " " . $user . '; ip ' . $_SERVER["REMOTE_ADDR"];
if ($quest->answer_text != '') {
$quest->datetime_answ = date("Y-d-m H:i:s", time());
}
$quest->save();
if ($this->continueEdit()) {
$this->redirect("?action=edit&id=" . $quest->getId());
} else {
$this->redirect(WEB_ROOT);
}
return true;
}
$this->setData("quest", $quest);
$this->renderView("__public/_question_add/edit.tpl");
}
示例2: actionSave
public function actionSave()
{
$arr = CRequest::getArray("CModel");
if ($arr["work_type"] == "1") {
$load = CIndPlanManager::getLoad($arr["load_id"]);
$object = new CIndPlanPersonLoadTable($load);
$object->setAttributes(CRequest::getArray($object::getClassName()));
if ($object->validate()) {
$object->save();
if ($this->continueEdit()) {
$this->redirect("work.php?action=add&id=" . $object->getLoad()->getId() . "&type=1" . "&year=" . $object->getLoad()->year_id);
} else {
$this->redirect("load.php?action=view&id=" . $object->getLoad()->person_id . "&year=" . $object->getLoad()->year_id);
}
return true;
}
} else {
$object = new CIndPlanPersonWork();
$object->setAttributes(CRequest::getArray($object::getClassName()));
if ($object->validate()) {
$object->save();
if ($this->continueEdit()) {
$this->redirect("work.php?action=edit&id=" . $object->getId() . "&year=" . $object->load->year_id);
} else {
$this->redirect("load.php?action=view&id=" . $object->load->person_id . "&year=" . $object->load->year_id);
}
return true;
}
}
$this->setData("object", $object);
$this->renderView("_individual_plan/work/edit.tpl");
}
示例3: actionWizardCompleted
public function actionWizardCompleted()
{
$sign_date = CRequest::getString("sign_date");
$chairman = CStaffManager::getPersonById(CRequest::getInt("chairman_id"));
$master = CStaffManager::getPersonById(CRequest::getInt("master_id"));
$members = new CArrayList();
foreach (CRequest::getArray("members") as $m) {
$member = CStaffManager::getPersonById($m);
$members->add($member->getId(), $member);
}
CProtocolManager::getAllSebProtocols();
// на студента по протоколу
foreach (CRequest::getArray("student") as $key => $value) {
$student = CStaffManager::getStudent($key);
$ticket = CSEBTicketsManager::getTicket($value['ticket_id']);
$mark = CTaxonomyManager::getMark($value['mark_id']);
$questions = $value['questions'];
$protocol = CFactory::createSebProtocol();
$protocol->setSignDate($sign_date);
$protocol->setStudent($student);
$protocol->setChairman($chairman);
$protocol->setTicket($ticket);
$protocol->setMark($mark);
$protocol->setQuestions($questions);
$protocol->setBoarMaster($master);
$protocol->setSpeciality($student->getSpeciality());
foreach ($members->getItems() as $member) {
$protocol->addMember($member);
}
$protocol->setNumber(CProtocolManager::getAllSebProtocols()->getCount() + 1);
$protocol->save();
CProtocolManager::getCacheSebProtocols()->add($protocol->getId(), $protocol);
}
$this->redirect("?action=index");
}
示例4: actionSaveItem
/**
* Сохранение пункта меню
*/
public function actionSaveItem()
{
if (!CSession::isAuth()) {
$this->redirectNoAccess();
}
$item = new CMenuItem();
$item->setAttributes(CRequest::getArray(CMenuItem::getClassName()));
if ($item->validate()) {
$item->save();
// сохранение ролей. удаляем старые, записываем новые
foreach (CActiveRecordProvider::getWithCondition(TABLE_MENU_ITEMS_ACCESS, "item_id = " . $item->id)->getItems() as $val) {
$val->remove();
}
// делаем новые и сохраняем их
$items = CRequest::getArray(CMenuItem::getClassName());
if (array_key_exists("roles", $items)) {
foreach ($items["roles"] as $role) {
$r = new CMenuItemRole();
$r->item_id = $item->id;
$r->role_id = $role;
$r->save();
}
}
$this->redirect("?action=view&id=" . $item->getMenu()->getId());
}
$this->setData("item", $item);
$this->setData("menu", CMenuManager::getMenu(CRequest::getInt("menu_id", CMenuItem::getClassName())));
$this->renderView("_menumanager/editItem.tpl");
}
示例5: actionWizardCompleted
public function actionWizardCompleted()
{
$speciality = CTaxonomyManager::getCacheSpecialities()->getItem(CRequest::getInt("speciality_id"));
$year = CTaxonomyManager::getCacheYears()->getItem(CRequest::getInt("year_id"));
$protocol = CProtocolManager::getDepProtocol(CRequest::getInt("protocol_id"));
$signer = CStaffManager::getPersonById(CRequest::getInt("signer_id"));
$disciplines = new CArrayList();
foreach (CRequest::getArray("discipline") as $i) {
$disciplines->add($disciplines->getCount(), CDisciplinesManager::getDiscipline($i));
}
// бегаем по циклу столько раз, сколько нам билетов нужно
for ($i = 1; $i <= CRequest::getInt("count"); $i++) {
$ticket = CFactory::createSebTicket();
$ticket->setSpeciality($speciality);
$ticket->setYear($year);
$ticket->setProtocol($protocol);
$ticket->setSigner($signer);
$ticket->setNumber($i);
foreach ($disciplines->getItems() as $disc) {
if ($disc->getQuestions()->getCount() == 0) {
break;
}
$question = $disc->getQuestions()->getShuffled()->getFirstItem();
$disc->getQuestions()->removeItem($question->getId());
$ticket->addQuestion($question);
}
$ticket->save();
}
$this->redirect("?action=index");
}
示例6: actionPrintIndPlan
public function actionPrintIndPlan()
{
// складываем из бина параметры
$bean = self::getStatefullBean();
$selected = CRequest::getArray("selected");
$bean->add("planId", $selected[0]);
// редирект на печать
$this->redirectNextAction("CPrintController", "PrintWithBeanData");
return true;
}
示例7: actionSave
public function actionSave()
{
$formset = new CPrintFormset();
$formset->setAttributes(CRequest::getArray($formset::getClassName()));
if ($formset->validate()) {
$formset->save();
$this->redirect("?action=index");
}
$this->setData("set", $formset);
$this->renderView("_print/formset/edit.tpl");
}
示例8: actionSave
public function actionSave()
{
$order = new CSABPersonOrder();
$order->setAttributes(CRequest::getArray($order::getClassName()));
if ($order->validate()) {
$order->save();
$this->redirect("index.php?action=edit&id=" . $order->person_id);
return true;
}
$this->setData("order", $order);
$this->renderView("_staff/order_sab/edit.tpl");
}
示例9: actionSave
public function actionSave()
{
$rate = new CRate();
$rate->setAttributes(CRequest::getArray($rate::getClassName()));
if ($rate->validate()) {
$rate->save();
$this->redirect("?action=index");
return true;
}
$this->setData("rate", $rate);
$this->renderView("_rates/rate/edit.tpl");
}
示例10: actionSave
public function actionSave()
{
$speciality = new CSpeciality();
$speciality->setAttributes(CRequest::getArray($speciality::getClassName()));
if ($speciality->validate()) {
$speciality->save();
$this->redirect("?action=index");
return true;
}
$this->setData("speciality", $speciality);
$this->renderView("_specialities/edit.tpl");
}
示例11: actionSave
public function actionSave()
{
$corriculum = new CCorriculum();
$corriculum->setAttributes(CRequest::getArray($corriculum::getClassName()));
if ($corriculum->validate()) {
$corriculum->save();
$this->redirect("?action=view&id=" . $corriculum->getId());
return true;
}
$this->setData("corriculum", $corriculum);
$this->addCSSInclude(JQUERY_UI_CSS_PATH);
$this->addJSInclude(JQUERY_UI_JS_PATH);
$this->renderView("_corriculum/_plan/edit.tpl");
}
示例12: actionSave
public function actionSave()
{
$t = new CCoreModelFieldTranslation();
$t->setAttributes(CRequest::getArray($t::getClassName()));
if ($t->validate()) {
$t->save();
if ($this->continueEdit()) {
$this->redirect("translations.php?action=edit&id=" . $t->getId());
} else {
$this->redirect("fields.php?action=edit&id=" . $t->field_id);
}
}
$this->setData("translation", $t);
$this->renderView("_core/translation/edit.tpl");
}
示例13: actionSave
public function actionSave()
{
$checkboxes = array("dashboard_enabled", "dashboard_show_birthdays", "dashboard_show_messages", "dashboard_show_all_tasks", "dashboard_check_messages");
$settings = new CUserSettings();
$settings->setAttributes(CRequest::getArray($settings::getClassName()));
foreach ($checkboxes as $box) {
if (!array_key_exists($box, CRequest::getArray($settings::getClassName()))) {
$settings->{$box} = 0;
}
}
if ($settings->validate()) {
$settings->save();
$this->redirect("?action=index");
}
}
示例14: actionSave
public function actionSave()
{
$child = new CPersonChild();
$child->setAttributes(CRequest::getArray($child::getClassName()));
if ($child->validate()) {
$child->birth_date = date("Y-m-d", strtotime($child->birth_date));
$child->save();
$this->redirect("index.php?action=edit&id=" . $child->kadri_id);
return true;
}
$this->addJSInclude(JQUERY_UI_JS_PATH);
$this->addCSSInclude(JQUERY_UI_CSS_PATH);
$this->setData("child", $child);
$this->renderView("_staff/child/add.tpl");
}
示例15: actionSave
public function actionSave()
{
$object = new CWorkPlanSelfEducationBlock();
$object->setAttributes(CRequest::getArray($object::getClassName()));
if ($object->validate()) {
$object->save();
if ($this->continueEdit()) {
$this->redirect("workplanselfeducationblocks.php?action=edit&id=" . $object->getId());
} else {
$this->redirect("workplancontentloads.php?action=edit&id=" . $object->load_id);
}
return true;
}
$this->setData("object", $object);
$this->renderView("_corriculum/_workplan/selfEducationBlocks/edit.tpl");
}