ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjPDFGenerationGUI Class Reference

Class ilObjPDFGenerationGUI. More...

+ Inheritance diagram for ilObjPDFGenerationGUI:
+ Collaboration diagram for ilObjPDFGenerationGUI:

Public Member Functions

 ilObjPDFGenerationGUI ($a_data, $a_id, $a_call_by_reference)
executeCommand ()
 execute command
 saveObject ()
 save object public
 settingsObject ()
 saveSettingsObject ()
 webkitObject ()
 saveWebkitObject ()
 Save survey settings.
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getTabs (&$tabs_gui)
 get tabs public
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Data Fields

 $conditions
 Constructor public.
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false

Additional Inherited Members

- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Detailed Description

Member Function Documentation

& ilObjPDFGenerationGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 61 of file class.ilObjPDFGenerationGUI.php.

References $cmd, $ret, and ilObjectGUI\prepareOutput().

{
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
switch($next_class)
{
case 'ilpermissiongui':
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
default:
if($cmd == "" || $cmd == "view")
{
$cmd = "settings";
}
$cmd .= "Object";
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjPDFGenerationGUI::getAdminTabs ( $tabs_gui)

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 342 of file class.ilObjPDFGenerationGUI.php.

References getTabs().

{
$this->getTabs($tabs_gui);
}

+ Here is the call graph for this function:

ilObjPDFGenerationGUI::getTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

Definition at line 352 of file class.ilObjPDFGenerationGUI.php.

Referenced by getAdminTabs().

{
global $ilAccess;
if ($ilAccess->checkAccess("read",'',$this->object->getRefId()))
{
$tabs_gui->addTarget("spdf_settings", $this->ctrl->getLinkTarget($this, "settings"), array("settings", "saveSettings","","view"), "", "");
$tabs_gui->addTarget("webkit", $this->ctrl->getLinkTarget($this, "webkit"), array("webkit", "saveWebkit"), "", "");
}
if ($ilAccess->checkAccess("edit_permission",'',$this->object->getRefId()))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
}

+ Here is the caller graph for this function:

ilObjPDFGenerationGUI::ilObjPDFGenerationGUI (   $a_data,
  $a_id,
  $a_call_by_reference 
)

Definition at line 46 of file class.ilObjPDFGenerationGUI.php.

References ilObjectGUI\$lng, and ilObjectGUI\ilObjectGUI().

{
global $rbacsystem, $lng;
$this->type = "spdf";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
$this->lng->loadLanguageModule('spdf');
$this->lng->loadLanguageModule('meta');
if (!$rbacsystem->checkAccess('read',$this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read_spdf"),$this->ilias->error_obj->WARNING);
}
}

+ Here is the call graph for this function:

ilObjPDFGenerationGUI::saveObject ( )

save object public

Reimplemented from ilObjectGUI.

Definition at line 94 of file class.ilObjPDFGenerationGUI.php.

References ilUtil\sendSuccess().

{
global $rbacadmin;
// create and insert object in objecttree
$newObj = parent::saveObject();
// put here object specific stuff
// always send a message
ilUtil::sendSuccess($this->lng->txt("object_added"),true);
$this->ctrl->redirect($this);
//header("Location:".$this->getReturnLocation("save","adm_object.php?".$this->link_params));
//exit();
}

+ Here is the call graph for this function:

ilObjPDFGenerationGUI::saveSettingsObject ( )

Definition at line 157 of file class.ilObjPDFGenerationGUI.php.

References $_POST, $ilCtrl, and ilUtil\sendSuccess().

{
global $ilCtrl, $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) $ilCtrl->redirect($this, "settings");
$pdfSetting = new ilSetting("pdf");
$pdfSetting->set("html_to_pdf_method", $_POST["html_to_pdf_method"]);
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "settings");
}

+ Here is the call graph for this function:

ilObjPDFGenerationGUI::saveWebkitObject ( )

Save survey settings.

Definition at line 316 of file class.ilObjPDFGenerationGUI.php.

References $_POST, $ilCtrl, and ilUtil\sendSuccess().

{
global $ilCtrl, $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) $ilCtrl->redirect($this, "settings");
$pdfSetting = new ilSetting("pdf");
$pdfSetting->set("path_to_wkhtml", $_POST["path_to_wkhtml"]);
$pdfSetting->set("args_header_font_size", $_POST["args_header_font_size"]);
$pdfSetting->set("args_header_left", $_POST["args_header_left"]);
$pdfSetting->set("args_header_center", $_POST["args_header_center"]);
$pdfSetting->set("args_header_right", $_POST["args_header_right"]);
$pdfSetting->set("args_header_line", ($_POST["args_header_line"] == 1) ? '--header-line' : '--no-header-line');
$pdfSetting->set("args_footer_font_size", $_POST["args_footer_font_size"]);
$pdfSetting->set("args_footer_left", $_POST["args_footer_left"]);
$pdfSetting->set("args_footer_center", $_POST["args_footer_center"]);
$pdfSetting->set("args_footer_right", $_POST["args_footer_right"]);
$pdfSetting->set("args_footer_line", ($_POST["args_footer_line"] == 1) ? '--footer-line' : '--no-footer-line');
$pdfSetting->set("args_zoom", $_POST["args_zoom"]);
$pdfSetting->set("args_external_links", ($_POST["args_external_links"] == 1) ? '--enable-external-links' : '--disable-external-links');
$pdfSetting->set("args_enable_forms", ($_POST["args_enable_forms"] == 1) ? '--enable-forms' : '--disable-forms');
$pdfSetting->set("args_user_style_sheet", $_POST["args_user_style_sheet"]);
$pdfSetting->set("args_page_size", $_POST["args_page_size"]);
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "webkit");
}

