ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilObjExternalToolsSettingsGUI Class Reference

Class ilObjExternalToolsSettingsGUI. More...

+ Inheritance diagram for ilObjExternalToolsSettingsGUI:
+ Collaboration diagram for ilObjExternalToolsSettingsGUI:

Public Member Functions

 ilObjExternalToolsSettingsGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor @access public. More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getTabs (&$tabs_gui)
 get tabs @access public More...
 
 addSocialBookmarkObject ()
 
 createSocialBookmarkObject ()
 
 updateSocialBookmarkObject ()
 
 editSocialBookmarkObject ()
 edit a social bookmark More...
 
 enableSocialBookmarksObject ()
 
 disableSocialBookmarksObject ()
 
 deleteSocialBookmarksObject ()
 
 confirmDeleteSocialBookmarksObject ()
 
 editSocialBookmarksObject ()
 Configure social bookmark settings. More...
 
 editMathJaxObject ()
 Configure MathJax settings. More...
 
 saveMathJaxObject ()
 Save MathJax Setttings. More...
 
 editMapsObject ()
 Configure maps settings. More...
 
 saveMapsObject ()
 Save Maps Setttings. More...
 
 __initSubTabs ($a_cmd)
 
executeCommand ()
 execute command More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_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...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Detailed Description

Member Function Documentation

◆ __initSubTabs()

ilObjExternalToolsSettingsGUI::__initSubTabs (   $a_cmd)

Definition at line 530 of file class.ilObjExternalToolsSettingsGUI.php.

531 {
532// $overview = ($a_cmd == 'view' or $a_cmd == '') ? true : false;
533 //$delicious = ($a_cmd == 'editDelicious') ? true : false;
534
535 if($a_cmd == 'view' || $a_cmd == '')
536 {
537 $a_cmd = 'editSocialBookmarks';
538 }
539 $socialbookmarks = ($a_cmd == 'editSocialBookmarks') ? true : false;
540 $maps = ($a_cmd == 'editMaps') ? true : false;
541 $mathjax = ($a_cmd == 'editMathJax') ? true : false;
542
543// $this->tabs_gui->addSubTabTarget("overview", $this->ctrl->getLinkTarget($this, "view"),
544// "", "", "", $overview);
545 /*$this->tabs_gui->addSubTabTarget("delic_extt_delicious", $this->ctrl->getLinkTarget($this, "editDelicious"),
546 "", "", "", $delicious);*/
547
548 $this->tabs_gui->addSubTabTarget("maps_extt_maps", $this->ctrl->getLinkTarget($this, "editMaps"),
549 "", "", "", $maps);
550 $this->tabs_gui->addSubTabTarget("mathjax_mathjax", $this->ctrl->getLinkTarget($this, "editMathJax"),
551 "", "", "", $mathjax);
552 $this->tabs_gui->addSubTabTarget("socialbm_extt_social_bookmarks", $this->ctrl->getLinkTarget($this, "editSocialBookmarks"),
553 "", "", "", $socialbookmarks);
554 }

Referenced by addSocialBookmarkObject(), createSocialBookmarkObject(), deleteSocialBookmarksObject(), editMapsObject(), editMathJaxObject(), editSocialBookmarkObject(), editSocialBookmarksObject(), and updateSocialBookmarkObject().

+ Here is the caller graph for this function:

◆ addSocialBookmarkObject()

ilObjExternalToolsSettingsGUI::addSocialBookmarkObject ( )

Definition at line 70 of file class.ilObjExternalToolsSettingsGUI.php.

71 {
72 global $ilAccess, $rbacreview, $lng, $ilCtrl;
73
74 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
75 {
76 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
77 }
78
79 $this->__initSubTabs("editSocialBookmarks");
80
81 include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
82 $form = ilSocialBookmarks::_initForm($this, 'create');
83 $this->tpl->setVariable('ADM_CONTENT', $form->getHTML());
84 }
static _initForm($formhandlerObject, $mode="create", $id=0)
Init Social Bookmark edit/create Form.
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file)

References $ilCtrl, ilObjectGUI\$lng, __initSubTabs(), and ilSocialBookmarks\_initForm().

+ Here is the call graph for this function:

◆ confirmDeleteSocialBookmarksObject()

ilObjExternalToolsSettingsGUI::confirmDeleteSocialBookmarksObject ( )

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

266 {
267 global $ilAccess, $rbacreview, $lng, $ilCtrl;
268
269 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
270 {
271 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
272 }
273
274
275 $ids = ((int)$_GET['sbm_id']) ? array((int)$_GET['sbm_id']) : $_POST['sbm_id'];
276 include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
277 ilSocialBookmarks::_delete($ids, false);
279 }
$_GET["client_id"]
editSocialBookmarksObject()
Configure social bookmark settings.
static _delete($id)
update a social bookmark service
$_POST['username']
Definition: cron.php:12

References $_GET, $_POST, $ilCtrl, ilObjectGUI\$lng, ilSocialBookmarks\_delete(), and editSocialBookmarksObject().

+ Here is the call graph for this function:

◆ createSocialBookmarkObject()

ilObjExternalToolsSettingsGUI::createSocialBookmarkObject ( )

Definition at line 86 of file class.ilObjExternalToolsSettingsGUI.php.

87 {
88 global $ilAccess, $rbacreview, $lng, $ilCtrl;
89
90 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
91 {
92 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
93 }
94
95 include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
96 $form = ilSocialBookmarks::_initForm($this, 'create');
97 if ($form->checkInput())
98 {
99 $title = $form->getInput('title');
100 $link = $form->getInput('link');
101 $file = $form->getInput('image_file');
102 $active = $form->getInput('activate');
103
104 $extension = pathinfo($file['name'], PATHINFO_EXTENSION);
105 $icon_path = ilUtil::getWebspaceDir() . DIRECTORY_SEPARATOR . 'social_bm_icons' . DIRECTORY_SEPARATOR . time() . '.' . $extension;
106
107 $path = ilUtil::getWebspaceDir() . DIRECTORY_SEPARATOR . 'social_bm_icons';
108 if (!is_dir($path))
110
111 ilSocialBookmarks::_insertSocialBookmark($title, $link, $active, $icon_path);
112
113 ilUtil::moveUploadedFile($file['tmp_name'], $file['name'], $icon_path);
114
116 }
117 else
118 {
119 $this->__initSubTabs("editSocialBookmarks");
120 $form->setValuesByPost();
121 $this->tpl->setVariable('ADM_CONTENT', $form->getHTML());
122 }
123 }
print $file
static _insertSocialBookmark($title, $link, $active, $icon_path)
insert new social bookmark service
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static getWebspaceDir($mode="filesystem")
get webspace directory
static createDirectory($a_dir, $a_mod=0755)
create directory
$path
Definition: index.php:22

References $file, $ilCtrl, ilObjectGUI\$lng, $path, __initSubTabs(), ilSocialBookmarks\_initForm(), ilSocialBookmarks\_insertSocialBookmark(), ilUtil\createDirectory(), editSocialBookmarksObject(), ilUtil\getWebspaceDir(), and ilUtil\moveUploadedFile().

+ Here is the call graph for this function:

◆ deleteSocialBookmarksObject()

ilObjExternalToolsSettingsGUI::deleteSocialBookmarksObject ( )

Definition at line 231 of file class.ilObjExternalToolsSettingsGUI.php.

232 {
233 global $ilAccess, $rbacreview, $lng, $ilCtrl;
234
235 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
236 {
237 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
238
239 }
240
241 $this->__initSubTabs("editSocialBookmarks");
242
243 include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
244 $c_gui = new ilConfirmationGUI();
245
246 $ids = ((int)$_GET['sbm_id']) ? array((int)$_GET['sbm_id']) : $_POST['sbm_id'];
247
248 // set confirm/cancel commands
249 $c_gui->setFormAction($ilCtrl->getFormAction($this, "confirmDeleteSocialBookmarks"));
250 $c_gui->setHeaderText($lng->txt("socialbm_sure_delete_entry"));
251 $c_gui->setCancel($lng->txt("cancel"), "editSocialBookmarks");
252 $c_gui->setConfirm($lng->txt("confirm"), "confirmDeleteSocialBookmarks");
253
254 include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
255 // add items to delete
256 foreach($ids as $id)
257 {
258 $entry = ilSocialBookmarks::_getEntry($id);
259 $c_gui->addItem("sbm_id[]", $id, $entry->sbm_title . ' (' . str_replace('{', '{', $entry->sbm_link) . ')');
260 }
261
262 $this->tpl->setVariable('ADM_CONTENT', $c_gui->getHTML());
263 }
Confirmation screen class.

