47         $a_export_callback = null,
    48         string $a_export_subobj_title = null
    52         $this->
lng = $DIC->language();
    53         $this->
ctrl = $DIC->ctrl();
    54         $this->tpl = $DIC[
"tpl"];
    55         $this->
toolbar = $DIC->toolbar();
    56         $this->request = $DIC->http()->request();
    57         $lng = $DIC->language();
    59         $this->parent_id = $a_parent_id;
    60         $this->export_callback = $a_export_callback;
    61         $this->export_subobj_title = $a_export_subobj_title;
    65         $params = $this->request->getQueryParams();
    66         $body = $this->request->getParsedBody();
    67         $this->requested_cat_id = (
int) ($body[
"cat_id"] ?? (
$params[
"cat_id"] ?? 0));
    69         if ($this->requested_cat_id) {
    72                 $this->cat_id = $cat->getId();
    85         $cmd = $ilCtrl->getCmd(
"listCategories");
    87         switch ($next_class) {
   101         $ilToolbar->addButton(
   102             $lng->
txt(
"rating_add_category"),
   103             $ilCtrl->getLinkTarget($this, 
"add")
   106         $ilToolbar->addSeparator();
   108         $ilToolbar->addButton(
   110             $ilCtrl->getLinkTarget($this, 
"export")
   124         $form->setTarget(
"_top");
   125         $form->setFormAction($ilCtrl->getFormAction($this, 
"save"));
   126         $form->setTitle($lng->
txt(
"rating_category_" . ($a_id ? 
"edit" : 
"create")));
   130         $ti->setMaxLength(128);
   132         $ti->setRequired(
true);
   143             $form->addCommandButton(
"save", $lng->
txt(
"rating_category_add"));
   146             $ti->setValue($cat->getTitle());
   147             $ta->setValue($cat->getDescription());
   149             $form->addCommandButton(
"update", $lng->
txt(
"rating_category_update"));
   151         $form->addCommandButton(
"listCategories", $lng->
txt(
"cancel"));
   167     protected function save(): void
   173         if ($form->checkInput()) {
   175             $cat->setParentId($this->parent_id);
   176             $cat->setTitle($form->getInput(
"title"));
   177             $cat->setDescription($form->getInput(
"desc"));
   180             $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"rating_category_created"));
   181             $ilCtrl->redirect($this, 
"listCategories");
   184         $form->setValuesByPost();
   208         if ($form->checkInput()) {
   210             $cat->setTitle($form->getInput(
"title"));
   211             $cat->setDescription($form->getInput(
"desc"));
   214             $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"rating_category_updated"));
   215             $ilCtrl->redirect($this, 
"listCategories");
   218         $form->setValuesByPost();
   227         $body = $this->request->getParsedBody();
   228         $order = $body[
"pos"];
   232         foreach ($order as 
$id => $pos) {
   236                 $cat->setPosition($cnt);
   241         $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"settings_saved"), 
true);
   242         $ilCtrl->redirect($this, 
"listCategories");
   251         if (!$this->cat_id) {
   257         $cgui->setHeaderText($lng->
txt(
"rating_category_delete_sure") . 
"<br/>" .
   258             $lng->
txt(
"info_delete_warning_no_trash"));
   260         $cgui->setFormAction($ilCtrl->getFormAction($this));
   261         $cgui->setCancel($lng->
txt(
"cancel"), 
"listCategories");
   262         $cgui->setConfirm($lng->
txt(
"confirm"), 
"delete");
   265         $cgui->addItem(
"cat_id", $this->cat_id, $cat->getTitle());
   270     protected function delete(): 
void   277             $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"rating_category_deleted"), 
true);
   286             $cat->setPosition($cnt);
   290         $ilCtrl->redirect($this, 
"listCategories");
   298         $excel->addSheet($lng->
txt(
"rating_categories"));
   303             $active[$item[
"id"]] = $item[
"title"];
   308         $excel->setCell($row, 0, $this->export_subobj_title . 
" (" . $lng->
txt(
"id") . 
")");
   309         $excel->setCell($row, 1, $this->export_subobj_title);
   310         $excel->setCell($row, 2, $lng->
txt(
"rating_export_category") . 
" (" . $lng->
txt(
"id") . 
")");
   311         $excel->setCell($row, 3, $lng->
txt(
"rating_export_category"));
   312         $excel->setCell($row, 4, $lng->
txt(
"rating_export_date"));
   313         $excel->setCell($row, 5, $lng->
txt(
"rating_export_rating"));
   314         $excel->setBold(
"A1:F1");
   319             if (!$item[
"sub_obj_id"]) {
   325             $sub_obj_title = $item[
"sub_obj_type"];
   326             if ($this->export_callback) {
   327                 $sub_obj_title = call_user_func($this->export_callback, $item[
"sub_obj_id"], $item[
"sub_obj_type"]);
   330             $excel->setCell($row, 0, (
int) $item[
"sub_obj_id"]);
   331             $excel->setCell($row, 1, $sub_obj_title);
   332             $excel->setCell($row, 2, (
int) $item[
"category_id"]);
   333             $excel->setCell($row, 3, $active[$item[
"category_id"]] ?? 
"");
   335             $excel->setCell($row, 5, $item[
"rating"] ?? 
"");
 executeCommand()
execute command 
 
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
 
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
 
static getExportData(int $a_obj_id, string $a_obj_type, array $a_category_ids=null)
Get export data. 
 
RequestInterface $request
 
loadLanguageModule(string $a_module)
Load language module. 
 
edit(ilPropertyFormGUI $a_form=null)
 
initCategoryForm(int $a_id=null)
 
ilGlobalTemplateInterface $tpl
 
getNextClass($a_gui_class=null)
 
Class ilRatingCategoryGUI. 
 
static _lookupTitle(int $obj_id)
 
setContent(string $a_html)
Sets content for standard template. 
 
static getAllForObject(int $a_parent_obj_id)
 
add(ilPropertyFormGUI $a_form=null)
 
__construct(int $a_parent_id, $a_export_callback=null, string $a_export_subobj_title=null)
ilRatingCategoryGUI constructor. 
 
string $export_subobj_title
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
This class represents a text area property in a property form. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
 
static _lookupType(int $id, bool $reference=false)