23 include_once(
"./Services/Object/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 $active->
setChecked($form_settings->get(
"active"));
132 $form->addItem($active);
135 $info->
setValue($this->lng->txt(
"certificate_usage"));
136 $form->addItem($info);
138 $bgimage =
new ilImageFileInputGUI($this->lng->txt(
"certificate_background_image"),
"background");
143 if (strlen($_FILES[
"background"][
"tmp_name"]))
145 if ($bgimage->checkInput())
147 $result = $this->
object->uploadBackgroundImage($_FILES[
"background"][
"tmp_name"]);
150 $bgimage->setAlert($this->lng->txt(
"certificate_error_upload_bgimage"));
155 if (strlen($this->object->hasBackgroundImage())) $bgimage->setImage($this->object->getBackgroundImageThumbPathWeb());
156 $bgimage->setInfo($this->lng->txt(
"default_background_info"));
157 $form->addItem($bgimage);
158 $format =
new ilSelectInputGUI($this->lng->txt(
"certificate_page_format"),
"pageformat");
159 $defaultformats = array(
160 "a4" => $this->lng->txt(
"certificate_a4"),
161 "a4landscape" => $this->lng->txt(
"certificate_a4_landscape"),
162 "a5" => $this->lng->txt(
"certificate_a5"),
163 "a5landscape" => $this->lng->txt(
"certificate_a5_landscape"),
164 "letter" => $this->lng->txt(
"certificate_letter"),
165 "letterlandscape" => $this->lng->txt(
"certificate_letter_landscape")
168 $format->setValue($form_settings->get(
"pageformat"));
169 $format->setInfo($this->lng->txt(
"certificate_page_format_info"));
170 $form->addItem($format);
173 if($ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
175 $form->addCommandButton(
'save',$this->lng->txt(
'save'));
178 $this->tpl->setContent($form->getHTML());
180 if (strcmp($this->ctrl->getCmd(),
"save") == 0)
182 if (
$_POST[
"background_delete"])
184 $this->
object->deleteBackgroundImage();
191 $form_settings =
new ilSetting(
"certificate");
192 $form_settings->set(
"pageformat",
$_POST[
"pageformat"]);
193 $form_settings->set(
"active",
$_POST[
"active"]);