5 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
29 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
31 $lng->loadLanguageModule(
"delic");
32 $lng->loadLanguageModule(
"maps");
33 $lng->loadLanguageModule(
"mathjax");
50 $this->ctrl->setParameter($this,
"ref_id",$this->object->getRefId());
52 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
54 $tabs_gui->addTarget(
"settings",
58 $this->ctrl->getLinkTarget($this,
"editSocialBookmarks"),
59 array(
"editDelicious",
"editMaps",
"editMathJax",
""),
"",
"");
60 $this->lng->loadLanguageModule(
'ecs');
63 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
65 $tabs_gui->addTarget(
"perm_settings",
66 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
74 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
76 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
81 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
83 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
90 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
92 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
95 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
97 if ($form->checkInput())
99 $title = $form->getInput(
'title');
100 $link = $form->getInput(
'link');
101 $file = $form->getInput(
'image_file');
102 $active = $form->getInput(
'activate');
104 $extension = pathinfo(
$file[
'name'], PATHINFO_EXTENSION);
105 $icon_path =
ilUtil::getWebspaceDir() . DIRECTORY_SEPARATOR .
'social_bm_icons' . DIRECTORY_SEPARATOR . time() .
'.' . $extension;
120 $form->setValuesByPost();
121 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
129 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
131 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
134 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
136 if ($form->checkInput())
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');
148 $extension = pathinfo(
$file[
'name'], PATHINFO_EXTENSION);
149 $icon_path =
ilUtil::getWebspaceDir() . DIRECTORY_SEPARATOR .
'social_bm_icons' . DIRECTORY_SEPARATOR . time() .
'.' . $extension;
165 $form->setValuesByPost();
166 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
179 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
181 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
186 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
190 'sbm_id' =>
$row->sbm_id,
191 'title' =>
$row->sbm_title,
192 'link' =>
$row->sbm_link,
193 'activate' =>
$row->sbm_active
197 $form->setValuesByArray($dset);
198 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
205 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
207 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
210 $ids = ((int)
$_GET[
'sbm_id']) ? array((
int)
$_GET[
'sbm_id']) :
$_POST[
'sbm_id'];
211 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
220 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
222 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
225 $ids = ((int)
$_GET[
'sbm_id']) ? array((
int)
$_GET[
'sbm_id']) :
$_POST[
'sbm_id'];
226 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
235 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
237 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
243 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
246 $ids = ((int)
$_GET[
'sbm_id']) ? array((
int)
$_GET[
'sbm_id']) :
$_POST[
'sbm_id'];
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");
254 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
259 $c_gui->addItem(
"sbm_id[]", $id, $entry->sbm_title .
' (' . str_replace(
'{',
'{', $entry->sbm_link) .
')');
262 $this->tpl->setVariable(
'ADM_CONTENT', $c_gui->getHTML());
269 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
271 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
275 $ids = ((int)
$_GET[
'sbm_id']) ? array((
int)
$_GET[
'sbm_id']) :
$_POST[
'sbm_id'];
276 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
290 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
292 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
299 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
301 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
305 foreach($rset as
$row)
308 $current_selection_list->setListTitle($lng->txt(
"actions"));
309 $current_selection_list->setId(
"act_".$counter++);
311 $ilCtrl->setParameter($this,
'sbm_id', $row->sbm_id);
313 $current_selection_list->addItem($lng->txt(
"edit"),
'', $ilCtrl->getLinkTarget($this,
"editSocialBookmark"));
314 $current_selection_list->addItem($lng->txt(
"delete"),
'', $ilCtrl->getLinkTarget($this,
"deleteSocialBookmarks"));
317 if ($row->sbm_active)
319 $current_selection_list->addItem($lng->txt(
"socialbm_disable"),
'', $toggle_action = $ilCtrl->getLinkTarget($this,
"disableSocialBookmarks"));
323 $current_selection_list->addItem($lng->txt(
"socialbm_enable"),
'', $toggle_action = $ilCtrl->getLinkTarget($this,
"enableSocialBookmarks"));
331 'ID' => $row->sbm_id,
332 'TITLE' => $row->sbm_title,
333 'LINK' => str_replace(
'{',
'{', $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
339 $ilCtrl->clearParameters($this);
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');
359 $table->setDefaultOrderField(
"title");
360 $table->setDefaultOrderDirection(
"asc");
362 $table->addMultiCommand(
'enableSocialBookmarks', $lng->txt(
'socialbm_enable'));
363 $table->addMultiCommand(
'disableSocialBookmarks', $lng->txt(
'socialbm_disable'));
364 $table->addMultiCommand(
'deleteSocialBookmarks', $lng->txt(
'delete'));
366 $table->addCommandButton(
'addSocialBookmark', $lng->txt(
'create'));
368 $this->tpl->setVariable(
'ADM_CONTENT', $table->getHTML());
384 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
386 $form->setFormAction($ilCtrl->getFormAction($this));
387 $form->setTitle($lng->txt(
"mathjax_settings"));
392 $enable->setInfo($lng->txt(
"mathjax_enable_mathjax_info").
" <a target='blank' href='http://www.mathjax.org/'>MathJax</a>");
393 $form->addItem($enable);
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);
407 1 =>
'[tex]...[/tex]',
408 2 =>
'<span class="math">...</span>'
413 $si->setInfo($this->lng->txt(
"mathjax_limiter_info"));
414 $enable->addSubItem(
$si);
416 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
418 $form->addCommandButton(
"saveMathJax", $lng->txt(
"save"));
421 $tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
431 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
443 $ilCtrl->redirect($this,
"editMathJax");
453 require_once(
"Services/Maps/classes/class.ilMapUtil.php");
457 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
459 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
469 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
471 $form->setFormAction($ilCtrl->getFormAction($this));
472 $form->setTitle($lng->txt(
"maps_settings"));
477 $enable->setInfo($lng->txt(
"maps_enable_maps_info"));
478 $form->addItem($enable);
483 $types->setValue($type);
484 $form->addItem($types);
490 $loc_prop->setLongitude($std_longitude);
491 $loc_prop->setZoom($std_zoom);
492 $form->addItem($loc_prop);
494 $form->addCommandButton(
"saveMaps", $lng->txt(
"save"));
495 $form->addCommandButton(
"view", $lng->txt(
"cancel"));
497 $tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
506 require_once(
"Services/Maps/classes/class.ilMapUtil.php");
516 $ilCtrl->redirect($this,
"editMaps");
525 if($a_cmd ==
'view' || $a_cmd ==
'')
527 $a_cmd =
'editSocialBookmarks';
529 $socialbookmarks = ($a_cmd ==
'editSocialBookmarks') ?
true :
false;
530 $maps = ($a_cmd ==
'editMaps') ?
true :
false;
531 $mathjax = ($a_cmd ==
'editMathJax') ?
true :
false;
538 $this->tabs_gui->addSubTabTarget(
"maps_extt_maps", $this->ctrl->getLinkTarget($this,
"editMaps"),
540 $this->tabs_gui->addSubTabTarget(
"mathjax_mathjax", $this->ctrl->getLinkTarget($this,
"editMathJax"),
541 "",
"",
"", $mathjax);
542 $this->tabs_gui->addSubTabTarget(
"socialbm_extt_social_bookmarks", $this->ctrl->getLinkTarget($this,
"editSocialBookmarks"),
543 "",
"",
"", $socialbookmarks);
549 $next_class = $this->ctrl->getNextClass($this);
550 $cmd = $this->ctrl->getCmd();
555 case 'ilecssettingsgui':
556 $this->tabs_gui->setTabActive(
'ecs_server_settings');
557 include_once(
'./Services/WebServices/ECS/classes/class.ilECSSettingsGUI.php');
561 case 'ilpermissiongui':
562 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
564 $ret =& $this->ctrl->forwardCommand($perm_gui);
565 $this->tabs_gui->setTabActive(
'perm_settings');
569 $this->tabs_gui->setTabActive(
'settings');
572 $cmd =
"editSocialBookmarks";