+ Here is the call graph for this function:

ilObjPDFGenerationGUI::settingsObject ( )

Definition at line 111 of file class.ilObjPDFGenerationGUI.php.

References $_GET, ilObjectGUI\$ilias, ilRPCServerSettings\getInstance(), and ilSelectInputGUI\setOptions().

{
global $ilAccess, $ilias;
if (!$ilAccess->checkAccess("visible", "", $_GET['ref_id']))
{
$ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
}
$pdfSetting = new ilSetting("pdf");
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth("100%");
$form->setId("settings");
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("pdf_html_to_pdf_settings"));
$form->addItem($header);
$method = new ilSelectInputGUI($this->lng->txt("pdf_html_to_pdf_method"), "html_to_pdf_method");
$options = array();
$options['none'] = $this->lng->txt('pdf_html_to_pdf_method_not_available');
include_once './Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
{
$options['fop'] = $this->lng->txt('pdf_html_to_pdf_method_fop');
}
if (strlen($pdfSetting->get("path_to_wkhtml")))
{
$options['webkit'] = $this->lng->txt('pdf_html_to_pdf_method_webkit');
}
$method->setOptions($options);
$method->setValue((strlen($pdfSetting->get('html_to_pdf_method'))) ? $pdfSetting->get('html_to_pdf_method') : 'none');
$method->setRequired(true);
$form->addItem($method);
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$form->addCommandButton("saveSettings", $this->lng->txt("save"));
}
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}

+ Here is the call graph for this function:

ilObjPDFGenerationGUI::webkitObject ( )

Definition at line 168 of file class.ilObjPDFGenerationGUI.php.

References $_GET, ilObjectGUI\$ilias, ilFormPropertyGUI\setInfo(), ilTextInputGUI\setSize(), ilNumberInputGUI\setSize(), ilNumberInputGUI\setSuffix(), and ilCheckboxInputGUI\setValue().

