ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 public. More...
 
 getAdminTabs (&$tabs_gui)
 
 getTabs (&$tabs_gui)
 get tabs 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 ()
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor 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 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...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 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 public More...
 
 setAdminTabs ()
 set admin tabs 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, $a_catch_errors=true)
 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...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

Member Function Documentation

◆ __initSubTabs()

ilObjExternalToolsSettingsGUI::__initSubTabs (   $a_cmd)

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

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

552  {
553  $maps = ($a_cmd == 'editMaps') ? true : false;
554  $mathjax = ($a_cmd == 'editMathJax') ? true : false;
555  $socialbookmarks = ($a_cmd == 'editSocialBookmarks') ? true : false;
556 
557  $this->tabs_gui->addSubTabTarget("maps_extt_maps", $this->ctrl->getLinkTarget($this, "editMaps"),
558  "", "", "", $maps);
559  $this->tabs_gui->addSubTabTarget("mathjax_mathjax", $this->ctrl->getLinkTarget($this, "editMathJax"),
560  "", "", "", $mathjax);
561  $this->tabs_gui->addSubTabTarget("socialbm_extt_social_bookmarks", $this->ctrl->getLinkTarget($this, "editSocialBookmarks"),
562  "", "", "", $socialbookmarks);
563  }
+ Here is the caller graph for this function:

◆ addSocialBookmarkObject()

ilObjExternalToolsSettingsGUI::addSocialBookmarkObject ( )

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

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

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

◆ confirmDeleteSocialBookmarksObject()

ilObjExternalToolsSettingsGUI::confirmDeleteSocialBookmarksObject ( )

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

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

