Class ilRatingCategoryGUI.
More...
Class ilRatingCategoryGUI.
User interface class for rating categories.
- Author
- Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
- Version
- $Id$
Definition at line 14 of file class.ilRatingCategoryGUI.php.
◆ __construct()
ilRatingCategoryGUI::__construct |
( |
|
$a_parent_id, |
|
|
|
$a_export_callback = null , |
|
|
|
$a_export_subobj_title = null |
|
) |
| |
Definition at line 20 of file class.ilRatingCategoryGUI.php.
References $lng, and $parent_id.
24 $this->parent_id = (int)$a_parent_id;
25 $this->export_callback = $a_export_callback;
26 $this->export_subobj_title = $a_export_subobj_title;
28 $lng->loadLanguageModule(
"rating");
30 if($_REQUEST[
"cat_id"])
35 $this->cat_id = $cat->getId();
◆ add()
ilRatingCategoryGUI::add |
( |
|
$a_form = null | ) |
|
|
protected |
◆ confirmDelete()
ilRatingCategoryGUI::confirmDelete |
( |
| ) |
|
|
protected |
Definition at line 208 of file class.ilRatingCategoryGUI.php.
References $ilCtrl, $lng, $tpl, and listCategories().
217 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
219 $cgui->setHeaderText($lng->txt(
"rating_category_delete_sure").
"<br/>".
220 $lng->txt(
"info_delete_warning_no_trash"));
222 $cgui->setFormAction($ilCtrl->getFormAction($this));
223 $cgui->setCancel($lng->txt(
"cancel"),
"listCategories");
224 $cgui->setConfirm($lng->txt(
"confirm"),
"delete");
227 $cgui->addItem(
"cat_id", $this->cat_id, $cat->getTitle());
229 $tpl->setContent($cgui->getHTML());
Confirmation screen class.
◆ delete()
ilRatingCategoryGUI::delete |
( |
| ) |
|
|
protected |
◆ edit()
ilRatingCategoryGUI::edit |
( |
|
$a_form = null | ) |
|
|
protected |
◆ executeCommand()
ilRatingCategoryGUI::executeCommand |
( |
| ) |
|
◆ export()
ilRatingCategoryGUI::export |
( |
| ) |
|
|
protected |
Definition at line 256 of file class.ilRatingCategoryGUI.php.
References $lng, $row, ilObject\_lookupTitle(), ilObject\_lookupType(), array, ilRatingCategory\getAllForObject(), ilRating\getExportData(), and IL_CAL_UNIX.
260 include_once
"./Services/Excel/classes/class.ilExcel.php";
262 $excel->addSheet($lng->txt(
"rating_categories"));
268 $active[$item[
"id"]] = $item[
"title"];
273 $excel->setCell(
$row, 0, $this->export_subobj_title.
" (".$lng->txt(
"id").
")");
274 $excel->setCell(
$row, 1, $this->export_subobj_title);
275 $excel->setCell(
$row, 2, $lng->txt(
"rating_export_category").
" (".$lng->txt(
"id").
")");
276 $excel->setCell(
$row, 3, $lng->txt(
"rating_export_category"));
277 $excel->setCell(
$row, 4, $lng->txt(
"rating_export_date"));
278 $excel->setCell(
$row, 5, $lng->txt(
"rating_export_rating"));
279 $excel->setBold(
"A1:F1");
285 if(!$item[
"sub_obj_id"])
292 $sub_obj_title = $item[
"sub_obj_type"];
293 if($this->export_callback)
295 $sub_obj_title = call_user_func($this->export_callback, $item[
"sub_obj_id"], $item[
"sub_obj_type"]);
298 $excel->setCell(
$row, 0, (
int)$item[
"sub_obj_id"]);
299 $excel->setCell(
$row, 1, $sub_obj_title);
300 $excel->setCell(
$row, 2, (
int)$item[
"category_id"]);
301 $excel->setCell(
$row, 3, $active[$item[
"category_id"]]);
303 $excel->setCell(
$row, 5, $item[
"rating"]);
static _lookupTitle($a_id)
lookup object title
static getAllForObject($a_parent_obj_id)
Get all categories for object.
static getExportData($a_obj_id, $a_obj_type, array $a_category_ids=null)
Get export data.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
◆ initCategoryForm()
ilRatingCategoryGUI::initCategoryForm |
( |
|
$a_id = null | ) |
|
|
protected |
Definition at line 76 of file class.ilRatingCategoryGUI.php.
References $ilCtrl, $lng, ilTextAreaInputGUI\setCols(), and ilTextInputGUI\setMaxLength().
Referenced by add(), edit(), save(), and update().
80 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
82 $form->setTarget(
"_top");
83 $form->setFormAction($ilCtrl->getFormAction($this,
"save"));
84 $form->setTitle($lng->txt(
"rating_category_".($a_id ?
"edit" :
"create")));
90 $ti->setRequired(
true);
101 $form->addCommandButton(
"save", $lng->txt(
"rating_category_add"));
106 $ti->setValue($cat->getTitle());
107 $ta->setValue($cat->getDescription());
109 $form->addCommandButton(
"update", $lng->txt(
"rating_category_update"));
111 $form->addCommandButton(
"listCategories", $lng->txt(
"cancel"));
This class represents a text property in a property form.
setCols($a_cols)
Set Cols.
setMaxLength($a_maxlength)
Set Max Length.
This class represents a text area property in a property form.
◆ listCategories()
ilRatingCategoryGUI::listCategories |
( |
| ) |
|
|
protected |
Definition at line 58 of file class.ilRatingCategoryGUI.php.
References $ilCtrl, $lng, and $tpl.
Referenced by confirmDelete().
62 $ilToolbar->addButton($lng->txt(
"rating_add_category"),
63 $ilCtrl->getLinkTarget($this,
"add"));
65 $ilToolbar->addSeparator();
67 $ilToolbar->addButton($lng->txt(
"export"),
68 $ilCtrl->getLinkTarget($this,
"export"));
70 include_once
"Services/Rating/classes/class.ilRatingCategoryTableGUI.php";
72 $tpl->setContent($table->getHTML());
◆ save()
ilRatingCategoryGUI::save |
( |
| ) |
|
|
protected |
Definition at line 128 of file class.ilRatingCategoryGUI.php.
References $ilCtrl, $lng, add(), initCategoryForm(), and ilUtil\sendSuccess().
133 if($form->checkInput())
135 include_once
"Services/Rating/classes/class.ilRatingCategory.php";
137 $cat->setParentId($this->parent_id);
138 $cat->setTitle($form->getInput(
"title"));
139 $cat->setDescription($form->getInput(
"desc"));
143 $ilCtrl->redirect($this,
"listCategories");
146 $form->setValuesByPost();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
initCategoryForm($a_id=null)
◆ update()
ilRatingCategoryGUI::update |
( |
| ) |
|
|
protected |
Definition at line 164 of file class.ilRatingCategoryGUI.php.
References $ilCtrl, $lng, add(), initCategoryForm(), and ilUtil\sendSuccess().
169 if($form->checkInput())
171 include_once
"Services/Rating/classes/class.ilRatingCategory.php";
173 $cat->setTitle($form->getInput(
"title"));
174 $cat->setDescription($form->getInput(
"desc"));
178 $ilCtrl->redirect($this,
"listCategories");
181 $form->setValuesByPost();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
initCategoryForm($a_id=null)
◆ updateOrder()
ilRatingCategoryGUI::updateOrder |
( |
| ) |
|
|
protected |
◆ $export_callback
ilRatingCategoryGUI::$export_callback |
|
protected |
◆ $export_subobj_title
ilRatingCategoryGUI::$export_subobj_title |
|
protected |
◆ $parent_id
ilRatingCategoryGUI::$parent_id |
|
protected |
The documentation for this class was generated from the following file: