5 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
29 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
31 define (
"ILINC_DEFAULT_HTTP_PORT",80);
32 define (
"ILINC_DEFAULT_SSL_PORT",443);
33 define (
"ILINC_DEFAULT_TIMEOUT",30);
34 $lng->loadLanguageModule(
"delic");
35 $lng->loadLanguageModule(
"gmaps");
36 $lng->loadLanguageModule(
"mathjax");
86 $this->ctrl->redirect($this,
"editiLinc");
103 $this->ctrl->setParameter($this,
"ref_id",$this->object->getRefId());
105 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
107 $tabs_gui->addTarget(
"settings",
111 $this->ctrl->getLinkTarget($this,
"editSocialBookmarks"),
112 array(
"editiLinc",
"editDelicious",
"editGoogleMaps",
"editMathJax",
""),
"",
"");
113 $this->lng->loadLanguageModule(
'ecs');
116 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
118 $tabs_gui->addTarget(
"perm_settings",
119 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
130 global $rbacsystem, $rbacreview;
132 if (!$rbacsystem->checkAccess(
"write",$this->object->getRefId()))
134 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
143 if (
$_SESSION[
"error_post_vars"][
"ilinc"][
"active"] ==
"1")
145 $this->tpl->setVariable(
"CHK_ILINC_ACTIVE",
"checked=\"checked\"");
148 if (
$_SESSION[
"error_post_vars"][
"ilinc"][
"akclassvalues_active"] ==
"1")
150 $this->tpl->setVariable(
"CHK_ILINC_AKCLASSVALUES_ACTIVE",
"checked=\"checked\"");
153 if (
$_SESSION[
"error_post_vars"][
"ilinc"][
"akclassvalues_required"] ==
"1")
155 $this->tpl->setVariable(
"CHK_ILINC_AKCLASSVALUES_REQUIRED",
"checked=\"checked\"");
158 $this->tpl->setVariable(
"ILINC_SERVER",
$_SESSION[
"error_post_vars"][
"ilinc"][
"server"]);
159 $this->tpl->setVariable(
"ILINC_REGISTRAR_LOGIN",
$_SESSION[
"error_post_vars"][
"ilinc"][
"registrar_login"]);
160 $this->tpl->setVariable(
"ILINC_REGISTRAR_PASSWD",
$_SESSION[
"error_post_vars"][
"ilinc"][
"registrar_passwd"]);
161 $this->tpl->setVariable(
"ILINC_CUSTOMER_ID",
$_SESSION[
"error_post_vars"][
"ilinc"][
"customer_id"]);
166 $settings = $this->ilias->getAllSettings();
168 if ($settings[
"ilinc_active"] ==
"1")
170 $this->tpl->setVariable(
"CHK_ILINC_ACTIVE",
"checked=\"checked\"");
173 $this->tpl->setVariable(
"ILINC_SERVER", $settings[
"ilinc_server"].$settings[
"ilinc_path"]);
174 $this->tpl->setVariable(
"ILINC_REGISTRAR_LOGIN", $settings[
"ilinc_registrar_login"]);
175 $this->tpl->setVariable(
"ILINC_REGISTRAR_PASSWD", $settings[
"ilinc_registrar_passwd"]);
176 $this->tpl->setVariable(
"ILINC_CUSTOMER_ID", $settings[
"ilinc_customer_id"]);
178 if (empty($settings[
"ilinc_port"]))
180 $this->tpl->setVariable(
"ILINC_PORT", ILINC_DEFAULT_HTTP_PORT);
184 $this->tpl->setVariable(
"ILINC_PORT", $settings[
"ilinc_port"]);
187 if ($settings[
"ilinc_protocol"] ==
"https")
189 $this->tpl->setVariable(
"ILINC_PROTOCOL_SSL_SEL",
"selected=\"selected\"");
193 $this->tpl->setVariable(
"ILINC_PROTOCOL_HTTP_SEL",
"selected=\"selected\"");
196 if (empty($settings[
"ilinc_timeout"]))
198 $this->tpl->setVariable(
"ILINC_TIMEOUT", ILINC_DEFAULT_TIMEOUT);
202 $this->tpl->setVariable(
"ILINC_TIMEOUT", $settings[
"ilinc_timeout"]);
205 if ($settings[
"ilinc_akclassvalues_active"] ==
"1")
207 $this->tpl->setVariable(
"CHK_ILINC_AKCLASSVALUES_ACTIVE",
"checked=\"checked\"");
210 if ($settings[
"ilinc_akclassvalues_required"] ==
"1")
212 $this->tpl->setVariable(
"CHK_ILINC_AKCLASSVALUES_REQUIRED",
"checked=\"checked\"");
216 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.extt_ilinc.html",
217 "Services/Administration");
219 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
220 $this->tpl->setVariable(
"TXT_ILINC_TITLE", $this->lng->txt(
"extt_ilinc_configure"));
221 $this->tpl->setVariable(
"TXT_ILINC_ACTIVE", $this->lng->txt(
"extt_ilinc_enable"));
222 $this->tpl->setVariable(
"TXT_ILINC_CONNECTION_DATA", $this->lng->txt(
"extt_ilinc_connection_data"));
223 $this->tpl->setVariable(
"TXT_ILINC_ADDITIONAL_OPTIONS", $this->lng->txt(
"extt_ilinc_additional_options"));
224 $this->tpl->setVariable(
"TXT_ILINC_SERVER", $this->lng->txt(
"extt_ilinc_server"));
225 $this->tpl->setVariable(
"TXT_ILINC_PROTOCOL_PORT", $this->lng->txt(
"extt_ilinc_protocol_port"));
226 $this->tpl->setVariable(
"TXT_ILINC_TIMEOUT", $this->lng->txt(
"extt_ilinc_timeout"));
227 $this->tpl->setVariable(
"ILINC_DEFAULT_HTTP_PORT", ILINC_DEFAULT_HTTP_PORT);
228 $this->tpl->setVariable(
"ILINC_DEFAULT_SSL_PORT", ILINC_DEFAULT_SSL_PORT);
229 $this->tpl->setVariable(
"TXT_HTTP", $this->lng->txt(
'http'));
230 $this->tpl->setVariable(
"TXT_SSL", $this->lng->txt(
'ssl'));
232 $this->tpl->setVariable(
"TXT_SECONDS", $this->lng->txt(
"seconds"));
233 $this->tpl->setVariable(
"TXT_ILINC_REGISTRAR_LOGIN", $this->lng->txt(
"extt_ilinc_registrar_login"));
234 $this->tpl->setVariable(
"TXT_ILINC_REGISTRAR_PASSWD", $this->lng->txt(
"extt_ilinc_registrar_passwd"));
235 $this->tpl->setVariable(
"TXT_ILINC_CUSTOMER_ID", $this->lng->txt(
"extt_ilinc_customer_id"));
237 $this->tpl->setVariable(
"TXT_ILINC_AKCLASSVALUES_ACTIVE", $this->lng->txt(
"extt_ilinc_akclassvalues_active"));
238 $this->tpl->setVariable(
"TXT_ILINC_AKCLASSVALUES_ACTIVE_INFO", $this->lng->txt(
"extt_ilinc_akclassvalues_active_info"));
239 $this->tpl->setVariable(
"TXT_ILINC_AKCLASSVALUES_REQUIRED", $this->lng->txt(
"extt_ilinc_akclassvalues_required"));
240 $this->tpl->setVariable(
"TXT_ILINC_AKCLASSVALUES_REQUIRED_INFO", $this->lng->txt(
"extt_ilinc_akclassvalues_required_info"));
242 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
243 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
244 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
245 $this->tpl->setVariable(
"CMD_SUBMIT",
"saveiLinc");
258 if (!
$_POST[
"ilinc"][
"server"] or !
$_POST[
"ilinc"][
"port"] or !
$_POST[
"ilinc"][
"registrar_login"] or !
$_POST[
"ilinc"][
"registrar_passwd"] or !
$_POST[
"ilinc"][
"customer_id"])
260 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
264 if ((preg_match(
"/^[0-9]{0,5}$/",
$_POST[
"ilinc"][
"port"])) ==
false)
266 $this->ilias->raiseError($this->lng->txt(
"err_invalid_port"),$this->ilias->error_obj->MESSAGE);
269 if (substr(
$_POST[
"ilinc"][
"server"],0,8) !=
"https://" and substr(
$_POST[
"ilinc"][
"server"],0,7) !=
"http://")
271 $_POST[
"ilinc"][
"server"] =
$_POST[
"ilinc"][
"protocol"].
"://".
$_POST[
"ilinc"][
"server"];
274 $url = parse_url(
$_POST[
"ilinc"][
"server"]);
278 $this->ilias->raiseError($this->lng->txt(
"err_invalid_server"),$this->ilias->error_obj->MESSAGE);
281 if (is_numeric(
$_POST[
"ilinc"][
"timeout"]))
283 $this->ilias->setSetting(
"ilinc_timeout",
$_POST[
"ilinc"][
"timeout"]);
287 $this->ilias->setSetting(
"ilinc_server", $url[
"host"]);
288 $this->ilias->setSetting(
"ilinc_path", $url[
"path"]);
289 $this->ilias->setSetting(
"ilinc_protocol",
$_POST[
"ilinc"][
"protocol"]);
290 $this->ilias->setSetting(
"ilinc_port",
$_POST[
"ilinc"][
"port"]);
291 $this->ilias->setSetting(
"ilinc_active",
$_POST[
"ilinc"][
"active"]);
292 $this->ilias->setSetting(
"ilinc_registrar_login",
$_POST[
"ilinc"][
"registrar_login"]);
293 $this->ilias->setSetting(
"ilinc_registrar_passwd",
$_POST[
"ilinc"][
"registrar_passwd"]);
294 $this->ilias->setSetting(
"ilinc_customer_id",
$_POST[
"ilinc"][
"customer_id"]);
296 $this->ilias->setSetting(
"ilinc_akclassvalues_active",
$_POST[
"ilinc"][
"akclassvalues_active"]);
297 $this->ilias->setSetting(
"ilinc_akclassvalues_required",
$_POST[
"ilinc"][
"akclassvalues_required"]);
300 $this->ctrl->redirect($this,
'editiLinc');
307 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
309 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
314 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
316 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
323 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
325 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
328 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
330 if ($form->checkInput())
332 $title = $form->getInput(
'title');
333 $link = $form->getInput(
'link');
334 $file = $form->getInput(
'image_file');
335 $active = $form->getInput(
'activate');
337 $extension = pathinfo(
$file[
'name'], PATHINFO_EXTENSION);
338 $icon_path =
ilUtil::getWebspaceDir() . DIRECTORY_SEPARATOR .
'social_bm_icons' . DIRECTORY_SEPARATOR . time() .
'.' . $extension;
353 $form->setValuesByPost();
354 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
362 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
364 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
367 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
369 if ($form->checkInput())
371 $title = $form->getInput(
'title');
372 $link = $form->getInput(
'link');
373 $file = $form->getInput(
'image_file');
374 $active = $form->getInput(
'activate');
375 $id = $form->getInput(
'sbm_id');
381 $extension = pathinfo(
$file[
'name'], PATHINFO_EXTENSION);
382 $icon_path =
ilUtil::getWebspaceDir() . DIRECTORY_SEPARATOR .
'social_bm_icons' . DIRECTORY_SEPARATOR . time() .
'.' . $extension;
398 $form->setValuesByPost();
399 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
412 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
414 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
419 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
423 'sbm_id' =>
$row->sbm_id,
424 'title' =>
$row->sbm_title,
425 'link' =>
$row->sbm_link,
426 'activate' =>
$row->sbm_active
430 $form->setValuesByArray($dset);
431 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
438 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
440 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
443 $ids = ((int)
$_GET[
'sbm_id']) ? array((
int)
$_GET[
'sbm_id']) :
$_POST[
'sbm_id'];
444 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
453 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
455 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
458 $ids = ((int)
$_GET[
'sbm_id']) ? array((
int)
$_GET[
'sbm_id']) :
$_POST[
'sbm_id'];
459 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
468 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
470 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
476 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
479 $ids = ((int)
$_GET[
'sbm_id']) ? array((
int)
$_GET[
'sbm_id']) :
$_POST[
'sbm_id'];
482 $c_gui->setFormAction($ilCtrl->getFormAction($this,
"confirmDeleteSocialBookmarks"));
483 $c_gui->setHeaderText($lng->txt(
"socialbm_sure_delete_entry"));
484 $c_gui->setCancel($lng->txt(
"cancel"),
"editSocialBookmarks");
485 $c_gui->setConfirm($lng->txt(
"confirm"),
"confirmDeleteSocialBookmarks");
487 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
492 $c_gui->addItem(
"sbm_id[]", $id, $entry->sbm_title .
' (' . str_replace(
'{',
'{', $entry->sbm_link) .
')');
495 $this->tpl->setVariable(
'ADM_CONTENT', $c_gui->getHTML());
502 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
504 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
508 $ids = ((int)
$_GET[
'sbm_id']) ? array((
int)
$_GET[
'sbm_id']) :
$_POST[
'sbm_id'];
509 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
523 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
525 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
532 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
534 include_once
'./Services/Administration/classes/class.ilSocialBookmarks.php';
538 foreach($rset as
$row)
541 $current_selection_list->setListTitle($lng->txt(
"actions"));
542 $current_selection_list->setId(
"act_".$counter++);
544 $ilCtrl->setParameter($this,
'sbm_id', $row->sbm_id);
546 $current_selection_list->addItem($lng->txt(
"edit"),
'', $ilCtrl->getLinkTarget($this,
"editSocialBookmark"));
547 $current_selection_list->addItem($lng->txt(
"delete"),
'', $ilCtrl->getLinkTarget($this,
"deleteSocialBookmarks"));
550 if ($row->sbm_active)
552 $current_selection_list->addItem($lng->txt(
"socialbm_disable"),
'', $toggle_action = $ilCtrl->getLinkTarget($this,
"disableSocialBookmarks"));
556 $current_selection_list->addItem($lng->txt(
"socialbm_enable"),
'', $toggle_action = $ilCtrl->getLinkTarget($this,
"enableSocialBookmarks"));
564 'ID' => $row->sbm_id,
565 'TITLE' => $row->sbm_title,
566 'LINK' => str_replace(
'{',
'{', $row->sbm_link),
567 'ICON' => $row->sbm_icon,
568 'ACTIVE' => $row->sbm_active ? $lng->txt(
'enabled') : $lng->txt(
'disabled'),
569 'ACTIONS' => $current_selection_list->getHTML(),
570 'TOGGLE_LINK' => $toggle_action
572 $ilCtrl->clearParameters($this);
575 require_once
'Services/Table/classes/class.ilTable2GUI.php';
576 $table =
new ilTable2GUI($this,
'editSocialBookmarks');
577 $table->setFormName(
'smtable');
578 $table->setId(
'smtable');
579 $table->setPrefix(
'sm');
580 $table->setFormAction($ilCtrl->getFormAction($this,
'saveSocialBookmarks'));
581 $table->addColumn(
'',
'check',
'',
true);
582 $table->addColumn($lng->txt(
'icon'),
'');
583 $table->addColumn($lng->txt(
'title'),
'TITLE');
584 $table->addColumn($lng->txt(
'link'),
'LINK');
585 $table->addColumn($lng->txt(
'active'),
'ACTIVE');
586 $table->addColumn($lng->txt(
'actions'),
'');
587 $table->setTitle($lng->txt(
'bm_manage_social_bm'));
588 $table->setData($dset);
589 $table->setRowTemplate(
'tpl.social_bookmarking_row.html',
'Services/Administration');
590 $table->setSelectAllCheckbox(
'sbm_id');
592 $table->setDefaultOrderField(
"title");
593 $table->setDefaultOrderDirection(
"asc");
595 $table->addMultiCommand(
'enableSocialBookmarks', $lng->txt(
'socialbm_enable'));
596 $table->addMultiCommand(
'disableSocialBookmarks', $lng->txt(
'socialbm_disable'));
597 $table->addMultiCommand(
'deleteSocialBookmarks', $lng->txt(
'delete'));
599 $table->addCommandButton(
'addSocialBookmark', $lng->txt(
'create'));
601 $this->tpl->setVariable(
'ADM_CONTENT', $table->getHTML());
617 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
619 $form->setFormAction($ilCtrl->getFormAction($this));
620 $form->setTitle($lng->txt(
"mathjax_settings"));
625 $enable->setInfo($lng->txt(
"mathjax_enable_mathjax_info").
" <a target='blank' href='http://www.mathjax.org/'>MathJax</a>");
626 $form->addItem($enable);
629 $text_prop =
new ilTextInputGUI($lng->txt(
"mathjax_path_to_mathjax"),
"path_to_mathjax");
630 $text_prop->
setInfo($lng->txt(
"mathjax_path_to_mathjax_desc"));
631 $text_prop->setValue($path_to_mathjax);
632 $text_prop->setRequired(
true);
633 $text_prop->setMaxLength(400);
634 $text_prop->setSize(100);
635 $enable->addSubItem($text_prop);
640 1 =>
'[tex]...[/tex]',
641 2 =>
'<span class="math">...</span>'
644 $si->setOptions($options);
646 $si->setInfo($this->lng->txt(
"mathjax_limiter_info"));
647 $enable->addSubItem(
$si);
649 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
651 $form->addCommandButton(
"saveMathJax", $lng->txt(
"save"));
654 $tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
664 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
676 $ilCtrl->redirect($this,
"editMathJax");
690 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
692 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
697 $std_latitude = $gm_set->get(
"std_latitude");
698 $std_longitude = $gm_set->get(
"std_longitude");
699 $std_zoom = $gm_set->get(
"std_zoom");
700 $api_url =
"http://www.google.com/apis/maps/signup.html";
702 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
704 $form->setFormAction($ilCtrl->getFormAction($this));
705 $form->setTitle($lng->txt(
"gmaps_settings"));
710 $enable->setInfo($lng->txt(
"gmaps_enable_gmaps_info"));
711 $form->addItem($enable);
717 $loc_prop->setLongitude($std_longitude);
718 $loc_prop->setZoom($std_zoom);
719 $form->addItem($loc_prop);
721 $form->addCommandButton(
"saveGoogleMaps", $lng->txt(
"save"));
722 $form->addCommandButton(
"view", $lng->txt(
"cancel"));
724 $tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
742 $ilCtrl->redirect($this,
"editGoogleMaps");
748 $ilinc = ($a_cmd ==
'editiLinc') ?
true :
false;
752 if($a_cmd ==
'view' || $a_cmd ==
'')
754 $a_cmd =
'editSocialBookmarks';
756 $socialbookmarks = ($a_cmd ==
'editSocialBookmarks') ?
true :
false;
757 $gmaps = ($a_cmd ==
'editGoogleMaps') ?
true :
false;
758 $mathjax = ($a_cmd ==
'editMathJax') ?
true :
false;
764 $this->tabs_gui->addSubTabTarget(
"socialbm_extt_social_bookmarks", $this->ctrl->getLinkTarget($this,
"editSocialBookmarks"),
765 "",
"",
"", $socialbookmarks);
766 $this->tabs_gui->addSubTabTarget(
"mathjax_mathjax", $this->ctrl->getLinkTarget($this,
"editMathJax"),
767 "",
"",
"", $mathjax);
768 $this->tabs_gui->addSubTabTarget(
"gmaps_extt_gmaps", $this->ctrl->getLinkTarget($this,
"editGoogleMaps"),
770 $this->tabs_gui->addSubTabTarget(
"extt_ilinc", $this->ctrl->getLinkTarget($this,
"editiLinc"),
777 $next_class = $this->ctrl->getNextClass($this);
778 $cmd = $this->ctrl->getCmd();
783 case 'ilecssettingsgui':
784 $this->tabs_gui->setTabActive(
'ecs_server_settings');
785 include_once(
'./Services/WebServices/ECS/classes/class.ilECSSettingsGUI.php');
789 case 'ilpermissiongui':
790 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
792 $ret =& $this->ctrl->forwardCommand($perm_gui);
793 $this->tabs_gui->setTabActive(
'perm_settings');
797 $this->tabs_gui->setTabActive(
'settings');
800 $cmd =
"editSocialBookmarks";