/**
  * Options array can contain the following key/value pairs
  * - show_filter : True if filtering data is possible
  * - columns : Array of columns to display
  * - definition_id: ID of a definition  -> shows certificates only from this definition
  * - user_id: ID of a user -> shows certificates only from the given user
  * - newest_version_only : True to display the newest versions of certificates only
  * - actions : Array of possible actions, currently possible: atm array('download')
  * - actions_multi: Array of possible multi-actions, atm: array('download_zip')
  *
  * @param $a_parent_obj
  * @param string $a_parent_cmd
  * @param array $options
  */
 public function __construct($a_parent_obj, $a_parent_cmd = "", array $options = array())
 {
     global $ilCtrl, $ilUser;
     $_options = array('show_filter' => true, 'columns' => self::$default_columns, 'definition_id' => 0, 'user_id' => 0, 'newest_version_only' => true, 'actions' => array('download'), 'actions_multi' => array('download_zip'), 'build_data' => true);
     $this->options = array_merge($_options, $options);
     $this->setPrefix('cert_');
     $this->setId($this->getOption('user_id') . '_' . $this->getOption('definition_id'));
     $this->columns = $this->getOption('columns');
     $this->pl = ilCertificatePlugin::getInstance();
     $this->ctrl = $ilCtrl;
     $this->user = $ilUser;
     $this->setShowRowsSelector(true);
     parent::__construct($a_parent_obj, $a_parent_cmd, "");
     $this->setRowTemplate('tpl.cert_row.html', $this->pl->getDirectory());
     $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
     $this->addColumns();
     $this->setExportFormats(array(self::EXPORT_EXCEL));
     if ($this->getOption('show_filter')) {
         $this->initFilter();
     }
     if ($this->getOption('build_data')) {
         $this->buildData();
     }
     if ($this->has_any_certs && count($this->getOption('actions_multi'))) {
         $this->setSelectAllCheckbox("cert_id[]");
         $this->addMultiCommand("downloadCertificates", $this->pl->txt('download_zip'));
     }
 }
 /**
  * Configure screen
  */
 public function configure()
 {
     $form = new ilCertificateConfigFormGUI($this);
     $form->fillForm();
     $ftpl = new ilTemplate('tpl.config_form.html', true, true, $this->pl->getDirectory());
     $ftpl->setVariable("FORM", $form->getHTML());
     $ftpl->setVariable("TXT_USE_PLACEHOLDERS", $this->pl->txt('txt_use_placeholders'));
     foreach (srCertificateStandardPlaceholders::getStandardPlaceholders() as $placeholder => $text) {
         $ftpl->setCurrentBlock("placeholder");
         $ftpl->setVariable("PLACEHOLDER", $placeholder);
         $ftpl->setVariable("TXT_PLACEHOLDER", $text);
         $ftpl->parseCurrentBlock();
     }
     $this->tpl->setContent($ftpl->get());
 }
 /**
  * @param $a_parent_obj
  * @param string $a_parent_cmd
  */
 public function __construct($a_parent_obj, $a_parent_cmd)
 {
     global $ilCtrl, $ilToolbar;
     $this->setId('cert_type_standard_placeholders');
     parent::__construct($a_parent_obj, $a_parent_cmd);
     $this->pl = ilCertificatePlugin::getInstance();
     $this->ctrl = $ilCtrl;
     $this->toolbar = $ilToolbar;
     $this->setRowTemplate('tpl.type_standard_placeholders_row.html', $this->pl->getDirectory());
     $this->initColumns();
     $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
     $this->setTitle($this->pl->txt('standard_placeholders'));
     $this->setDescription($this->pl->txt('standard_placeholders_desc'));
     $this->buildData();
 }
 /**
  * @param $a_parent_obj
  * @param string $a_parent_cmd
  * @param srCertificateType $type
  */
 public function __construct($a_parent_obj, $a_parent_cmd, srCertificateType $type)
 {
     global $ilCtrl, $ilToolbar;
     $this->setId('cert_type_signatures');
     parent::__construct($a_parent_obj, $a_parent_cmd);
     $this->type = $type;
     $this->pl = ilCertificatePlugin::getInstance();
     $this->ctrl = $ilCtrl;
     $this->toolbar = $ilToolbar;
     $this->setRowTemplate('tpl.type_signatures_row.html', $this->pl->getDirectory());
     $this->initColumns();
     $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
     $this->toolbar->addButton($this->pl->txt('add_new_signature'), $this->ctrl->getLinkTarget($a_parent_obj, 'addSignature'));
     $this->buildData();
 }
 public function __construct($a_parent_obj, $a_parent_cmd)
 {
     global $ilCtrl, $ilToolbar;
     $this->setId('cert_type_table');
     parent::__construct($a_parent_obj, $a_parent_cmd);
     $this->pl = ilCertificatePlugin::getInstance();
     $this->ctrl = $ilCtrl;
     $this->toolbar = $ilToolbar;
     $this->setRowTemplate('tpl.type_row.html', $this->pl->getDirectory());
     $this->initColumns();
     $this->addColumn($this->pl->txt('actions'));
     $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
     $this->toolbar->addButton($this->pl->txt('add_new_type'), $this->ctrl->getLinkTargetByClass('srcertificatetypegui', 'addType'));
     $data = srCertificateType::getArray();
     $this->setData($data);
 }
 /**
  * @param $a_parent_obj
  * @param string $a_parent_cmd
  * @param srCertificateType $type
  */
 public function __construct($a_parent_obj, $a_parent_cmd, srCertificateType $type)
 {
     global $ilCtrl, $ilToolbar;
     $this->setId('cert_type_table_settings');
     parent::__construct($a_parent_obj, $a_parent_cmd);
     $this->type = $type;
     $this->pl = ilCertificatePlugin::getInstance();
     $this->ctrl = $ilCtrl;
     $this->toolbar = $ilToolbar;
     $this->setRowTemplate('tpl.type_settings_row.html', $this->pl->getDirectory());
     $this->initColumns();
     $this->addColumn($this->pl->txt('actions'));
     $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
     $this->setTitle($this->pl->txt('standard_settings'));
     $this->buildData();
 }
 /**
  * @param $a_parent_obj
  * @param string $a_parent_cmd
  * @param srCertificateType $type
  */
 public function __construct($a_parent_obj, $a_parent_cmd, srCertificateType $type)
 {
     global $ilCtrl, $ilToolbar;
     $this->setId('cert_type_placeholders');
     parent::__construct($a_parent_obj, $a_parent_cmd);
     $this->type = $type;
     $this->pl = ilCertificatePlugin::getInstance();
     $this->ctrl = $ilCtrl;
     $this->toolbar = $ilToolbar;
     $this->setRowTemplate('tpl.type_placeholders_row.html', $this->pl->getDirectory());
     $this->initColumns();
     $this->addColumn($this->pl->txt('actions'));
     $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
     $this->toolbar->addButton($this->pl->txt('add_new_placeholder'), $this->ctrl->getLinkTargetByClass('srcertificatetypegui', 'addPlaceholder'));
     $this->buildData();
     $this->setTitle($this->pl->txt('custom_placeholders'));
 }