23 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
61 public function __construct($a_data, $a_id = 0, $a_call_by_reference =
true, $a_prepare_output =
true)
65 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
67 $this->lng->loadLanguageModule(
"certificate");
69 $this->access = $DIC[
'rbacsystem'];
70 $this->error = $DIC[
'ilErr'];
71 $this->hierarchical_access = $DIC[
'ilAccess'];
83 $next_class = $this->ctrl->getNextClass($this);
84 $cmd = $this->ctrl->getCmd();
88 if(!$this->hierarchical_access->checkAccess(
'read',
'', $this->object->getRefId()))
90 $this->error->raiseError($this->lng->txt(
'no_permission'), $this->error->WARNING);
95 case 'ilpermissiongui':
96 $this->tabs_gui->setTabActive(
'perm_settings');
97 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
99 $this->ctrl->forwardCommand($perm_gui);
119 if($this->access->checkAccess(
"visible,read",$this->object->getRefId()))
121 $this->tabs_gui->addTarget(
"settings",
122 $this->ctrl->getLinkTarget($this,
"settings"),
123 array(
"settings",
"view"));
126 if($this->access->checkAccess(
'edit_permission',$this->object->getRefId()))
128 $this->tabs_gui->addTarget(
"perm_settings",
129 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
130 array(),
'ilpermissiongui');
139 $this->tabs_gui->setTabActive(
'settings');
140 $form_settings =
new ilSetting(
"certificate");
142 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
144 $form->setFormAction($this->ctrl->getFormAction($this));
145 $form->setTitle($this->lng->txt(
'certificate_settings'));
148 $active->
setChecked($form_settings->get(
"active"));
149 $form->addItem($active);
152 $info->setValue($this->lng->txt(
"certificate_usage"));
153 $form->addItem(
$info);
155 $bgimage =
new ilImageFileInputGUI($this->lng->txt(
"certificate_background_image"),
"background");
160 if (strlen($_FILES[
"background"][
"tmp_name"]))
162 if ($bgimage->checkInput())
164 $result = $this->
object->uploadBackgroundImage($_FILES[
"background"][
"tmp_name"]);
167 $bgimage->setAlert($this->lng->txt(
"certificate_error_upload_bgimage"));
172 if (strlen($this->
object->hasBackgroundImage()))
174 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
178 $bgimage->setInfo($this->lng->txt(
"default_background_info"));
179 $form->addItem($bgimage);
180 $format =
new ilSelectInputGUI($this->lng->txt(
"certificate_page_format"),
"pageformat");
181 $defaultformats =
array(
182 "a4" => $this->lng->txt(
"certificate_a4"),
183 "a4landscape" => $this->lng->txt(
"certificate_a4_landscape"),
184 "a5" => $this->lng->txt(
"certificate_a5"),
185 "a5landscape" => $this->lng->txt(
"certificate_a5_landscape"),
186 "letter" => $this->lng->txt(
"certificate_letter"),
187 "letterlandscape" => $this->lng->txt(
"certificate_letter_landscape")
189 $format->setOptions($defaultformats);
190 $format->setValue($form_settings->get(
"pageformat"));
191 $format->setInfo($this->lng->txt(
"certificate_page_format_info"));
192 $form->addItem($format);
195 if($this->hierarchical_access->checkAccess(
'write',
'',$this->object->getRefId()))
197 $form->addCommandButton(
'save',$this->lng->txt(
'save'));
200 $this->tpl->setContent($form->getHTML());
202 if (strcmp($this->ctrl->getCmd(),
"save") == 0)
204 if (
$_POST[
"background_delete"])
206 $this->
object->deleteBackgroundImage();
213 $form_settings =
new ilSetting(
"certificate");
214 $form_settings->set(
"pageformat",
$_POST[
"pageformat"]);
215 $form_settings->set(
"active",
$_POST[
"active"]);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
prepareOutput($a_show_subobjects=true)
prepare output
executeCommand()
Execute command.
Class ilObjectGUI Basic methods of all Output classes.
static signFile($path_to_file)
Create styles array
The data for the language used.
This class represents a non editable value in a property form.
Create new PHPExcel object
obj_idprivate
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
__construct($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Contructor.