ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjPDFGenerationGUI Class Reference
+ Inheritance diagram for ilObjPDFGenerationGUI:
+ Collaboration diagram for ilObjPDFGenerationGUI:

Public Member Functions

 __construct (int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
 
 getType ()
 
 executeCommand ()
 
 configForm ()
 
 saveSettings (bool $redirect_after=true)
 
 resetSettings ()
 
 getAdminTabs ()
 {} More...
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode (bool $mode=true)
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 cancelDelete ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 hasWritePermission ()
 
 handleSaveAndConf (string $command)
 
 saveConfig ()
 
 doCleanUp ()
 
 setActiveTab (string $tab='')
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $target_frame="")
 
 setTargetFrame (string $cmd, string $target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 checkPermission (string $perm, string $cmd="", string $type="", int $ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId (int $ref_id, string $cmd="")
 
 fillCloneTemplate (?string $tpl_varname, string $type)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 
 showActions ()
 
 getTabs ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget (string $append=null, bool $center=false)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Private Member Functions

 buildConfigForm (string $command, bool $populate=true)
 

Private Attributes

string $active_tab = ''
 
ilPDFGenerationRequest $pdfRequest
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Data Fields inherited from ilObject2GUI
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilObjectService $object_service
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = array()
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Deprecated:

Definition at line 24 of file class.ilObjPDFGenerationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjPDFGenerationGUI::__construct ( int  $a_id = 0,
int  $a_id_type = self::REPOSITORY_NODE_ID,
int  $a_parent_node_id = 0 
)

Definition at line 29 of file class.ilObjPDFGenerationGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

30  {
31  global $DIC;
32  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
33  $this->lng->loadLanguageModule('pdfgen');
34  $this->pdfRequest = new ilPDFGenerationRequest($this->refinery, $DIC->http());
35  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ buildConfigForm()

ilObjPDFGenerationGUI::buildConfigForm ( string  $command,
bool  $populate = true 
)
private

Definition at line 187 of file class.ilObjPDFGenerationGUI.php.

References $config, $parts, $service, ILIAS\Repository\ctrl(), ilPDFGeneratorUtils\getRendererConfig(), ilPDFGeneratorUtils\getRendererInstance(), ilPDFGeneratorUtils\getRenderers(), ILIAS\Repository\lng(), and ilLegacyFormElementsUtil\prepareFormOutput().

Referenced by handleSaveAndConf(), and saveConfig().

188  {
189  $parts = explode('::', $command);
190  $service = $parts[0];
191  $purpose = $parts[1];
192 
193  $renderers = ilPDFGeneratorUtils::getRenderers();
194 
195  $selected = $this->pdfRequest->securedString('selected_' . $service . '::' . $purpose);
196  $posted_renderer = $renderers[$service][$purpose][$selected];
197 
198  $form = new ilPropertyFormGUI();
199  $form->setFormAction($this->ctrl->getFormAction($this, 'view'));
200 
201  $form->setTitle($this->lng->txt('settings') . ' ' . $posted_renderer . ' / ' . $service . ' / ' . $purpose);
202  $service_hidden = new ilHiddenInputGUI('service');
203  $service_hidden->setValue($service);
204  $form->addItem($service_hidden);
205 
206  $purpose_hidden = new ilHiddenInputGUI('purpose');
207  $purpose_hidden->setValue($purpose);
208  $form->addItem($purpose_hidden);
209 
210  $renderer_hidden = new ilHiddenInputGUI('renderer');
211  $renderer_hidden->setValue($posted_renderer);
212  $form->addItem($renderer_hidden);
213 
214  $renderer_hidden = new ilHiddenInputGUI(
215  ilLegacyFormElementsUtil::prepareFormOutput('selected_' . $service . '::' . $purpose)
216  );
217  $renderer_hidden->setValue($selected);
218  $form->addItem($renderer_hidden);
219 
220  // Add In RendererConfig
221  $renderer = ilPDFGeneratorUtils::getRendererInstance($posted_renderer);
222  $renderer->addConfigElementsToForm($form, $service, $purpose);
223 
224  if ($populate) {
225  $config = ilPDFGeneratorUtils::getRendererConfig($service, $purpose, $posted_renderer);
226  $renderer->populateConfigElementsInForm($form, $service, $purpose, $config);
227  }
228 
229  $form->addCommandButton('saveConfig', $this->lng->txt('save'));
230  $form->addCommandButton('view', $this->lng->txt('cancel'));
231  $form->addCommandButton('resetSettings', $this->lng->txt('reset_to_default'));
232 
233  return $form;
234  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
static getRendererConfig(string $service, string $purpose, string $renderer)
static getRendererInstance(string $renderer)
static prepareFormOutput($a_str, bool $a_strip=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$service
Definition: ltiservices.php:43
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ configForm()

ilObjPDFGenerationGUI::configForm ( )

Definition at line 74 of file class.ilObjPDFGenerationGUI.php.

References ILIAS\LTI\ToolProvider\$key, $service, ilPDFCompInstaller\checkForMultipleServiceAndPurposeCombination(), ILIAS\Repository\ctrl(), ilSubmitButton\getInstance(), ilLinkButton\getInstance(), ilPDFGeneratorUtils\getPurposeMap(), ilPDFGeneratorUtils\getRenderers(), ilPDFGeneratorUtils\getSelectionMap(), hasWritePermission(), ILIAS\Repository\lng(), setActiveTab(), ilCustomInputGUI\setHtml(), and ILIAS\Repository\toolbar().

74  : void
75  {
76  $form = new ilPropertyFormGUI();
77  $form->setFormAction($this->ctrl->getFormAction($this, 'view'));
78  $purpose_map = ilPDFGeneratorUtils::getPurposeMap();
79  $selection_map = ilPDFGeneratorUtils::getSelectionMap();
80  $renderers = ilPDFGeneratorUtils::getRenderers();
81  foreach ($purpose_map as $service => $purposes) {
82  foreach ($purposes as $purpose) {
83  $section = new ilFormSectionHeaderGUI();
84  $section->setTitle(ucfirst($service) . ' / ' . ucfirst($purpose));
85  $form->addItem($section);
86 
87  $preferred = new ilTextInputGUI($this->lng->txt('preferred_renderer'));
88  $preferred->setValue($selection_map[$service][$purpose]['preferred']);
89  $preferred->setDisabled(true);
90  $form->addItem($preferred);
91 
92  $selected = new ilSelectInputGUI($this->lng->txt('selected_renderer'), 'selected_' . $service . '::' . $purpose);
93  $selected->setOptions($renderers[$service][$purpose]);
94  $selected_renderer = $selection_map[$service][$purpose]['selected'];
95  $selected_index = 0;
96  foreach ($renderers[$service][$purpose] as $key => $value) {
97  if ($value === $selected_renderer) {
98  $selected_index = $key;
99  }
100  }
101  $selected->setValue($selected_index);
102  $form->addItem($selected);
103 
104  $s_button = ilSubmitButton::getInstance();
105  $s_button->setCaption('configure');
106  $s_button->setCommand('saveandconf_selected_' . $service . '::' . $purpose);
107  if (!$this->hasWritePermission()) {
108  $s_button->setDisabled(true);
109  }
110  $input_selected = new ilCustomInputGUI($this->lng->txt('configure'));
111  $input_selected->setHtml($s_button->getToolbarHTML());
112  $form->addItem($input_selected);
113  }
114  }
115 
116  if ($this->hasWritePermission()) {
117  $form->addCommandButton("saveSettings", $this->lng->txt("save"));
118  }
119 
121  $this->tpl->setOnScreenMessage('info', $this->lng->txt('problem_with_purposes'));
122  $clean_btn = ilLinkButton::getInstance();
123  $clean_btn->setCaption('cleanup');
124  $clean_btn->setUrl($this->ctrl->getLinkTarget($this, 'doCleanUp'));
125  $this->toolbar->addButtonInstance($clean_btn);
126  }
127  $this->tpl->setContent($form->getHTML());
128  $this->setActiveTab('settings');
129  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $key
Consumer key/client ID value.
Definition: System.php:193
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$service
Definition: ltiservices.php:43
static checkForMultipleServiceAndPurposeCombination()
+ Here is the call graph for this function:

◆ doCleanUp()

ilObjPDFGenerationGUI::doCleanUp ( )
protected

Definition at line 265 of file class.ilObjPDFGenerationGUI.php.

References ILIAS\Repository\ctrl(), ilPDFCompInstaller\doCleanUp(), and ILIAS\Repository\lng().

265  : void
266  {
268  $this->tpl->setOnScreenMessage('success', $this->lng->txt('config_saved'), true);
269  $this->ctrl->redirect($this, "view");
270  }
+ Here is the call graph for this function:

◆ executeCommand()

ilObjPDFGenerationGUI::executeCommand ( )

Definition at line 47 of file class.ilObjPDFGenerationGUI.php.

References ILIAS\Repository\ctrl(), handleSaveAndConf(), and ilObject2GUI\prepareOutput().

47  : void
48  {
49  $next_class = $this->ctrl->getNextClass();
50  $cmd = $this->ctrl->getCmd();
51  $this->prepareOutput();
52 
53  switch (strtolower($next_class)) {
54  case strtolower(ilPermissionGUI::class):
55  $this->tabs_gui->setTabActive('perm_settings');
56  $perm_gui = new ilPermissionGUI($this);
57  $this->ctrl->forwardCommand($perm_gui);
58  break;
59 
60  default:
61  if ($cmd === null || $cmd === '' || $cmd === 'view') {
62  $cmd = 'configForm';
63  }
64 
65  if (strpos($cmd, 'saveandconf_selected_') === 0) {
66  $this->handleSaveAndConf(substr($cmd, 21));
67  } else {
68  $this->$cmd();
69  }
70  break;
71  }
72  }
prepareOutput(bool $show_sub_objects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjPDFGenerationGUI::getAdminTabs ( )

{}

Definition at line 275 of file class.ilObjPDFGenerationGUI.php.

References ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

275  : void
276  {
277  if (strpos($this->ctrl->getCmd(), 'saveandconf') !== 0) {
278  if ($this->checkPermissionBool('read')) {
279  $this->tabs_gui->addTarget('settings', $this->ctrl->getLinkTarget($this, 'view'), [], __CLASS__);
280  }
281 
282  if ($this->checkPermissionBool('edit_permission')) {
283  $this->tabs_gui->addTarget(
284  'perm_settings',
285  $this->ctrl->getLinkTargetByClass('ilpermissiongui', 'perm'),
286  [],
287  'ilpermissiongui'
288  );
289  }
290  } else {
291  $this->tabs_gui->setBackTarget(
292  $this->lng->txt("back"),
293  $this->ctrl->getLinkTargetByClass("ilobjpdfgenerationgui", "view")
294  );
295  }
296  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
+ Here is the call graph for this function:

◆ getType()

ilObjPDFGenerationGUI::getType ( )

Definition at line 42 of file class.ilObjPDFGenerationGUI.php.

42  : string
43  {
44  return 'pdfg';
45  }

◆ handleSaveAndConf()

ilObjPDFGenerationGUI::handleSaveAndConf ( string  $command)
protected

Definition at line 163 of file class.ilObjPDFGenerationGUI.php.

References buildConfigForm(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), saveSettings(), and setActiveTab().

Referenced by executeCommand().

163  : void
164  {
165  if (!$this->checkPermissionBool('edit')) {
166  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
167  $this->ctrl->redirect($this, "view");
168  }
169 
170  $this->saveSettings(false);
171 
172  $form = $this->buildConfigForm($command);
173  $this->tpl->setContent($form->getHTML());
174  $this->setActiveTab('settings');
175  }
buildConfigForm(string $command, bool $populate=true)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
saveSettings(bool $redirect_after=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasWritePermission()

ilObjPDFGenerationGUI::hasWritePermission ( )
protected

Definition at line 37 of file class.ilObjPDFGenerationGUI.php.

References ilObject2GUI\checkPermissionBool().

Referenced by configForm(), and saveSettings().

37  : bool
38  {
39  return $this->checkPermissionBool('write');
40  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetSettings()

ilObjPDFGenerationGUI::resetSettings ( )

Definition at line 177 of file class.ilObjPDFGenerationGUI.php.

References $service, ILIAS\Repository\ctrl(), and ilPDFGeneratorUtils\removeRendererConfig().

177  : void
178  {
179  $renderer = $this->pdfRequest->securedString('renderer');
180  $service = $this->pdfRequest->securedString('service');
181  $purpose = $this->pdfRequest->securedString('purpose');
182 
184  $this->ctrl->redirect($this, "view");
185  }
static removeRendererConfig(string $service, string $purpose, string $renderer)
$service
Definition: ltiservices.php:43
+ Here is the call graph for this function:

◆ saveConfig()

ilObjPDFGenerationGUI::saveConfig ( )
protected

Definition at line 236 of file class.ilObjPDFGenerationGUI.php.

References $config, $service, buildConfigForm(), ILIAS\Repository\ctrl(), ilPDFGeneratorUtils\getRendererInstance(), ILIAS\Repository\lng(), ilPDFGeneratorUtils\saveRendererPurposeConfig(), and setActiveTab().

236  : void
237  {
238  $renderer = $this->pdfRequest->securedString('renderer');
239  $service = $this->pdfRequest->securedString('service');
240  $purpose = $this->pdfRequest->securedString('purpose');
241 
242  $form = $this->buildConfigForm($service . '::' . $purpose, false);
243 
244  $renderer_obj = ilPDFGeneratorUtils::getRendererInstance($renderer);
245 
246  $valid_renderer_config = false;
247  if ($form->checkInput() &&
248  ($valid_renderer_config = $renderer_obj->validateConfigInForm($form, $service, $purpose))) {
249  $config = $renderer_obj->getConfigFromForm($form, $service, $purpose);
251  $this->tpl->setOnScreenMessage('success', $this->lng->txt('config_saved'), true);
252  $this->ctrl->redirect($this, 'view');
253  }
254 
255  if (!$valid_renderer_config) {
256  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('form_input_not_valid'));
257  }
258 
259  $form->setValuesByPost();
260 
261  $this->tpl->setContent($form->getHTML());
262  $this->setActiveTab('settings');
263  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
static saveRendererPurposeConfig(string $service, string $purpose, string $renderer, array $config)
static getRendererInstance(string $renderer)
buildConfigForm(string $command, bool $populate=true)
$service
Definition: ltiservices.php:43
+ Here is the call graph for this function:

◆ saveSettings()

ilObjPDFGenerationGUI::saveSettings ( bool  $redirect_after = true)

Definition at line 131 of file class.ilObjPDFGenerationGUI.php.

References $service, ILIAS\Repository\ctrl(), ilPDFGeneratorUtils\getPurposeMap(), ilPDFGeneratorUtils\getRenderers(), ilPDFGeneratorUtils\getSelectionMap(), hasWritePermission(), ILIAS\Repository\lng(), and ilPDFGeneratorUtils\updateRendererSelection().

Referenced by handleSaveAndConf().

131  : void
132  {
133  if (!$this->hasWritePermission()) {
134  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
135  $this->ctrl->redirect($this, "view");
136  }
137 
138  $purpose_map = ilPDFGeneratorUtils::getPurposeMap();
139  $selection_map = ilPDFGeneratorUtils::getSelectionMap();
140  $renderers = ilPDFGeneratorUtils::getRenderers();
141 
142  foreach ($purpose_map as $service => $purposes) {
143  foreach ($purposes as $purpose) {
144  $selected = $this->pdfRequest->securedString('selected_' . $service . '::' . $purpose);
145  $posted_renderer = $renderers[$service][$purpose][$selected] ?? null;
146  if ($posted_renderer === null) {
147  continue;
148  }
149 
150  $selected_renderer = $selection_map[$service][$purpose]['selected'];
151  if ($posted_renderer !== $selected_renderer) {
152  ilPDFGeneratorUtils::updateRendererSelection($service, $purpose, $posted_renderer);
153  }
154  }
155  }
156 
157  if ($redirect_after) {
158  $this->tpl->setOnScreenMessage('success', $this->lng->txt('config_saved'), true);
159  $this->ctrl->redirect($this, "view");
160  }
161  }
static updateRendererSelection(string $service, string $purpose, string $renderer)
$service
Definition: ltiservices.php:43
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActiveTab()

ilObjPDFGenerationGUI::setActiveTab ( string  $tab = '')
protected

Definition at line 298 of file class.ilObjPDFGenerationGUI.php.

Referenced by configForm(), handleSaveAndConf(), and saveConfig().

298  : void
299  {
300  $this->tabs_gui->setTabActive($tab === '' ? $this->active_tab : $tab);
301  }
+ Here is the caller graph for this function:

Field Documentation

◆ $active_tab

string ilObjPDFGenerationGUI::$active_tab = ''
private

Definition at line 26 of file class.ilObjPDFGenerationGUI.php.

◆ $pdfRequest

ilPDFGenerationRequest ilObjPDFGenerationGUI::$pdfRequest
private

Definition at line 27 of file class.ilObjPDFGenerationGUI.php.


The documentation for this class was generated from the following file: