23 include_once(
"./classes/class.ilObjectGUI.php");
45 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
49 $this->lng->loadLanguageModule(
"certificate");
60 global $rbacsystem,
$ilErr,$ilAccess;
62 $next_class = $this->ctrl->getNextClass($this);
63 $cmd = $this->ctrl->getCmd();
67 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
69 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
74 case 'ilpermissiongui':
75 $this->tabs_gui->setTabActive(
'perm_settings');
76 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
78 $ret =& $this->ctrl->forwardCommand($perm_gui);
98 global $rbacsystem, $ilAccess;
100 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
102 $this->tabs_gui->addTarget(
"settings",
103 $this->ctrl->getLinkTarget($this,
"settings"),
104 array(
"settings",
"view"));
107 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
109 $this->tabs_gui->addTarget(
"perm_settings",
110 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
111 array(),
'ilpermissiongui');
120 global
$lng, $ilAccess;
122 $this->tabs_gui->setTabActive(
'settings');
123 $form_settings =
new ilSetting(
"certificate");
125 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
127 $form->setFormAction($this->ctrl->getFormAction($this));
128 $form->setTitle($this->lng->txt(
'certificate_settings'));
131 $info->
setValue($this->lng->txt(
"certificate_usage"));
132 $form->addItem($info);
134 $bgimage =
new ilImageFileInputGUI($this->lng->txt(
"certificate_background_image"),
"background");
139 if (strlen($_FILES[
"background"][
"tmp_name"]))
141 if ($bgimage->checkInput())
143 $result = $this->
object->uploadBackgroundImage($_FILES[
"background"][
"tmp_name"]);
146 $bgimage->setAlert($this->lng->txt(
"certificate_error_upload_bgimage"));
151 if (strlen($this->object->hasBackgroundImage())) $bgimage->setImage($this->object->getBackgroundImageThumbPathWeb());
152 $bgimage->setInfo($this->lng->txt(
"default_background_info"));
153 $form->addItem($bgimage);
154 $format =
new ilSelectInputGUI($this->lng->txt(
"certificate_page_format"),
"pageformat");
155 $defaultformats = array(
156 "a4" => $this->lng->txt(
"certificate_a4"),
157 "a4landscape" => $this->lng->txt(
"certificate_a4_landscape"),
158 "a5" => $this->lng->txt(
"certificate_a5"),
159 "a5landscape" => $this->lng->txt(
"certificate_a5_landscape"),
160 "letter" => $this->lng->txt(
"certificate_letter"),
161 "letterlandscape" => $this->lng->txt(
"certificate_letter_landscape")
164 $format->setValue($form_settings->get(
"pageformat"));
165 $format->setInfo($this->lng->txt(
"certificate_page_format_info"));
166 $form->addItem($format);
169 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
171 $form->addCommandButton(
'save',$this->lng->txt(
'save'));
174 $this->tpl->setContent($form->getHTML());
176 if (strcmp($this->ctrl->getCmd(),
"save") == 0)
178 if (
$_POST[
"background_delete"])
180 $this->
object->deleteBackgroundImage();
187 $form_settings =
new ilSetting(
"certificate");
188 $form_settings->set(
"pageformat",
$_POST[
"pageformat"]);