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'];
82 $next_class = $this->ctrl->getNextClass($this);
83 $cmd = $this->ctrl->getCmd();
87 if (!$this->hierarchical_access->checkAccess(
'read',
'', $this->object->getRefId())) {
88 $this->error->raiseError($this->lng->txt(
'no_permission'), $this->error->WARNING);
91 switch ($next_class) {
92 case 'ilpermissiongui':
93 $this->tabs_gui->setTabActive(
'perm_settings');
94 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
96 $this->ctrl->forwardCommand($perm_gui);
100 if (!$cmd || $cmd ==
'view') {
115 if ($this->access->checkAccess(
"visible,read", $this->object->getRefId())) {
116 $this->tabs_gui->addTarget(
118 $this->ctrl->getLinkTarget($this,
"settings"),
119 array(
"settings",
"view")
123 if ($this->access->checkAccess(
'edit_permission', $this->object->getRefId())) {
124 $this->tabs_gui->addTarget(
126 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
138 $this->tabs_gui->setTabActive(
'settings');
139 $form_settings =
new ilSetting(
"certificate");
141 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
143 $form->setFormAction($this->ctrl->getFormAction($this));
144 $form->setTitle($this->lng->txt(
'certificate_settings'));
147 $active->
setChecked($form_settings->get(
"active"));
148 $form->addItem($active);
151 $info->setValue($this->lng->txt(
"certificate_usage"));
154 $bgimage =
new ilImageFileInputGUI($this->lng->txt(
"certificate_background_image"),
"background");
158 if (strlen($_FILES[
"background"][
"tmp_name"])) {
159 if ($bgimage->checkInput()) {
160 $result = $this->
object->uploadBackgroundImage($_FILES[
"background"][
"tmp_name"]);
162 $bgimage->setAlert($this->lng->txt(
"certificate_error_upload_bgimage"));
167 if (strlen($this->
object->hasBackgroundImage())) {
168 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
172 $bgimage->setInfo($this->lng->txt(
"default_background_info"));
173 $form->addItem($bgimage);
175 $defaultformats =
array(
176 "a4" => $this->lng->txt(
"certificate_a4"),
177 "a4landscape" => $this->lng->txt(
"certificate_a4_landscape"),
178 "a5" => $this->lng->txt(
"certificate_a5"),
179 "a5landscape" => $this->lng->txt(
"certificate_a5_landscape"),
180 "letter" => $this->lng->txt(
"certificate_letter"),
181 "letterlandscape" => $this->lng->txt(
"certificate_letter_landscape")
183 $format->setOptions($defaultformats);
184 $format->setValue($form_settings->get(
"pageformat"));
185 $format->setInfo($this->lng->txt(
"certificate_page_format_info"));
189 if ($this->hierarchical_access->checkAccess(
'write',
'', $this->object->getRefId())) {
190 $form->addCommandButton(
'save', $this->lng->txt(
'save'));
193 $this->tpl->setContent(
$form->getHTML());
195 if (strcmp($this->ctrl->getCmd(),
"save") == 0) {
196 if (
$_POST[
"background_delete"]) {
197 $this->
object->deleteBackgroundImage();
204 $form_settings =
new ilSetting(
"certificate");
205 $form_settings->set(
"pageformat",
$_POST[
"pageformat"]);
206 $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.
if(isset($_POST['submit'])) $form
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.