101 include_once
"./Modules/Test/classes/class.ilTestCertificate.php";
107 $this->tree =&
$tree;
108 $this->ref_id =
$_GET[
"ref_id"];
116 $cmd = $this->ctrl->getCmd();
117 $next_class = $this->ctrl->getNextClass($this);
162 $this->
object->createPreview();
176 $this->
object->outCertificates(
$_GET[
"g_userfilter"],
$_GET[
"g_passedonly"]);
188 $this->
object->deliverExportFileXML();
201 $this->
object->outCertificate(
$_GET[
"active_id"],
$_GET[
"pass"]);
213 $this->
object->deleteBackgroundImage();
219 $form_fields = array(
243 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/Test");
245 $this->tpl->setCurrentBlock(
"table_header");
246 $this->tpl->setVariable(
"TEXT", $this->lng->txt(
"confirmation"));
247 $this->tpl->parseCurrentBlock();
248 $this->tpl->setCurrentBlock(
"table_row");
249 $this->tpl->setVariable(
"CSS_ROW",
"tblrow1");
250 $this->tpl->setVariable(
"TEXT_CONTENT", $this->lng->txt(
"certificate_confirm_deletion_text"));
251 $this->tpl->parseCurrentBlock();
252 $this->tpl->setCurrentBlock(
"operation_btn");
253 $this->tpl->setVariable(
"BTN_NAME",
"certificateDeleteConfirm");
254 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"yes"));
255 $this->tpl->parseCurrentBlock();
256 $this->tpl->setCurrentBlock(
"operation_btn");
257 $this->tpl->setVariable(
"BTN_NAME",
"certificateEditor");
258 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"no"));
259 $this->tpl->parseCurrentBlock();
260 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"certificateEditor"));
272 $this->
object->deleteCertificate();
273 $this->ctrl->redirect($this,
"certificateEditor");
310 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
314 $this->ctrl->redirectByClass(
"ilobjtestgui",
"infoScreen");
316 $form_fields = array();
317 if (is_array($_POST))
319 if (count($_POST) > 0)
324 if (strlen($_FILES[
"certificate_import"][
"tmp_name"]))
326 $result = $this->
object->importCertificate($_FILES[
"certificate_import"][
"tmp_name"], $_FILES[
"certificate_import"][
"name"]);
333 $this->ctrl->redirect($this,
"certificateEditor");
338 if (strlen($_FILES[
"background"][
"tmp_name"]))
340 $result = $this->
object->uploadBackgroundImage($_FILES[
"background"][
"tmp_name"]);
350 $form_fields = $this->
object->processFO2XHTML();
354 if ((strcmp($this->ctrl->getCmd(),
"certificateSave") == 0) || (strcmp($this->ctrl->getCmd(),
"certificateRemoveBackground") == 0))
358 $result = $this->
object->checkCertificateInput($form_fields);
365 $xslfo = $this->
object->processXHTML2FO($form_fields);
366 $this->
object->saveCertificateVisibility($form_fields[
"certificate_visibility"]);
367 $this->
object->saveCertificate($xslfo);
371 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_certificate_edit.html",
"Modules/Test");
373 if ($this->object->hasBackgroundImage())
375 $this->tpl->setCurrentBlock(
"background_exists");
376 $this->tpl->setVariable(
"BACKGROUND_THUMBNAIL", $this->object->getBackgroundImagePathWeb() .
".thumb.jpg");
377 $this->tpl->setVariable(
"THUMBNAIL_ALT", $this->lng->txt(
"preview"));
378 $this->tpl->setVariable(
"DELETE_BUTTON", $this->lng->txt(
"delete"));
379 $this->tpl->parseCurrentBlock();
382 $pageformats = $this->
object->getPageFormats();
383 foreach ($pageformats as $pageformat)
385 $this->tpl->setCurrentBlock(
"page_format_row");
386 $this->tpl->setVariable(
"VALUE_PAGE_FORMAT", $pageformat[
"value"]);
387 $this->tpl->setVariable(
"NAME_PAGE_FORMAT", $pageformat[
"name"]);
388 if (strcmp($form_fields[
"pageformat"], $pageformat[
"value"]) == 0)
390 $this->tpl->setVariable(
"SELECTED_PAGE_FORMAT",
" selected=\"selected\"");
392 $this->tpl->parseCurrentBlock();
395 if (strcmp($form_fields[
"pageformat"],
"custom") == 0)
397 $this->tpl->setCurrentBlock(
"custom_format");
398 $this->tpl->setVariable(
"TEXT_PAGE_UNIT_DESCRIPTION", $this->lng->txt(
"certificate_unit_description"));
399 $this->tpl->setVariable(
"TEXT_PAGEHEIGHT", $this->lng->txt(
"certificate_pageheight"));
400 $this->tpl->setVariable(
"TEXT_PAGEWIDTH", $this->lng->txt(
"certificate_pagewidth"));
401 if (strlen($form_fields[
"pageheight"]))
403 $this->tpl->setVariable(
"VALUE_PAGEHEIGHT",
" value=\"".$form_fields[
"pageheight"].
"\"");
405 if (strlen($form_fields[
"pagewidth"]))
407 $this->tpl->setVariable(
"VALUE_PAGEWIDTH",
" value=\"".$form_fields[
"pagewidth"].
"\"");
409 $this->tpl->parseCurrentBlock();
412 $this->tpl->setVariable(
"TEXT_CERTIFICATE", $this->lng->txt(
"certificate_edit"));
413 $this->tpl->setVariable(
"TEXT_STATUS", $this->lng->txt(
"certificate_status"));
414 if ($this->object->isComplete() || $this->
object->hasBackgroundImage())
416 $this->tpl->setVariable(
"DELETE_BUTTON_CERTIFICATE", $this->lng->txt(
"certificate_delete"));
418 if ($this->object->isComplete())
420 $this->tpl->setVariable(
"VALUE_STATUS", $this->lng->txt(
"certificate_status_complete"));
421 include_once
"./Services/Utilities/classes/class.ilUtil.php";
423 $this->tpl->setVariable(
"ALT_STATUS_IMAGE", $this->lng->txt(
"certificate_status_complete"));
424 $this->tpl->setVariable(
"PREVIEW_BUTTON_CERTIFICATE", $this->lng->txt(
"certificate_preview"));
425 $this->tpl->setVariable(
"PREVIEW_URL", $this->ctrl->getLinkTarget($this,
"certificatePreview"));
428 $this->tpl->setVariable(
"CERTIFICATE_EXPORT", $this->lng->txt(
"certificate_export"));
429 $this->tpl->setVariable(
"EXPORT_URL", $this->ctrl->getLinkTarget($this,
"certificateExportFO"));
433 $this->tpl->setVariable(
"VALUE_STATUS", $this->lng->txt(
"certificate_status_incomplete"));
436 $this->tpl->setVariable(
"TEXT_CERTIFICATE_IMPORT", $this->lng->txt(
"import"));
438 $this->tpl->setVariable(
"BUTTON_SET_PAGEFORMAT", $this->lng->txt(
"change"));
439 $this->tpl->setVariable(
"TEXT_PAGE_FORMAT", $this->lng->txt(
"certificate_page_format"));
440 $this->tpl->setVariable(
"TEXT_BACKGROUND_IMAGE", $this->lng->txt(
"certificate_background_image"));
441 $this->tpl->setVariable(
"TEXT_UPLOAD", $this->lng->txt(
"upload"));
442 $this->tpl->setVariable(
"TEXT_PADDING_TOP", $this->lng->txt(
"certificate_padding_top"));
443 if (strlen($form_fields[
"padding_top"]) > 0)
445 $this->tpl->setVariable(
"VALUE_PADDING_TOP",
" value=\"".$form_fields[
"padding_top"].
"\"");
447 $this->tpl->setVariable(
"TEXT_MARGIN_BODY", $this->lng->txt(
"certificate_margin_body"));
448 $this->tpl->setVariable(
"TEXT_MARGIN_BODY_TOP", $this->lng->txt(
"certificate_top"));
449 $this->tpl->setVariable(
"TEXT_MARGIN_BODY_RIGHT", $this->lng->txt(
"certificate_right"));
450 $this->tpl->setVariable(
"TEXT_MARGIN_BODY_BOTTOM", $this->lng->txt(
"certificate_bottom"));
451 $this->tpl->setVariable(
"TEXT_MARGIN_BODY_LEFT", $this->lng->txt(
"certificate_left"));
452 if (strlen($form_fields[
"margin_body_top"]) > 0)
454 $this->tpl->setVariable(
"VALUE_MARGIN_BODY_TOP",
" value=\"".$form_fields[
"margin_body_top"].
"\"");
456 if (strlen($form_fields[
"margin_body_right"]) > 0)
458 $this->tpl->setVariable(
"VALUE_MARGIN_BODY_RIGHT",
" value=\"".$form_fields[
"margin_body_right"].
"\"");
460 if (strlen($form_fields[
"margin_body_bottom"]) > 0)
462 $this->tpl->setVariable(
"VALUE_MARGIN_BODY_BOTTOM",
" value=\"".$form_fields[
"margin_body_bottom"].
"\"");
464 if (strlen($form_fields[
"margin_body_left"]) > 0)
466 $this->tpl->setVariable(
"VALUE_MARGIN_BODY_LEFT",
" value=\"".$form_fields[
"margin_body_left"].
"\"");
468 $this->tpl->setVariable(
"TEXT_CERTIFICATE_TEXT", $this->lng->txt(
"certificate_text"));
469 if (strlen($form_fields[
"certificate_text"]) > 0)
471 $this->tpl->setVariable(
"VALUE_CERTIFICATE_TEXT", $form_fields[
"certificate_text"]);
473 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
474 $this->tpl->setVariable(
"TEXT_SAVE", $this->lng->txt(
"save"));
475 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"certificateSave"));
477 $this->tpl->setVariable(
"PH_INTRODUCTION", $this->lng->txt(
"certificate_ph_introduction"));
478 $this->tpl->setVariable(
"PH_USER_FULLNAME", $this->lng->txt(
"certificate_ph_fullname"));
479 $this->tpl->setVariable(
"PH_USER_FIRSTNAME", $this->lng->txt(
"certificate_ph_firstname"));
480 $this->tpl->setVariable(
"PH_USER_LASTNAME", $this->lng->txt(
"certificate_ph_lastname"));
481 $this->tpl->setVariable(
"PH_RESULT_PASSED", $this->lng->txt(
"certificate_ph_passed"));
482 $this->tpl->setVariable(
"PH_RESULT_POINTS", $this->lng->txt(
"certificate_ph_resultpoints"));
483 $this->tpl->setVariable(
"PH_RESULT_PERCENT", $this->lng->txt(
"certificate_ph_resultpercent"));
484 $this->tpl->setVariable(
"PH_USER_TITLE", $this->lng->txt(
"certificate_ph_title"));
485 $this->tpl->setVariable(
"PH_USER_STREET", $this->lng->txt(
"certificate_ph_street"));
486 $this->tpl->setVariable(
"PH_USER_INSTITUTION", $this->lng->txt(
"certificate_ph_institution"));
487 $this->tpl->setVariable(
"PH_USER_DEPARTMENT", $this->lng->txt(
"certificate_ph_department"));
488 $this->tpl->setVariable(
"PH_USER_CITY", $this->lng->txt(
"certificate_ph_city"));
489 $this->tpl->setVariable(
"PH_USER_ZIPCODE", $this->lng->txt(
"certificate_ph_zipcode"));
490 $this->tpl->setVariable(
"PH_USER_COUNTRY", $this->lng->txt(
"certificate_ph_country"));
491 $this->tpl->setVariable(
"PH_MAX_POINTS", $this->lng->txt(
"certificate_ph_maxpoints"));
492 $this->tpl->setVariable(
"PH_RESULT_MARK_SHORT", $this->lng->txt(
"certificate_ph_markshort"));
493 $this->tpl->setVariable(
"PH_RESULT_MARK_LONG", $this->lng->txt(
"certificate_ph_marklong"));
494 $this->tpl->setVariable(
"PH_TEST_TITLE", $this->lng->txt(
"certificate_ph_testtitle"));
495 $this->tpl->setVariable(
"PH_DATE", $this->lng->txt(
"certificate_ph_date"));
496 $this->tpl->setVariable(
"PH_DATETIME", $this->lng->txt(
"certificate_ph_datetime"));
498 $this->tpl->setVariable(
"TEXT_UNIT_DESCRIPTION", $this->lng->txt(
"certificate_unit_description"));
499 $this->tpl->setVariable(
"TEXT_CERTIFICATE_VISIBILITY", $this->lng->txt(
"certificate_visibility"));
500 $this->tpl->setVariable(
"TEXT_CERTIFICATE_VISIBILITY_INTRODUCTION", $this->lng->txt(
"certificate_visibility_introduction"));
501 $this->tpl->setVariable(
"TEXT_VISIBILITY_ALWAYS", $this->lng->txt(
"certificate_visibility_always"));
502 $this->tpl->setVariable(
"TEXT_VISIBILITY_NEVER", $this->lng->txt(
"certificate_visibility_never"));
503 $this->tpl->setVariable(
"TEXT_VISIBILITY_PASSED", $this->lng->txt(
"certificate_visibility_passed"));
504 switch ($form_fields[
"certificate_visibility"])
507 $this->tpl->setVariable(
"CHECKED_CV_1",
" checked=\"checked\"");
510 $this->tpl->setVariable(
"CHECKED_CV_2",
" checked=\"checked\"");
514 $this->tpl->setVariable(
"CHECKED_CV_0",
" checked=\"checked\"");
518 include_once
"./Services/RTE/classes/class.ilRTE.php";
520 include_once
"./Services/RTE/classes/class.$rtestring.php";
521 $rte =
new $rtestring();
522 include_once
"./classes/class.ilObject.php";
523 $obj_id =
$_GET[
"q_id"];
538 $rte->addCustomRTESupport($obj_id, $obj_type, $tags);
540 $this->tpl->parseCurrentBlock();
554 $active_id = $this->
object->object->getTestSession()->getActiveId();
556 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"active_id", $active_id);
557 $this->ctrl->setParameterByClass(
"iltestcertificategui",
"pass", $counted_pass);
558 $this->ctrl->redirectByClass(
"iltestcertificategui",
"certificateOutput");