263  {
264  global $ilAccess, $rbacreview, $lng, $ilCtrl;
265 
266  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
267  {
268  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
269  }
270 
271 
272  $ids = ((int)$_GET['sbm_id']) ? array((int)$_GET['sbm_id']) : $_POST['sbm_id'];
273  include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
274  ilSocialBookmarks::_delete($ids, false);
275  $this->editSocialBookmarksObject();
276  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static _delete($id)
update a social bookmark service
editSocialBookmarksObject()
Configure social bookmark settings.
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ createSocialBookmarkObject()

ilObjExternalToolsSettingsGUI::createSocialBookmarkObject ( )

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

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

84  {
85  global $ilAccess, $rbacreview, $lng, $ilCtrl;
86 
87  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
88  {
89  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
90  }
91 
92  include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
93  $form = ilSocialBookmarks::_initForm($this, 'create');
94  if ($form->checkInput())
95  {
96  $title = $form->getInput('title');
97  $link = $form->getInput('link');
98  $file = $form->getInput('image_file');
99  $active = $form->getInput('activate');
100 
101  $extension = pathinfo($file['name'], PATHINFO_EXTENSION);
102  $icon_path = ilUtil::getWebspaceDir() . DIRECTORY_SEPARATOR . 'social_bm_icons' . DIRECTORY_SEPARATOR . time() . '.' . $extension;
103 
104  $path = ilUtil::getWebspaceDir() . DIRECTORY_SEPARATOR . 'social_bm_icons';
105  if (!is_dir($path))
107 
108  ilSocialBookmarks::_insertSocialBookmark($title, $link, $active, $icon_path);
109 
110  ilUtil::moveUploadedFile($file['tmp_name'], $file['name'], $icon_path);
111 
112  $this->editSocialBookmarksObject();
113  }
114  else
115  {
116  $this->__initSubTabs("editSocialBookmarks");
117  $form->setValuesByPost();
118  $this->tpl->setVariable('ADM_CONTENT', $form->getHTML());
119  }
120  }
print $file
editSocialBookmarksObject()
Configure social bookmark settings.
global $ilCtrl
Definition: ilias.php:18
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
redirection script todo: (a better solution should control the processing via a xml file) ...
static createDirectory($a_dir, $a_mod=0755)
create directory
static _insertSocialBookmark($title, $link, $active, $icon_path)
insert new social bookmark service
static _initForm($formhandlerObject, $mode="create", $id=0)
Init Social Bookmark edit/create Form.
$path
Definition: index.php:22
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:

◆ deleteSocialBookmarksObject()

ilObjExternalToolsSettingsGUI::deleteSocialBookmarksObject ( )

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

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

229  {
230  global $ilAccess, $rbacreview, $lng, $ilCtrl;
231 
232  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
233  {
234  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
235 
236  }
237 
238  $this->__initSubTabs("editSocialBookmarks");
239 
240  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
241  $c_gui = new ilConfirmationGUI();
242 
243  $ids = ((int)$_GET['sbm_id']) ? array((int)$_GET['sbm_id']) : $_POST['sbm_id'];
244 
245  // set confirm/cancel commands
246  $c_gui->setFormAction($ilCtrl->getFormAction($this, "confirmDeleteSocialBookmarks"));
247  $c_gui->setHeaderText($lng->txt("socialbm_sure_delete_entry"));
248  $c_gui->setCancel($lng->txt("cancel"), "editSocialBookmarks");
249  $c_gui->setConfirm($lng->txt("confirm"), "confirmDeleteSocialBookmarks");
250 
251  include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
252  // add items to delete
253  foreach($ids as $id)
254  {
255  $entry = ilSocialBookmarks::_getEntry($id);
256  $c_gui->addItem("sbm_id[]", $id, $entry->sbm_title . ' (' . str_replace('{', '{', $entry->sbm_link) . ')');
257  }
258 
259  $this->tpl->setVariable('ADM_CONTENT', $c_gui->getHTML());
260  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
Confirmation screen class.
+ Here is the call graph for this function:

◆ disableSocialBookmarksObject()

ilObjExternalToolsSettingsGUI::disableSocialBookmarksObject ( )

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

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

214  {
215  global $ilAccess, $rbacreview, $lng, $ilCtrl;
216 
217  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
218  {
219  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
220 
221  }
222  $ids = ((int)$_GET['sbm_id']) ? array((int)$_GET['sbm_id']) : $_POST['sbm_id'];
223  include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
224  ilSocialBookmarks::_setActive($ids, false);
225  $this->editSocialBookmarksObject();
226  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
editSocialBookmarksObject()
Configure social bookmark settings.
global $ilCtrl
Definition: ilias.php:18
static _setActive($id, $active=true)
update a social bookmark service
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ editMapsObject()

ilObjExternalToolsSettingsGUI::editMapsObject ( )

Configure maps settings.

public

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

References $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, __initSubTabs(), ilMapUtil\DEFAULT_TILE, ilMapUtil\getApiKey(), ilMapUtil\getAvailableMapTypes(), ilMapUtil\getStdGeolocationServer(), ilMapUtil\getStdLatitude(), ilMapUtil\getStdLongitude(), ilMapUtil\getStdTileServers(), ilMapUtil\getStdZoom(), ilMapUtil\getType(), ilMapUtil\isActivated(), ilCheckboxInputGUI\setChecked(), ilLocationInputGUI\setLatitude(), ilSelectInputGUI\setOptions(), and ilTextInputGUI\setValue().

460  {
461  require_once("Services/Maps/classes/class.ilMapUtil.php");
462 
463  global $ilAccess, $lng, $ilCtrl, $tpl;
464 
465  $this->__initSubTabs("editMaps");
466  $std_latitude = ilMapUtil::getStdLatitude();
467  $std_longitude = ilMapUtil::getStdLongitude();
468  $std_zoom = ilMapUtil::getStdZoom();
469  $type = ilMapUtil::getType();
470 
471  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
472  include_once("./Services/Form/classes/class.ilCheckboxOption.php");
473  $form = new ilPropertyFormGUI();
474  $form->setFormAction($ilCtrl->getFormAction($this));
475  $form->setTitle($lng->txt("maps_settings"));
476 
477  // Enable Maps
478  $enable = new ilCheckboxInputGUI($lng->txt("maps_enable_maps"), "enable");
480  $enable->setInfo($lng->txt("maps_enable_maps_info"));
481  $form->addItem($enable);
482 
483  // Select type
484  $types = new ilSelectInputGUI($lng->txt("maps_map_type"), "type");
486  $types->setValue($type);
487  $form->addItem($types);
488 
489  // map data server property
490  if($type == "openlayers") {
491  $tile = new ilTextInputGUI($lng->txt("maps_tile_server"),"tile");
493  $tile->setInfo(sprintf($lng->txt("maps_custom_tile_server_info"),ilMapUtil::DEFAULT_TILE));
494  $geolocation = new ilTextInputGUI($lng->txt("maps_geolocation_server"),"geolocation");
496  $geolocation->setInfo($lng->txt("maps_custom_geolocation_server_info"));
497 
498  $form->addItem($tile);
499  $form->addItem($geolocation);
500  } else {
501  // api key for google
502  $key = new ilTextInputGUI("Google API Key", "api_key");
503  $key->setMaxLength(200);
504  $key->setValue(ilMapUtil::getApiKey());
505  $form->addItem($key);
506  }
507 
508  // location property
509  $loc_prop = new ilLocationInputGUI($lng->txt("maps_std_location"),
510  "std_location");
511 
512  $loc_prop->setLatitude($std_latitude);
513  $loc_prop->setLongitude($std_longitude);
514  $loc_prop->setZoom($std_zoom);
515  $form->addItem($loc_prop);
516 
517  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
518  {
519  $form->addCommandButton("saveMaps", $lng->txt("save"));
520  $form->addCommandButton("view", $lng->txt("cancel"));
521  }
522 
523  $tpl->setVariable("ADM_CONTENT", $form->getHTML());
524  }
setLatitude($a_latitude)
Set Latitude.
static getType()
const DEFAULT_TILE
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a checkbox property in a property form.
static getStdLongitude()
static getStdZoom()
global $ilCtrl
Definition: ilias.php:18
static getApiKey()
setChecked($a_checked)
Set Checked.
static getStdLatitude()
This class represents a location property in a property form.
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
static getAvailableMapTypes()
Get a dict { $id => $name } for available maps services.
static isActivated()
Checks whether Map feature is activated.
static getStdGeolocationServer()
Returns the reverse geolocation server to be used in the installation.
static getStdTileServers()
Returns the tile server to be used in the installation.
setValue($a_value)
Set Value.
+ Here is the call graph for this function:

◆ editMathJaxObject()

ilObjExternalToolsSettingsGUI::editMathJaxObject ( )

Configure MathJax settings.

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

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

384  {
385  global $ilAccess, $rbacreview, $lng, $ilCtrl, $tpl;
386 
387  $mathJaxSetting = new ilSetting("MathJax");
388  $path_to_mathjax = $mathJaxSetting->get("path_to_mathjax");
389 
390  $this->__initSubTabs("editMathJax");
391 
392  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
393  $form = new ilPropertyFormGUI();
394  $form->setFormAction($ilCtrl->getFormAction($this));
395  $form->setTitle($lng->txt("mathjax_settings"));
396 
397  // Enable MathJax
398  $enable = new ilCheckboxInputGUI($lng->txt("mathjax_enable_mathjax"), "enable");
399  $enable->setChecked($mathJaxSetting->get("enable"));
400  $enable->setInfo($lng->txt("mathjax_enable_mathjax_info")." <a target='blank' href='http://www.mathjax.org/'>MathJax</a>");
401  $form->addItem($enable);
402 
403  // Path to mathjax
404  $text_prop = new ilTextInputGUI($lng->txt("mathjax_path_to_mathjax"), "path_to_mathjax");
405  $text_prop->setInfo($lng->txt("mathjax_path_to_mathjax_desc"));
406  $text_prop->setValue($path_to_mathjax);
407  $text_prop->setRequired(true);
408  $text_prop->setMaxLength(400);
409  $text_prop->setSize(100);
410  $enable->addSubItem($text_prop);
411 
412  // mathjax limiter
413  $options = array(
414  0 => '\(...\)',
415  1 => '[tex]...[/tex]',
416  2 => '&lt;span class="math"&gt;...&lt;/span&gt;'
417  );
418  $si = new ilSelectInputGUI($this->lng->txt("mathjax_limiter"), "limiter");
419  $si->setOptions($options);
420  $si->setValue($mathJaxSetting->get("limiter"));
421  $si->setInfo($this->lng->txt("mathjax_limiter_info"));
422  $enable->addSubItem($si);
423 
424  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
425  {
426  $form->addCommandButton("saveMathJax", $lng->txt("save"));
427  }
428 
429  $tpl->setVariable("ADM_CONTENT", $form->getHTML());
430  }
ILIAS Setting Class.
This class represents a selection list property in a property form.
This class represents a property form user interface.
if(strpos($jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:34
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
setChecked($a_checked)
Set Checked.
if(!is_array($argv)) $options
This class represents a text property in a property form.
+ Here is the call graph for this function:

◆ editSocialBookmarkObject()

ilObjExternalToolsSettingsGUI::editSocialBookmarkObject ( )

edit a social bookmark

public

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

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

173  {
174  global $ilAccess, $rbacreview, $lng, $ilCtrl;
175 
176  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
177  {
178  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
179  }
180 
181  $this->__initSubTabs("editSocialBookmarks");
182 
183  include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
185  $dset = array
186  (
187  'sbm_id' => $row->sbm_id,
188  'title' => $row->sbm_title,
189  'link' => $row->sbm_link,
190  'activate' => $row->sbm_active
191  );
192 
193  $form = ilSocialBookmarks::_initForm($this, 'update');
194  $form->setValuesByArray($dset);
195  $this->tpl->setVariable('ADM_CONTENT', $form->getHTML());
196  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
static _initForm($formhandlerObject, $mode="create", $id=0)
Init Social Bookmark edit/create Form.
+ Here is the call graph for this function:

◆ editSocialBookmarksObject()

ilObjExternalToolsSettingsGUI::editSocialBookmarksObject ( )

Configure social bookmark settings.

public

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

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

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

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

◆ enableSocialBookmarksObject()

ilObjExternalToolsSettingsGUI::enableSocialBookmarksObject ( )

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

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

199  {
200  global $ilAccess, $rbacreview, $lng, $ilCtrl;
201 
202  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
203  {
204  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
205  }
206 
207  $ids = ((int)$_GET['sbm_id']) ? array((int)$_GET['sbm_id']) : $_POST['sbm_id'];
208  include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
209  ilSocialBookmarks::_setActive($ids, true);
210  $this->editSocialBookmarksObject();
211  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
editSocialBookmarksObject()
Configure social bookmark settings.
global $ilCtrl
Definition: ilias.php:18
static _setActive($id, $active=true)
update a social bookmark service
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ executeCommand()

& ilObjExternalToolsSettingsGUI::executeCommand ( )

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

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

566  {
567  global $ilAccess;
568 
569  $next_class = $this->ctrl->getNextClass($this);
570  $cmd = $this->ctrl->getCmd();
571  $this->prepareOutput();
572 
573  if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
574  {
575  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
576  }
577 
578  switch($next_class)
579  {
580  case 'ilecssettingsgui':
581  $this->tabs_gui->setTabActive('ecs_server_settings');
582  include_once('./Services/WebServices/ECS/classes/class.ilECSSettingsGUI.php');
583  $this->ctrl->forwardCommand(new ilECSSettingsGUI());
584  break;
585 
586  case 'ilpermissiongui':
587  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
588  $perm_gui =& new ilPermissionGUI($this);
589  $ret =& $this->ctrl->forwardCommand($perm_gui);
590  $this->tabs_gui->setTabActive('perm_settings');
591  break;
592 
593  default:
594  $this->tabs_gui->setTabActive('settings');
595  if(!$cmd || $cmd == 'view')
596  {
597  $cmd = "editMaps";
598  }
599  $cmd .= "Object";
600  $this->$cmd();
601 
602  break;
603  }
604  return true;
605  }
$cmd
Definition: sahs_server.php:35
redirection script todo: (a better solution should control the processing via a xml file) ...
prepareOutput()
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjExternalToolsSettingsGUI::getAdminTabs ( $tabs_gui)

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

References getTabs().

37  {
38  $this->getTabs($tabs_gui);
39  }
+ Here is the call graph for this function:

◆ getTabs()

ilObjExternalToolsSettingsGUI::getTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

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

Referenced by getAdminTabs().

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("editMaps", "editMathJax", "editSocialBookmarks", ""), "", "");
57  $this->lng->loadLanguageModule('ecs');
58  }
59 
60  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
61  {
62  $tabs_gui->addTarget("perm_settings",
63  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
64  }
65  }
+ Here is the caller graph for this function:

◆ ilObjExternalToolsSettingsGUI()

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

Constructor public.

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

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

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 public.
+ Here is the call graph for this function:

◆ saveMapsObject()

ilObjExternalToolsSettingsGUI::saveMapsObject ( )

Save Maps Setttings.

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

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

531  {
532  require_once("Services/Maps/classes/class.ilMapUtil.php");
533 
534  global $ilCtrl;
535  if(ilUtil::stripSlashes($_POST["type"]) == 'openlayers' && 'openlayers' == ilMapUtil::getType()) {
538  } else {
540  }
541 
544  ilMapUtil::setStdLatitude(ilUtil::stripSlashes($_POST["std_location"]["latitude"]));
545  ilMapUtil::setStdLongitude(ilUtil::stripSlashes($_POST["std_location"]["longitude"]));
546  ilMapUtil::setStdZoom(ilUtil::stripSlashes($_POST["std_location"]["zoom"]));
547  $ilCtrl->redirect($this, "editMaps");
548  }
static getType()
$_POST['username']
Definition: cron.php:12
static setStdZoom($a_zoom)
static setStdGeolocationServer($a_geolocation)
static setStdLongitude($a_lon)
global $ilCtrl
Definition: ilias.php:18
static setStdTileServers($a_tile)
static setApiKey($a_api_key)
static setActivated($a_activated)
static setType($a_type)
static setStdLatitude($a_lat)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:

◆ saveMathJaxObject()

ilObjExternalToolsSettingsGUI::saveMathJaxObject ( )

Save MathJax Setttings.

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

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

436  {
437  global $ilCtrl, $lng, $ilAccess;
438 
439  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
440  {
441  $path_to_mathjax = ilUtil::stripSlashes($_POST["path_to_mathjax"]);
442  $mathJaxSetting = new ilSetting("MathJax");
443  if ($_POST["enable"])
444  {
445  $mathJaxSetting->set("path_to_mathjax", $path_to_mathjax);
446  $mathJaxSetting->set("limiter", (int) $_POST["limiter"]);
447  }
448  $mathJaxSetting->set("enable", ilUtil::stripSlashes($_POST["enable"]));
449  ilUtil::sendInfo($lng->txt("msg_obj_modified"));
450  }
451  $ilCtrl->redirect($this, "editMathJax");
452  }
ILIAS Setting Class.
$_POST['username']
Definition: cron.php:12
if(strpos($jquery_path, './')===0) else if(strpos($jquery_path, '.')===0) $mathJaxSetting
Definition: latex.php:34
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:

◆ updateSocialBookmarkObject()

ilObjExternalToolsSettingsGUI::updateSocialBookmarkObject ( )

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

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

123  {
124  global $ilAccess, $rbacreview, $lng, $ilCtrl;
125 
126  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
127  {
128  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
129  }
130 
131  include_once './Services/Administration/classes/class.ilSocialBookmarks.php';
132  $form = ilSocialBookmarks::_initForm($this, 'update');
133  if ($form->checkInput())
134  {
135  $title = $form->getInput('title');
136  $link = $form->getInput('link');
137  $file = $form->getInput('image_file');
138  $active = $form->getInput('activate');
139  $id = $form->getInput('sbm_id');
140 
141  if (!$file['name'])
142  ilSocialBookmarks::_updateSocialBookmark($id, $title, $link, $active);
143  else
144  {
145  $extension = pathinfo($file['name'], PATHINFO_EXTENSION);
146  $icon_path = ilUtil::getWebspaceDir() . DIRECTORY_SEPARATOR . 'social_bm_icons' . DIRECTORY_SEPARATOR . time() . '.' . $extension;
147 
148  $path = ilUtil::getWebspaceDir() . DIRECTORY_SEPARATOR . 'social_bm_icons';
149  if (!is_dir($path))
151 
153  ilSocialBookmarks::_updateSocialBookmark($id, $title, $link, $active, $icon_path);
154  ilUtil::moveUploadedFile($file['tmp_name'], $file['name'], $icon_path);
155  }
156 
157  $this->editSocialBookmarksObject();
158  }
159  else
160  {
161  $this->__initSubTabs("editSocialBookmarks");
162  $form->setValuesByPost();
163  $this->tpl->setVariable('ADM_CONTENT', $form->getHTML());
164  }
165  }
print $file
editSocialBookmarksObject()
Configure social bookmark settings.
global $ilCtrl
Definition: ilias.php:18
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static _deleteImage($id)
delete image of an service
redirection script todo: (a better solution should control the processing via a xml file) ...
static createDirectory($a_dir, $a_mod=0755)
create directory
static _updateSocialBookmark($id, $title, $link, $active, $icon_path=false)
update a social bookmark service
static _initForm($formhandlerObject, $mode="create", $id=0)
Init Social Bookmark edit/create Form.
$path
Definition: index.php:22
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:

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