References $_GET, $_POST, $ilCtrl, ilObjectGUI\$lng, __initSubTabs(), and ilSocialBookmarks\_getEntry().

+ Here is the call graph for this function:

◆ disableSocialBookmarksObject()

ilObjExternalToolsSettingsGUI::disableSocialBookmarksObject ( )

Definition at line 216 of file class.ilObjExternalToolsSettingsGUI.php.

217 {
218 global $ilAccess, $rbacreview, $lng, $ilCtrl;
219
220 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
221 {
222 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
223
224 }
225 $ids = ((int)$_GET['sbm_id']) ? array((int)$_GET['sbm_id']) : $_POST['sbm_id'];
226 include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
229 }
static _setActive($id, $active=true)
update a social bookmark service

References $_GET, $_POST, $ilCtrl, ilObjectGUI\$lng, ilSocialBookmarks\_setActive(), and editSocialBookmarksObject().

+ Here is the call graph for this function:

◆ editMapsObject()

ilObjExternalToolsSettingsGUI::editMapsObject ( )

Configure maps settings.

@access public

Definition at line 451 of file class.ilObjExternalToolsSettingsGUI.php.

452 {
453 require_once("Services/Maps/classes/class.ilMapUtil.php");
454
455 global $ilAccess, $lng, $ilCtrl, $tpl;
456
457 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
458 {
459 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
460 }
461
462 $this->__initSubTabs("editMaps");
463
464 $std_latitude = ilMapUtil::getStdLatitude();
465 $std_longitude = ilMapUtil::getStdLongitude();
466 $std_zoom = ilMapUtil::getStdZoom();
467 $type = ilMapUtil::getType();
468
469 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
470 $form = new ilPropertyFormGUI();
471 $form->setFormAction($ilCtrl->getFormAction($this));
472 $form->setTitle($lng->txt("maps_settings"));
473
474 // Enable Maps
475 $enable = new ilCheckboxInputGUI($lng->txt("maps_enable_maps"), "enable");
476 $enable->setChecked(ilMapUtil::isActivated());
477 $enable->setInfo($lng->txt("maps_enable_maps_info"));
478 $form->addItem($enable);
479
480 // Select type
481 $types = new ilSelectInputGUI($lng->txt("maps_map_type"), "type");
482 $types->setOptions(ilMapUtil::getAvailableMapTypes());
483 $types->setValue($type);
484 $form->addItem($types);
485
486 // map data server property
487 $type = ilMapUtil::getType();
488 if($type != "openlayers") {
489 // api key for google
490 $key = new ilTextInputGUI("Google API Key", "api_key");
491 $key->setMaxLength(200);
492 $key->setValue(ilMapUtil::getApiKey());
493 $form->addItem($key);
494 }
495
496 // location property
497 $loc_prop = new ilLocationInputGUI($lng->txt("maps_std_location"),
498 "std_location");
499 $loc_prop->setLatitude($std_latitude);
500 $loc_prop->setLongitude($std_longitude);
501 $loc_prop->setZoom($std_zoom);
502 $form->addItem($loc_prop);
503
504 $form->addCommandButton("saveMaps", $lng->txt("save"));
505 $form->addCommandButton("view", $lng->txt("cancel"));
506
507 $tpl->setVariable("ADM_CONTENT", $form->getHTML());
508 }
This class represents a checkbox property in a property form.
This class represents a location property in a property form.
static getApiKey()
static getStdLatitude()
static getStdLongitude()
static getStdZoom()
static isActivated()
Checks whether Map feature is activated.
static getAvailableMapTypes()
Get a dict { $id => $name } for available maps services.
static getType()
This class represents a property form user interface.
This class represents a selection list property in a property form.
This class represents a text property in a property form.

References $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, __initSubTabs(), ilMapUtil\getApiKey(), ilMapUtil\getAvailableMapTypes(), ilMapUtil\getStdLatitude(), ilMapUtil\getStdLongitude(), ilMapUtil\getStdZoom(), ilMapUtil\getType(), and ilMapUtil\isActivated().

+ Here is the call graph for this function:

◆ editMathJaxObject()

ilObjExternalToolsSettingsGUI::editMathJaxObject ( )

Configure MathJax settings.

Definition at line 375 of file class.ilObjExternalToolsSettingsGUI.php.

376 {
377 global $ilAccess, $rbacreview, $lng, $ilCtrl, $tpl;
378
379 $mathJaxSetting = new ilSetting("MathJax");
380 $path_to_mathjax = $mathJaxSetting->get("path_to_mathjax");
381
382 $this->__initSubTabs("editMathJax");
383
384 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
385 $form = new ilPropertyFormGUI();
386 $form->setFormAction($ilCtrl->getFormAction($this));
387 $form->setTitle($lng->txt("mathjax_settings"));
388
389 // Enable MathJax
390 $enable = new ilCheckboxInputGUI($lng->txt("mathjax_enable_mathjax"), "enable");
391 $enable->setChecked($mathJaxSetting->get("enable"));
392 $enable->setInfo($lng->txt("mathjax_enable_mathjax_info")." <a target='blank' href='http://www.mathjax.org/'>MathJax</a>");
393 $form->addItem($enable);
394
395 // Path to mathjax
396 $text_prop = new ilTextInputGUI($lng->txt("mathjax_path_to_mathjax"), "path_to_mathjax");
397 $text_prop->setInfo($lng->txt("mathjax_path_to_mathjax_desc"));
398 $text_prop->setValue($path_to_mathjax);
399 $text_prop->setRequired(true);
400 $text_prop->setMaxLength(400);
401 $text_prop->setSize(100);
402 $enable->addSubItem($text_prop);
403
404 // mathjax limiter
405 $options = array(
406 0 => '\‍(...\‍)',
407 1 => '[tex]...[/tex]',
408 2 => '&lt;span class="math"&gt;...&lt;/span&gt;'
409 );
410 $si = new ilSelectInputGUI($this->lng->txt("mathjax_limiter"), "limiter");
411 $si->setOptions($options);
412 $si->setValue($mathJaxSetting->get("limiter"));
413 $si->setInfo($this->lng->txt("mathjax_limiter_info"));
414 $enable->addSubItem($si);
415
416 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
417 {
418 $form->addCommandButton("saveMathJax", $lng->txt("save"));
419 }
420
421 $tpl->setVariable("ADM_CONTENT", $form->getHTML());
422 }
ILIAS Setting Class.
if(!is_array($argv)) $options
if(strpos( $jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:34

References $ilCtrl, ilObjectGUI\$lng, $mathJaxSetting, $options, $si, ilObjectGUI\$tpl, and __initSubTabs().

+ Here is the call graph for this function:

◆ editSocialBookmarkObject()

ilObjExternalToolsSettingsGUI::editSocialBookmarkObject ( )

edit a social bookmark

@access public

Definition at line 175 of file class.ilObjExternalToolsSettingsGUI.php.

176 {
177 global $ilAccess, $rbacreview, $lng, $ilCtrl;
178
179 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
180 {
181 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
182 }
183
184 $this->__initSubTabs("editSocialBookmarks");
185
186 include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
188 $dset = array
189 (
190 'sbm_id' => $row->sbm_id,
191 'title' => $row->sbm_title,
192 'link' => $row->sbm_link,
193 'activate' => $row->sbm_active
194 );
195
196 $form = ilSocialBookmarks::_initForm($this, 'update');
197 $form->setValuesByArray($dset);
198 $this->tpl->setVariable('ADM_CONTENT', $form->getHTML());
199 }

References $_GET, $ilCtrl, ilObjectGUI\$lng, $row, __initSubTabs(), ilSocialBookmarks\_getEntry(), and ilSocialBookmarks\_initForm().

+ Here is the call graph for this function:

◆ editSocialBookmarksObject()

ilObjExternalToolsSettingsGUI::editSocialBookmarksObject ( )

Configure social bookmark settings.

@access public

Definition at line 286 of file class.ilObjExternalToolsSettingsGUI.php.

287 {
288 global $ilAccess, $rbacreview, $lng, $ilCtrl;
289
290 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
291 {
292 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
293 }
294
295 $this->__initSubTabs("editSocialBookmarks");
296
297
298
299 include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
300
301 include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
303
304 $counter = 0;
305 foreach($rset as $row)
306 {
307 $current_selection_list = new ilAdvancedSelectionListGUI();
308 $current_selection_list->setListTitle($lng->txt("actions"));
309 $current_selection_list->setId("act_".$counter++);
310
311 $ilCtrl->setParameter($this, 'sbm_id', $row->sbm_id);
312
313 $current_selection_list->addItem($lng->txt("edit"), '', $ilCtrl->getLinkTarget($this, "editSocialBookmark"));
314 $current_selection_list->addItem($lng->txt("delete"), '', $ilCtrl->getLinkTarget($this, "deleteSocialBookmarks"));
315
316 $toggle_action = '';
317 if ($row->sbm_active)
318 {
319 $current_selection_list->addItem($lng->txt("socialbm_disable"), '', $toggle_action = $ilCtrl->getLinkTarget($this, "disableSocialBookmarks"));
320 }
321 else
322 {
323 $current_selection_list->addItem($lng->txt("socialbm_enable"), '', $toggle_action = $ilCtrl->getLinkTarget($this, "enableSocialBookmarks"));
324 }
325
326
327
328 $dset[] = array
329 (
330 'CHECK' => ilUtil::formCheckbox(0, 'sbm_id[]', $row->sbm_id),
331 'ID' => $row->sbm_id,
332 'TITLE' => $row->sbm_title,
333 'LINK' => str_replace('{', '&#123;', $row->sbm_link),
334 'ICON' => $row->sbm_icon,
335 'ACTIVE' => $row->sbm_active ? $lng->txt('enabled') : $lng->txt('disabled'),
336 'ACTIONS' => $current_selection_list->getHTML(),
337 'TOGGLE_LINK' => $toggle_action
338 );
339 $ilCtrl->clearParameters($this);
340 }
341
342 require_once 'Services/Table/classes/class.ilTable2GUI.php';
343 $table = new ilTable2GUI($this, 'editSocialBookmarks');
344 $table->setFormName('smtable');
345 $table->setId('smtable');
346 $table->setPrefix('sm');
347 $table->setFormAction($ilCtrl->getFormAction($this, 'saveSocialBookmarks'));
348 $table->addColumn('', 'check', '', true);
349 $table->addColumn($lng->txt('icon'), '');
350 $table->addColumn($lng->txt('title'), 'TITLE');
351 $table->addColumn($lng->txt('link'), 'LINK');
352 $table->addColumn($lng->txt('active'), 'ACTIVE');
353 $table->addColumn($lng->txt('actions'), '');
354 $table->setTitle($lng->txt('bm_manage_social_bm'));
355 $table->setData($dset);
356 $table->setRowTemplate('tpl.social_bookmarking_row.html', 'Services/Administration');
357 $table->setSelectAllCheckbox('sbm_id');
358
359 $table->setDefaultOrderField("title");
360 $table->setDefaultOrderDirection("asc");
361
362 $table->addMultiCommand('enableSocialBookmarks', $lng->txt('socialbm_enable'));
363 $table->addMultiCommand('disableSocialBookmarks', $lng->txt('socialbm_disable'));
364 $table->addMultiCommand('deleteSocialBookmarks', $lng->txt('delete'));
365
366 $table->addCommandButton('addSocialBookmark', $lng->txt('create'));
367
368 $this->tpl->setVariable('ADM_CONTENT', $table->getHTML());
369 }
User interface class for advanced drop-down selection lists.
Class ilTable2GUI.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? @access public

References $ilCtrl, ilObjectGUI\$lng, $row, __initSubTabs(), ilSocialBookmarks\_getEntry(), and ilUtil\formCheckbox().

Referenced by confirmDeleteSocialBookmarksObject(), createSocialBookmarkObject(), disableSocialBookmarksObject(), enableSocialBookmarksObject(), and updateSocialBookmarkObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enableSocialBookmarksObject()

ilObjExternalToolsSettingsGUI::enableSocialBookmarksObject ( )

Definition at line 201 of file class.ilObjExternalToolsSettingsGUI.php.

202 {
203 global $ilAccess, $rbacreview, $lng, $ilCtrl;
204
205 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
206 {
207 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
208 }
209
210 $ids = ((int)$_GET['sbm_id']) ? array((int)$_GET['sbm_id']) : $_POST['sbm_id'];
211 include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
214 }

References $_GET, $_POST, $ilCtrl, ilObjectGUI\$lng, ilSocialBookmarks\_setActive(), and editSocialBookmarksObject().

+ Here is the call graph for this function:

◆ executeCommand()

& ilObjExternalToolsSettingsGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 556 of file class.ilObjExternalToolsSettingsGUI.php.

557 {
558
559 $next_class = $this->ctrl->getNextClass($this);
560 $cmd = $this->ctrl->getCmd();
561 $this->prepareOutput();
562
563 switch($next_class)
564 {
565 case 'ilecssettingsgui':
566 $this->tabs_gui->setTabActive('ecs_server_settings');
567 include_once('./Services/WebServices/ECS/classes/class.ilECSSettingsGUI.php');
568 $this->ctrl->forwardCommand(new ilECSSettingsGUI());
569 break;
570
571 case 'ilpermissiongui':
572 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
573 $perm_gui =& new ilPermissionGUI($this);
574 $ret =& $this->ctrl->forwardCommand($perm_gui);
575 $this->tabs_gui->setTabActive('perm_settings');
576 break;
577
578 default:
579 $this->tabs_gui->setTabActive('settings');
580 if(!$cmd || $cmd == 'view')
581 {
582 $cmd = "editSocialBookmarks";
583 }
584 $cmd .= "Object";
585 $this->$cmd();
586
587 break;
588 }
589 return true;
590 }
prepareOutput()
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$cmd
Definition: sahs_server.php:35

References $cmd, $ret, and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjExternalToolsSettingsGUI::getAdminTabs ( $tabs_gui)

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 36 of file class.ilObjExternalToolsSettingsGUI.php.

37 {
38 $this->getTabs($tabs_gui);
39 }
getTabs(&$tabs_gui)
get tabs @access public

References getTabs().

+ Here is the call graph for this function:

◆ getTabs()

ilObjExternalToolsSettingsGUI::getTabs ( $tabs_gui)

get tabs @access public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

Definition at line 46 of file class.ilObjExternalToolsSettingsGUI.php.

47 {
48 global $rbacsystem;
49
50 $this->ctrl->setParameter($this,"ref_id",$this->object->getRefId());
51
52 if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
53 {
54 $tabs_gui->addTarget("settings",
55// $this->ctrl->getLinkTarget($this, "view"),
56// array("view","editDelicious", "editGoogleMaps","editMathJax", ""), "", "");
57
58 $this->ctrl->getLinkTarget($this, "editSocialBookmarks"),
59 array("editDelicious", "editMaps","editMathJax", ""), "", "");
60 $this->lng->loadLanguageModule('ecs');
61 }
62
63 if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
64 {
65 $tabs_gui->addTarget("perm_settings",
66 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
67 }
68 }

Referenced by getAdminTabs().

+ Here is the caller graph for this function:

◆ ilObjExternalToolsSettingsGUI()

ilObjExternalToolsSettingsGUI::ilObjExternalToolsSettingsGUI (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor @access public.

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

25 {
26 global $lng;
27
28 $this->type = "extt";
29 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
30
31 $lng->loadLanguageModule("delic");
32 $lng->loadLanguageModule("maps");
33 $lng->loadLanguageModule("mathjax");
34 }
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.

References ilObjectGUI\$lng, and ilObjectGUI\ilObjectGUI().

+ Here is the call graph for this function:

◆ saveMapsObject()

ilObjExternalToolsSettingsGUI::saveMapsObject ( )

Save Maps Setttings.

Definition at line 514 of file class.ilObjExternalToolsSettingsGUI.php.

515 {
516 require_once("Services/Maps/classes/class.ilMapUtil.php");
517
518 global $ilCtrl;
522 ilMapUtil::setStdLatitude(ilUtil::stripSlashes($_POST["std_location"]["latitude"]));
523 ilMapUtil::setStdLongitude(ilUtil::stripSlashes($_POST["std_location"]["longitude"]));
524 ilMapUtil::setStdZoom(ilUtil::stripSlashes($_POST["std_location"]["zoom"]));
525
526 $ilCtrl->redirect($this, "editMaps");
527 }
static setApiKey($a_api_key)
static setActivated($a_activated)
static setStdLatitude($a_lat)
static setStdZoom($a_zoom)
static setStdLongitude($a_lon)
static setType($a_type)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, $ilCtrl, ilMapUtil\setActivated(), ilMapUtil\setApiKey(), ilMapUtil\setStdLatitude(), ilMapUtil\setStdLongitude(), ilMapUtil\setStdZoom(), ilMapUtil\setType(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ saveMathJaxObject()

ilObjExternalToolsSettingsGUI::saveMathJaxObject ( )

Save MathJax Setttings.

Definition at line 427 of file class.ilObjExternalToolsSettingsGUI.php.

428 {
429 global $ilCtrl, $lng, $ilAccess;
430
431 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
432 {
433 $path_to_mathjax = ilUtil::stripSlashes($_POST["path_to_mathjax"]);
434 $mathJaxSetting = new ilSetting("MathJax");
435 if ($_POST["enable"])
436 {
437 $mathJaxSetting->set("path_to_mathjax", $path_to_mathjax);
438 $mathJaxSetting->set("limiter", (int) $_POST["limiter"]);
439 }
440 $mathJaxSetting->set("enable", ilUtil::stripSlashes($_POST["enable"]));
441 ilUtil::sendInfo($lng->txt("msg_obj_modified"));
442 }
443 $ilCtrl->redirect($this, "editMathJax");
444 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_POST, $ilCtrl, ilObjectGUI\$lng, $mathJaxSetting, ilUtil\sendInfo(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ updateSocialBookmarkObject()

ilObjExternalToolsSettingsGUI::updateSocialBookmarkObject ( )

Definition at line 125 of file class.ilObjExternalToolsSettingsGUI.php.

126 {
127 global $ilAccess, $rbacreview, $lng, $ilCtrl;
128
129 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
130 {
131 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
132 }
133
134 include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
135 $form = ilSocialBookmarks::_initForm($this, 'update');
136 if ($form->checkInput())
137 {
138 $title = $form->getInput('title');
139 $link = $form->getInput('link');
140 $file = $form->getInput('image_file');
141 $active = $form->getInput('activate');
142 $id = $form->getInput('sbm_id');
143
144 if (!$file['name'])
145 ilSocialBookmarks::_updateSocialBookmark($id, $title, $link, $active);
146 else
147 {
148 $extension = pathinfo($file['name'], PATHINFO_EXTENSION);
149 $icon_path = ilUtil::getWebspaceDir() . DIRECTORY_SEPARATOR . 'social_bm_icons' . DIRECTORY_SEPARATOR . time() . '.' . $extension;
150
151 $path = ilUtil::getWebspaceDir() . DIRECTORY_SEPARATOR . 'social_bm_icons';
152 if (!is_dir($path))
154
156 ilSocialBookmarks::_updateSocialBookmark($id, $title, $link, $active, $icon_path);
157 ilUtil::moveUploadedFile($file['tmp_name'], $file['name'], $icon_path);
158 }
159
161 }
162 else
163 {
164 $this->__initSubTabs("editSocialBookmarks");
165 $form->setValuesByPost();
166 $this->tpl->setVariable('ADM_CONTENT', $form->getHTML());
167 }
168 }
static _deleteImage($id)
delete image of an service
static _updateSocialBookmark($id, $title, $link, $active, $icon_path=false)
update a social bookmark service

References $file, $ilCtrl, ilObjectGUI\$lng, $path, __initSubTabs(), ilSocialBookmarks\_deleteImage(), ilSocialBookmarks\_initForm(), ilSocialBookmarks\_updateSocialBookmark(), ilUtil\createDirectory(), editSocialBookmarksObject(), ilUtil\getWebspaceDir(), and ilUtil\moveUploadedFile().

+ Here is the call graph for this function:

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