public function actionExport() { $res = array(); foreach (CPrintManager::getAllFormsets()->getItems() as $formset) { $f = array("title" => $formset->title, "alias" => $formset->alias, "description" => $formset->description, "context_evaluate" => $formset->context_evaluate, "context_variables" => $formset->context_variables); $res[] = $f; } $this->setData("data", serialize($res)); $this->renderView("_print/formset/export.tpl"); }
public function actionEdit() { $form = CPrintManager::getForm(CRequest::getInt("id")); $formsets = array(); foreach (CPrintManager::getAllFormsets()->getItems() as $formset) { $formsets[$formset->id] = $formset->title; } $types = array("docx" => "Microsoft Word (docx)", "odt" => "OpenOffice Writer (odt)"); $this->setData("types", $types); $this->setData("form", $form); $this->setData("formsets", $formsets); $this->renderView("_print/form/edit.tpl"); }
public function actionSave() { $field = new CPrintField(); $field->setAttributes(CRequest::getArray($field::getClassName())); if ($field->validate()) { $field->save(); if ($this->continueEdit()) { $this->redirect("?action=edit&id=" . $field->getId()); } else { $this->redirect("?action=index"); } return true; } $formsets = array(); foreach (CPrintManager::getAllFormsets()->getItems() as $formset) { $formsets[$formset->id] = $formset->title; } $types = array(1 => "Текстовый описатель", 2 => "Вывод таблицы"); $parents = array("table-row" => "Строка таблицы"); $this->setData("types", $types); $this->setData("formsets", $formsets); $this->setData("field", $field); $this->renderView("_print/field/edit.tpl"); }