{
global $ilAccess;
global $ilAccess, $ilias;
if (!$ilAccess->checkAccess("visible", "", $_GET['ref_id']))
{
$ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
}
$pdfSetting = new ilSetting("pdf");
$wkhtmltopdf = array_key_exists("path_to_wkhtml", $_GET) ? $_GET["path_to_wkhtml"] : $pdfSetting->get("path_to_wkhtml");
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTableWidth("100%");
$form->setId("settings");
// general properties
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("pdf_wkhtml_settings"));
$form->addItem($header);
$path_to_wkhtml = new ilTextInputGUI($this->lng->txt("pdf_path_to_wkhtml"), "path_to_wkhtml");
$path_to_wkhtml->setSize(60);
$path_to_wkhtml->setValue($wkhtmltopdf);
if (!@file_exists($wkhtmltopdf) && strlen($wkhtmltopdf)) $path_to_wkhtml->setAlert($this->lng->txt('pdf_file_path_not_found'));
$form->addItem($path_to_wkhtml);
$wkhtml_info = new ilNonEditableValueGUI();
$wkhtml_info->setInfo($this->lng->txt('pdf_wkhtml_info'));
$form->addItem($wkhtml_info);
$headers_footer = new ilFormSectionHeaderGUI();
$headers_footer->setTitle($this->lng->txt("pdf_headers_footer_options"));
$form->addItem($headers_footer);
$header_font_size = new ilNumberInputGUI($this->lng->txt("pdf_header_font_size"), "args_header_font_size");
$header_font_size->setSuffix('pt');
$header_font_size->setSize(3);
$header_font_size->setValue(strlen($pdfSetting->get("args_header_font_size")) ? $pdfSetting->get("args_header_font_size") : "9");
$form->addItem($header_font_size);
$header_left = new ilTextInputGUI($this->lng->txt("pdf_header_left"), "args_header_left");
$header_left->setSize(20);
$header_left->setValue(strlen($pdfSetting->get("args_header_left")) ? $pdfSetting->get("args_header_left") : "[date]");
$form->addItem($header_left);
$header_center = new ilTextInputGUI($this->lng->txt("pdf_header_center"), "args_header_center");
$header_center->setSize(20);
$header_center->setValue(strlen($pdfSetting->get("args_header_center")) ? $pdfSetting->get("args_header_center") : "ILIAS Open Source");
$form->addItem($header_center);
$header_right = new ilTextInputGUI($this->lng->txt("pdf_header_right"), "args_header_right");
$header_right->setSize(20);
$header_right->setValue(strlen($pdfSetting->get("args_header_right")) ? $pdfSetting->get("args_header_right") : "[time]");
$form->addItem($header_right);
$header_line = new ilCheckboxInputGUI($this->lng->txt("pdf_header_line"), "args_header_line");
$header_line->setValue(1);
$header_line->setChecked((strcmp($pdfSetting->get("args_header_line"), '--header-line') == 0) ? true : false);
$header_line->setOptionTitle($this->lng->txt("pdf_header_line_desc"));
$form->addItem($header_line);
$footer_font_size = new ilNumberInputGUI($this->lng->txt("pdf_footer_font_size"), "args_footer_font_size");
$footer_font_size->setSize(3);
$footer_font_size->setSuffix('pt');
$footer_font_size->setValue(strlen($pdfSetting->get("args_footer_font_size")) ? $pdfSetting->get("args_footer_font_size") : "9");
$form->addItem($footer_font_size);
$footer_left = new ilTextInputGUI($this->lng->txt("pdf_footer_left"), "args_footer_left");
$footer_left->setSize(20);
$footer_left->setValue(strlen($pdfSetting->get("args_footer_left")) ? $pdfSetting->get("args_footer_left") : "");
$form->addItem($footer_left);
$footer_center = new ilTextInputGUI($this->lng->txt("pdf_footer_center"), "args_footer_center");
$footer_center->setSize(20);
$footer_center->setValue(strlen($pdfSetting->get("args_footer_center")) ? $pdfSetting->get("args_footer_center") : "");
$form->addItem($footer_center);
$footer_right = new ilTextInputGUI($this->lng->txt("pdf_footer_right"), "args_footer_right");
$footer_right->setSize(20);
$footer_right->setValue(strlen($pdfSetting->get("args_footer_right")) ? $pdfSetting->get("args_footer_right") : "[page]/[toPage]");
$form->addItem($footer_right);
$footer_line = new ilCheckboxInputGUI($this->lng->txt("pdf_footer_line"), "args_footer_line");
$footer_line->setValue(1);
$footer_line->setChecked((strcmp($pdfSetting->get("args_footer_line"), '--footer-line') == 0) ? true : false);
$footer_line->setOptionTitle($this->lng->txt("pdf_footer_line_desc"));
$form->addItem($footer_line);
$headers_info = new ilNonEditableValueGUI();
$headers_info->setInfo($this->lng->txt('pdf_header_footer_parm_desc'));
$form->addItem($headers_info);
$page_options = new ilFormSectionHeaderGUI();
$page_options->setTitle($this->lng->txt("pdf_page_options"));
$form->addItem($page_options);
$zoom = new ilNumberInputGUI($this->lng->txt("pdf_zoom"), "args_zoom");
$zoom->setSuffix($this->lng->txt("pdf_zoom_suffix"));
$zoom->setSize(20);
$zoom->setValue(strlen($pdfSetting->get("args_zoom")) ? $pdfSetting->get("args_zoom") : 0.75);
$form->addItem($zoom);
$external_links = new ilCheckboxInputGUI($this->lng->txt("pdf_external_links"), "args_external_links");
$external_links->setValue(1);
$external_links->setChecked((strlen($pdfSetting->get("args_footer_line")) == 0 || strcmp($pdfSetting->get("args_footer_line"), '--enable-external-links') == 1) ? true : false);
$external_links->setOptionTitle($this->lng->txt("pdf_external_links_desc"));
$form->addItem($external_links);
$enable_forms = new ilCheckboxInputGUI($this->lng->txt("pdf_enable_forms"), "args_enable_forms");
$enable_forms->setValue(1);
$enable_forms->setChecked((strcmp($pdfSetting->get("args_enable_forms"), '--enable-forms') == 1) ? true : false);
$enable_forms->setOptionTitle($this->lng->txt("pdf_enable_forms_desc"));
$form->addItem($enable_forms);
$user_style_sheet = new ilTextInputGUI($this->lng->txt("pdf_user_style_sheet"), "args_user_style_sheet");
$user_style_sheet->setInfo($this->lng->txt("pdf_user_style_sheet_desc"));
$user_style_sheet->setSuffix($this->lng->txt("url"));
$user_style_sheet->setSize(50);
$user_style_sheet->setValue(strlen($pdfSetting->get("args_user_style_sheet")) ? $pdfSetting->get("args_user_style_sheet") : "");
$form->addItem($user_style_sheet);
$page_size = new ilSelectInputGUI($this->lng->txt("pdf_page_size"), "args_page_size");
$pagesizes = array('A0','A1','A2','A3','A4','A5','A6','A7','A8','A9','B0','B1','B2','B3','B4','B5','B6','B7','B8','B9','B10','CSE','Comm10E','DLE','Executive','Folio','Ledger','Legal','Letter','Tabloid');
$options = array();
foreach ($pagesizes as $size)
{
$options[$size] = $size;
}
$page_size->setOptions($options);
$page_size->setValue((strlen($pdfSetting->get('args_page_size')) == 0) ? 'A4' : $pdfSetting->get('args_page_size'));
$page_size->setRequired(true);
$form->addItem($page_size);
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$form->addCommandButton("saveWebkit", $this->lng->txt("save"));
}
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}

+ Here is the call graph for this function:

Field Documentation

ilObjPDFGenerationGUI::$conditions

Constructor public.

Definition at line 44 of file class.ilObjPDFGenerationGUI.php.


The documentation for this class was generated from the following file: