本文整理匯總了PHP中ilTemplate::setContent方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilTemplate::setContent方法的具體用法?PHP ilTemplate::setContent怎麽用?PHP ilTemplate::setContent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ilTemplate
的用法示例。
在下文中一共展示了ilTemplate::setContent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: showCmd
private function showCmd()
{
$selectedSkillProfile = ilTestSkillEvaluationToolbarGUI::fetchSkillProfileParam($_POST);
$testSession = $this->testSessionFactory->getSession();
$this->skillEvaluation->init()->evaluate($testSession->getActiveId(), $testSession->getLastFinishedPass(), $testSession->getUserId());
$evaluationToolbarGUI = $this->buildEvaluationToolbarGUI($testSession->getUserId(), $selectedSkillProfile);
$personalSkillsGUI = $this->buildPersonalSkillsGUI($testSession->getUserId(), $selectedSkillProfile);
$this->tpl->setContent($this->ctrl->getHTML($evaluationToolbarGUI) . $this->ctrl->getHTML($personalSkillsGUI));
}
示例2: showSkillThresholdsCmd
private function showSkillThresholdsCmd()
{
$table = $this->buildTableGUI();
$skillLevelThresholdList = $this->buildSkillLevelThresholdList();
$skillLevelThresholdList->loadFromDb();
$table->setSkillLevelThresholdList($skillLevelThresholdList);
$assignmentList = $this->buildSkillQuestionAssignmentList();
$assignmentList->loadFromDb();
$table->setData($assignmentList->getUniqueAssignedSkills());
$this->tpl->setContent($this->ctrl->getHTML($table));
}
示例3: save
/**
* Save config
*/
public function save()
{
$form = new ilCertificateConfigFormGUI($this);
if ($form->saveObject()) {
ilUtil::sendSuccess($this->pl->txt('msg_save_config'), true);
$this->ctrl->redirect($this, 'configure');
} else {
$form->setValuesByPost();
$this->tpl->setContent($form->getHTML());
}
}
示例4: startImport
public function startImport()
{
$form = $this->initForm("startImport");
if (!$form->checkInput()) {
$this->tpl->setContent($form->getHTML());
} else {
$file = $form->getInput("import_file");
$importer = new ilOrgUnitSimpleImport();
try {
$file_path = $file["tmp_name"];
$file_type = pathinfo($file["name"], PATHINFO_EXTENSION);
$file_name = pathinfo($file["name"], PATHINFO_FILENAME);
if ($file_type == "zip") {
$extract_path = $file_path . '_extracted/';
$extracted_file = $extract_path . $file_name . '/manifest.xml';
$zip = new ZipArchive();
$res = $zip->open($file_path);
if ($res === true) {
$zip->extractTo($extract_path);
$zip->close();
if (file_exists($extracted_file)) {
$file_path = $extracted_file;
}
}
}
$importer->simpleImport($file_path);
} catch (Exception $e) {
$this->ilLog->write($e->getMessage() . " - " . $e->getTraceAsString());
ilUtil::sendFailure($this->lng->txt("import_failed"), true);
$this->ctrl->redirect($this, "render");
}
$this->displayImportResults($importer);
}
}
示例5: listFields
/**
* list fields
*/
public function listFields()
{
// Show tables
require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php";
$tables = $this->parent_obj->object->getTables();
foreach ($tables as $table) {
$options[$table->getId()] = $table->getTitle();
}
include_once './Services/Form/classes/class.ilSelectInputGUI.php';
$table_selection = new ilSelectInputGUI('', 'table_id');
$table_selection->setOptions($options);
$table_selection->setValue($this->table_id);
$this->toolbar->setFormAction($this->ctrl->getFormActionByClass("ilDataCollectionFieldListGUI", "doTableSwitch"));
$this->toolbar->addText($this->lng->txt("dcl_table"));
$this->toolbar->addInputItem($table_selection);
$this->toolbar->addFormButton($this->lng->txt('change'), 'doTableSwitch');
$this->toolbar->addSeparator();
$this->toolbar->addButton($this->lng->txt("dcl_add_new_table"), $this->ctrl->getLinkTargetByClass("ildatacollectiontableeditgui", "create"));
$this->toolbar->addSeparator();
$this->ctrl->setParameterByClass("ildatacollectiontableeditgui", "table_id", $this->table_id);
$this->toolbar->addButton($this->lng->txt("dcl_table_settings"), $this->ctrl->getLinkTargetByClass("ildatacollectiontableeditgui", "edit"));
$this->toolbar->addButton($this->lng->txt("dcl_delete_table"), $this->ctrl->getLinkTargetByClass("ildatacollectiontableeditgui", "confirmDelete"));
$this->toolbar->addButton($this->lng->txt("dcl_add_new_field"), $this->ctrl->getLinkTargetByClass("ildatacollectionfieldeditgui", "create"));
// requested not to implement this way...
// $tpl->addJavaScript("Modules/DataCollection/js/fastTableSwitcher.js");
require_once './Modules/DataCollection/classes/class.ilDataCollectionFieldListTableGUI.php';
$list = new ilDataCollectionFieldListTableGUI($this, $this->ctrl->getCmd(), $this->table_id);
$this->tpl->setContent($list->getHTML());
}
示例6: showMarkSchema
/**
* Display mark schema
* @param ilPropertyFormGUI $ects_form
*/
protected function showMarkSchema(ilPropertyFormGUI $ects_form = null)
{
if (!$this->object->canEditMarks()) {
ilUtil::sendInfo($this->lng->txt('cannot_edit_marks'));
}
$this->toolbar->setFormAction($this->ctrl->getFormAction($this, 'showMarkSchema'));
if ($this->object->canEditMarks()) {
require_once 'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
$create_simple_mark_schema_button = ilSubmitButton::getInstance();
$create_simple_mark_schema_button->setCaption($this->lng->txt('tst_mark_create_simple_mark_schema'), false);
$create_simple_mark_schema_button->setCommand('addSimpleMarkSchema');
$this->toolbar->addButtonInstance($create_simple_mark_schema_button);
}
require_once 'Modules/Test/classes/tables/class.ilMarkSchemaTableGUI.php';
$mark_schema_table = new ilMarkSchemaTableGUI($this, 'showMarkSchema', '', $this->object);
$content_parts = array($mark_schema_table->getHTML());
if ($this->objectSupportsEctsGrades() && $this->object->canEditEctsGrades()) {
if (!$ects_form instanceof ilPropertyFormGUI) {
$ects_form = $this->getEctsForm();
$this->populateEctsForm($ects_form);
}
$content_parts[] = $ects_form->getHTML();
}
$this->tpl->setContent(implode('<br />', $content_parts));
}
示例7: showFormCmd
private function showFormCmd(ilPropertyFormGUI $form = null)
{
if ($form === null) {
$form = $this->buildForm();
}
$this->tpl->setContent($this->ctrl->getHTML($form));
}
示例8: showAttachments
public function showAttachments()
{
/**
* @var $ilToolbar ilToolbarGUI
*/
global $ilToolbar;
$this->tpl->setTitle($this->lng->txt('mail'));
require_once 'Services/Form/classes/class.ilFileInputGUI.php';
$attachment = new ilFileInputGUI($this->lng->txt('upload'), 'userfile');
$attachment->setRequired(true);
$attachment->setSize(20);
$ilToolbar->setFormAction($this->ctrl->getFormAction($this, 'uploadFile'), true);
$ilToolbar->addInputItem($attachment);
$ilToolbar->addFormButton($this->lng->txt('upload'), 'uploadFile');
require_once 'Services/Mail/classes/class.ilMailAttachmentTableGUI.php';
$table = new ilMailAttachmentTableGUI($this, 'showAttachments');
$mailData = $this->umail->getSavedData();
$files = $this->mfile->getUserFilesData();
$data = array();
$counter = 0;
foreach ($files as $file) {
$checked = false;
if (is_array($mailData['attachments']) && in_array($file['name'], $mailData['attachments'])) {
$checked = true;
}
$data[$counter] = array('checked' => $checked, 'filename' => $file['name'], 'filesize' => (int) $file['size'], 'filecreatedate' => (int) $file['ctime']);
++$counter;
}
$table->setData($data);
$this->tpl->setContent($table->getHtml());
$this->tpl->show();
}
示例9: confirmDelete
public function confirmDelete()
{
$conf = new ilConfirmationGUI();
$conf->setFormAction($this->ctrl->getFormAction($this));
$conf->setHeaderText($this->pl->txt('msg_confirm_delete'));
$conf->setConfirm($this->pl->txt('check_delete'), self::CMD_DELETE);
$conf->setCancel($this->pl->txt('check_cancel'), self::CMD_INDEX);
$this->tpl->setContent($conf->getHTML());
}
示例10: showConfirmation
private function showConfirmation(ilPropertyFormGUI $form)
{
require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirmation = new ilConfirmationGUI();
$confirmation->setHeaderText($this->lng->txt('tst_trigger_result_refreshing'));
$confirmation->setFormAction($this->ctrl->getFormAction($this));
$confirmation->setCancel($this->lng->txt('cancel'), self::CMD_SHOW_FORM);
$confirmation->setConfirm($this->lng->txt('confirm'), self::CMD_CONFIRMED_SAVE_FORM);
foreach ($form->getInputItemsRecursive() as $key => $item) {
//vd("$key // {$item->getType()} // ".json_encode($_POST[$item->getPostVar()]));
switch ($item->getType()) {
case 'section_header':
continue;
case 'datetime':
list($date, $time) = explode(' ', $item->getDate()->get(IL_CAL_DATETIME));
if ($item->getMode() == ilDateTimeInputGUI::MODE_SELECT) {
list($y, $m, $d) = explode('-', $date);
$confirmation->addHiddenItem("{$item->getPostVar()}[date][y]", $y);
$confirmation->addHiddenItem("{$item->getPostVar()}[date][m]", $m);
$confirmation->addHiddenItem("{$item->getPostVar()}[date][d]", $d);
if ($item->getShowTime()) {
list($h, $m, $s) = explode(':', $time);
$confirmation->addHiddenItem("{$item->getPostVar()}[time][h]", $h);
$confirmation->addHiddenItem("{$item->getPostVar()}[time][m]", $m);
$confirmation->addHiddenItem("{$item->getPostVar()}[time][s]", $s);
}
} else {
$confirmation->addHiddenItem("{$item->getPostVar()}[date]", $date);
$confirmation->addHiddenItem("{$item->getPostVar()}[time]", $time);
}
break;
case 'duration':
$confirmation->addHiddenItem("{$item->getPostVar()}[MM]", (int) $item->getMonths());
$confirmation->addHiddenItem("{$item->getPostVar()}[dd]", (int) $item->getDays());
$confirmation->addHiddenItem("{$item->getPostVar()}[hh]", (int) $item->getHours());
$confirmation->addHiddenItem("{$item->getPostVar()}[mm]", (int) $item->getMinutes());
$confirmation->addHiddenItem("{$item->getPostVar()}[ss]", (int) $item->getSeconds());
break;
case 'checkboxgroup':
if (is_array($item->getValue())) {
foreach ($item->getValue() as $option) {
$confirmation->addHiddenItem("{$item->getPostVar()}[]", $option);
}
}
break;
case 'checkbox':
if ($item->getChecked()) {
$confirmation->addHiddenItem($item->getPostVar(), 1);
}
break;
default:
$confirmation->addHiddenItem($item->getPostVar(), $item->getValue());
}
}
$this->tpl->setContent($this->ctrl->getHTML($confirmation));
}
示例11: showSkillQuestionAssignmentsCmd
private function showSkillQuestionAssignmentsCmd()
{
$table = $this->buildTableGUI();
$assignmentList = $this->buildSkillQuestionAssignmentList();
$assignmentList->loadFromDb();
$assignmentList->loadAdditionalSkillData();
$table->setSkillQuestionAssignmentList($assignmentList);
$table->setData($this->testOBJ->getTestQuestions());
$this->tpl->setContent($this->ctrl->getHTML($table));
}
示例12: update
/**
* Update (save) type
*/
protected function update()
{
$form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
if ($form->saveObject()) {
ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
$this->ctrl->redirect($this);
} else {
$this->tpl->setContent($form->getHTML());
}
}
示例13: showResetTemplateConfirmationCmd
/**
* Enable all settings - Confirmation
*/
private function showResetTemplateConfirmationCmd()
{
require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirmationGUI = new ilConfirmationGUI();
$confirmationGUI->setFormAction($this->ctrl->getFormAction($this));
$confirmationGUI->setHeaderText($this->lng->txt("test_confirm_template_reset"));
$confirmationGUI->setCancel($this->lng->txt('cancel'), self::CMD_SHOW_FORM);
$confirmationGUI->setConfirm($this->lng->txt('confirm'), self::CMD_CONFIRMED_RESET_TPL);
$this->tpl->setContent($this->ctrl->getHTML($confirmationGUI));
}
示例14: confirmDelete
/**
* confirmDelete
*/
public function confirmDelete()
{
include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
$conf = new ilConfirmationGUI();
$conf->setFormAction($this->ctrl->getFormAction($this));
$conf->setHeaderText($this->lng->txt('dcl_confirm_delete_table'));
$conf->addItem('table', (int) $this->table->getId(), $this->table->getTitle());
$conf->setConfirm($this->lng->txt('delete'), 'delete');
$conf->setCancel($this->lng->txt('cancel'), 'cancelDelete');
$this->tpl->setContent($conf->getHTML());
}
示例15: confirmTypeChange
/**
* Display INFO/Warning Screen if the type was changed by user
*
*/
public function confirmTypeChange()
{
$new_type_id = (int) $_POST['type_id'];
$conf_gui = new ilConfirmationGUI();
$conf_gui->setFormAction($this->ctrl->getFormAction($this));
$conf_gui->setHeaderText($this->pl->txt('confirm_type_change'));
$conf_gui->addItem('type_id', $new_type_id, $this->pl->txt('confirm_type_change_text'));
$conf_gui->setConfirm($this->lng->txt('change'), 'updateType');
$conf_gui->setCancel($this->lng->txt('cancel'), 'showDefinition');
$this->tpl->setContent($conf_gui->getHTML());
}