本文整理汇总了PHP中ilFileInputGUI::setSuffixes方法的典型用法代码示例。如果您正苦于以下问题:PHP ilFileInputGUI::setSuffixes方法的具体用法?PHP ilFileInputGUI::setSuffixes怎么用?PHP ilFileInputGUI::setSuffixes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilFileInputGUI
的用法示例。
在下文中一共展示了ilFileInputGUI::setSuffixes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editSettings
/**
* Edit news settings.
*/
public function editSettings()
{
global $ilCtrl, $lng, $ilSetting, $ilTabs, $ilToolbar;
$ilTabs->activateTab("settings");
if (OH_REF_ID > 0) {
ilUtil::sendInfo("This installation is used for online help authoring. Help modules cannot be imported.");
return;
}
if ($this->checkPermissionBool("write")) {
// help file
include_once "./Services/Form/classes/class.ilFileInputGUI.php";
$fi = new ilFileInputGUI($lng->txt("help_help_file"), "help_file");
$fi->setSuffixes(array("zip"));
$ilToolbar->addInputItem($fi, true);
$ilToolbar->addFormButton($lng->txt("upload"), "uploadHelpFile");
$ilToolbar->addSeparator();
// help mode
include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
$options = array("" => $lng->txt("help_tooltips_and_help"), "1" => $lng->txt("help_help_only"), "2" => $lng->txt("help_tooltips_only"));
$si = new ilSelectInputGUI($this->lng->txt("help_mode"), "help_mode");
$si->setOptions($options);
$si->setValue($ilSetting->get("help_mode"));
$ilToolbar->addInputItem($si);
$ilToolbar->addFormButton($lng->txt("help_set_mode"), "setMode");
}
$ilToolbar->setFormAction($ilCtrl->getFormAction($this), true);
include_once "./Services/Help/classes/class.ilHelpModuleTableGUI.php";
$tab = new ilHelpModuleTableGUI($this, "editSettings");
$this->tpl->setContent($tab->getHTML());
}
示例2: _initForm
/**
* Init Social Bookmark edit/create Form
*
* @param ilObjectGUI $formhandlerObject taken as form target
* @param int $mode "create" / "edit"
*/
public static function _initForm($formhandlerObject, $mode = "create", $id = 0)
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setMultipart(true);
// File Title
$in_title = new ilTextInputGUI($lng->txt("title"), "title");
$in_title->setMaxLength(128);
$in_title->setSize(40);
$in_title->setRequired(true);
$form->addItem($in_title);
// Link
$in_link = new ilTextInputGUI($lng->txt("link"), "link");
$in_link->setMaxLength(300);
$in_link->setSize(40);
$in_link->setRequired(true);
$in_link->setInfo($lng->txt('socialbm_link_description'));
$form->addItem($in_link);
// File
$in_file = new ilFileInputGUI($lng->txt("file"), "image_file");
$in_file->setSuffixes(array('bmp', 'gif', 'jpg', 'jpeg', 'png'));
$form->addItem($in_file);
// Activate on submit
$in_activate = new ilCheckboxInputGUI($lng->txt("activate"), "activate");
$in_activate->setValue('1');
$form->addItem($in_activate);
// save and cancel commands
if ($mode == "create") {
$form->addCommandButton("createSocialBookmark", $lng->txt("create"));
$form->addCommandButton("editSocialBookmarks", $lng->txt("cancel"));
$form->setTitle($lng->txt("adm_social_bm_create"));
$in_file->setRequired(true);
} else {
if ($mode == "update") {
$in_hidden = new ilHiddenInputGUI("sbm_id", $id);
$form->addItem($in_hidden);
$form->addCommandButton("updateSocialBookmark", $lng->txt("update"));
$form->addCommandButton("cancel", $lng->txt("cancel"));
$form->setTitle($lng->txt("adm_social_bm_edit"));
$in_file->setRequired(false);
}
}
$form->setTableWidth("60%");
$form->setFormAction($ilCtrl->getFormAction($formhandlerObject));
return $form;
}
示例3: listSubtitleFilesObject
/**
* List subtitls files
*
* @param
* @return
*/
function listSubtitleFilesObject()
{
global $ilToolbar, $tpl, $ilCtrl, $lng, $ilUser;
$this->setPropertiesSubTabs("subtitles");
// upload file
$ilToolbar->setFormAction($ilCtrl->getFormAction($this), true);
include_once "./Services/Form/classes/class.ilFileInputGUI.php";
$fi = new ilFileInputGUI($lng->txt("mob_subtitle_file") . " (.srt)", "subtitle_file");
$fi->setSuffixes(array("srt"));
$ilToolbar->addInputItem($fi, true);
// language
include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
include_once "./Services/MetaData/classes/class.ilMDLanguageItem.php";
$options = ilMDLanguageItem::_getLanguages();
$si = new ilSelectInputGUI($this->lng->txt("mob_language"), "language");
$si->setOptions($options);
$si->setValue($ilUser->getLanguage());
$ilToolbar->addInputItem($si, true);
$ilToolbar->addFormButton($lng->txt("upload"), "uploadSubtitleFile");
include_once "./Services/MediaObjects/classes/class.ilMobSubtitleTableGUI.php";
$tab = new ilMobSubtitleTableGUI($this, "listSubtitleFiles", $this->object);
$tpl->setContent($tab->getHTML());
}
示例4: initImportForm
/**
* Create import form
*/
protected function initImportForm()
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt('cal_import_tbl'));
$form->setFormAction($this->ctrl->getFormAction($this));
$form->addCommandButton('uploadAppointments', $this->lng->txt('import'));
$ics = new ilFileInputGUI($this->lng->txt('cal_import_file'), 'file');
$ics->setALlowDeletion(false);
$ics->setSuffixes(array('ics'));
$ics->setInfo($this->lng->txt('cal_import_file_info'));
$form->addItem($ics);
return $form;
}
示例5: initImportForm
/**
* Init object import form
*
* @param string new type
* @return ilPropertyFormGUI
*/
protected function initImportForm($a_new_type)
{
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setTarget("_top");
$form->setFormAction($this->ctrl->getFormAction($this, "importFile"));
$form->setTitle($this->lng->txt($a_new_type . "_import"));
include_once "./Services/Form/classes/class.ilFileInputGUI.php";
$fi = new ilFileInputGUI($this->lng->txt("import_file"), "importfile");
$fi->setSuffixes(array("zip"));
$fi->setRequired(true);
$form->addItem($fi);
$form->addCommandButton("importFile", $this->lng->txt("import"));
$form->addCommandButton("cancel", $this->lng->txt("cancel"));
return $form;
}
示例6: initUserImportForm
/**
* Init user import form.
*
* @param int $a_mode Edit Mode
*/
public function initUserImportForm()
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
// Import File
include_once "./Services/Form/classes/class.ilFileInputGUI.php";
$fi = new ilFileInputGUI($lng->txt("import_file"), "importFile");
$fi->setSuffixes(array("xml", "zip"));
//$fi->enableFileNameSelection();
//$fi->setInfo($lng->txt(""));
$this->form->addItem($fi);
$this->form->addCommandButton("importUserRoleAssignment", $lng->txt("import"));
$this->form->addCommandButton("importCancelled", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("import_users"));
$this->form->setFormAction($ilCtrl->getFormAction($this));
}
示例7: initPageLayoutImportForm
/**
* Init page layout import form.
*/
public function initPageLayoutImportForm()
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
// template file
$fi = new ilFileInputGUI($lng->txt("file"), "file");
$fi->setSuffixes(array("zip"));
$fi->setRequired(true);
$form->addItem($fi);
$form->addCommandButton("importPageLayout", $lng->txt("import"));
$form->addCommandButton("viewPageLayouts", $lng->txt("cancel"));
$form->setTitle($lng->txt("sty_import_page_layout"));
$form->setFormAction($ilCtrl->getFormAction($this));
return $form;
}
示例8: initZipUploadForm
/**
* Init upload form form.
*/
public function initZipUploadForm()
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
// desc
include_once "./Services/Form/classes/class.ilFileInputGUI.php";
$fi = new ilFileInputGUI($lng->txt("file"), "deliver");
$fi->setSuffixes(array("zip"));
$this->form->addItem($fi);
$this->form->addCommandButton("deliverUnzip", $lng->txt("upload"));
$this->form->setTitle($lng->txt("header_zip"));
$this->form->setFormAction($ilCtrl->getFormAction($this));
}
示例9: initImportForm
function initImportForm($a_new_type)
{
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setTarget("_top");
$new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
$this->ctrl->setParameter($this, "new_type", $new_type);
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt("import_tst"));
// file
include_once "./Services/Form/classes/class.ilFileInputGUI.php";
$fi = new ilFileInputGUI($this->lng->txt("import_file"), "xmldoc");
$fi->setSuffixes(array("zip"));
$fi->setRequired(true);
$form->addItem($fi);
// question pool
include_once "./Modules/Test/classes/class.ilObjTest.php";
$tst = new ilObjTest();
$questionpools = $tst->getAvailableQuestionpools(TRUE, FALSE, TRUE, TRUE);
if (count($questionpools)) {
$options = array("-1" => $this->lng->txt("dont_use_questionpool"));
foreach ($questionpools as $key => $value) {
$options[$key] = $value["title"];
}
$pool = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "qpl");
$pool->setOptions($options);
$form->addItem($pool);
}
$form->addCommandButton("importFile", $this->lng->txt("import"));
$form->addCommandButton("cancel", $this->lng->txt("cancel"));
return $form;
}
示例10: initImportForm
/**
* show import form
*
* @access protected
*/
protected function initImportForm()
{
if (is_object($this->import_form)) {
return true;
}
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$this->import_form = new ilPropertyFormGUI();
$this->import_form->setMultipart(true);
$this->import_form->setFormAction($this->ctrl->getFormAction($this));
// add file property
$file = new ilFileInputGUI($this->lng->txt('file'), 'file');
$file->setSuffixes(array('xml'));
$file->setRequired(true);
$this->import_form->addItem($file);
$this->import_form->setTitle($this->lng->txt('md_adv_import_record'));
$this->import_form->addCommandButton('importRecord', $this->lng->txt('import'));
$this->import_form->addCommandButton('showRecords', $this->lng->txt('cancel'));
}
示例11: initImportForm
/**
* init import form
*/
protected function initImportForm()
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('rbac_import_role'));
$form->addCommandButton('doImportRole', $this->lng->txt('import'));
$form->addCommandButton('perm', $this->lng->txt('cancel'));
$zip = new ilFileInputGUI($this->lng->txt('import_file'), 'importfile');
$zip->setSuffixes(array('zip'));
$form->addItem($zip);
return $form;
}
示例12: initPartProperties
/**
* add the properties of a question part to the form
*
* @param object form object to extend
* @param object question part object
* @param integer counter of the question part
*/
private function initPartProperties($form, $part_obj = null, $counter = "1")
{
// Use a dummy part object for a new booking definition
if (!isset($part_obj)) {
$part_obj = new assAccountingQuestionPart($this->object);
}
// Part identifier (is 0 for a new part)
$item = new ilHiddenInputGUI("parts[]");
$item->setValue($part_obj->getPartId());
$form->addItem($item);
// Title
$item = new ilFormSectionHeaderGUI();
$item->setTitle($this->plugin->txt('accounting_table') . ' ' . $counter);
$form->addItem($item);
// Position
$item = new ilNumberInputGUI($this->plugin->txt('position'), 'position_' . $part_obj->getPartId());
$item->setSize(2);
$item->setDecimals(1);
$item->SetInfo($this->plugin->txt('position_info'));
if ($part_obj->getPartId()) {
$item->setValue(sprintf("%01.1f", $part_obj->getPosition()));
}
$form->addItem($item);
// Text
$item = new ilTextAreaInputGUI($this->plugin->txt("question_part"), 'text_' . $part_obj->getPartId());
$item->setValue($this->object->prepareTextareaOutput($part_obj->getText()));
$item->setRows(10);
$item->setCols(80);
if (!$this->object->getSelfAssessmentEditingMode()) {
$item->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$item->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$item->addPlugin("latex");
$item->addButton("latex");
$item->addButton("pastelatex");
$item->setRTESupport($this->object->getId(), "qpl", "assessment");
} else {
$item->setRteTags(self::getSelfAssessmentTags());
$item->setUseTagsForRteOnly(false);
}
$form->addItem($item);
// Booking XML definition
$item = new ilCustomInputGUI($this->plugin->txt('booking_xml'));
$item->setInfo($this->plugin->txt('booking_xml_info'));
$tpl = $this->plugin->getTemplate('tpl.il_as_qpl_accqst_edit_xml.html');
$tpl->setVariable("CONTENT", ilUtil::prepareFormOutput($part_obj->getBookingXML()));
$tpl->setVariable("NAME", 'booking_xml_' . $part_obj->getPartId());
$item->setHTML($tpl->get());
// Booking file
$subitem = new ilFileInputGUI($this->plugin->txt('booking_file'), "booking_file_" . $part_obj->getPartId());
$subitem->setSuffixes(array('xml'));
$item->addSubItem($subitem);
// Download button
if (strlen($part_obj->getBookingXML())) {
$tpl = $this->plugin->getTemplate('tpl.il_as_qpl_accqst_form_custom.html');
$this->ctrl->setParameter($this, 'xmltype', 'booking');
$this->ctrl->setParameter($this, 'part_id', $part_obj->getPartId());
$tpl->setCurrentBlock('button');
$tpl->setVariable('BUTTON_HREF', $this->ctrl->getLinkTarget($this, 'downloadXml'));
$tpl->setVariable('BUTTON_TEXT', $this->plugin->txt('download_booking_xml'));
$tpl->ParseCurrentBlock();
$subitem = new ilcustomInputGUI('');
$subitem->setHTML($tpl->get());
$item->addSubItem($subitem);
}
$form->addItem($item);
// Delete Button
if ($part_obj->getPartId()) {
$tpl = $this->plugin->getTemplate('tpl.il_as_qpl_accqst_form_custom.html');
$tpl->setCurrentBlock('button');
$this->ctrl->setParameter($this, 'part_id', $part_obj->getPartId());
$tpl->setVariable('BUTTON_HREF', $this->ctrl->getLinkTarget($this, 'deletePart'));
$tpl->setVariable('BUTTON_TEXT', $this->plugin->txt('delete_accounting_table'));
$tpl->ParseCurrentBlock();
$item = new ilcustomInputGUI();
$item->setHTML($tpl->get());
$form->addItem($item);
}
}
示例13: importQuestionsObject
/**
* display the import form to import questions into the questionpool
*/
public function importQuestionsObject()
{
global $tpl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "uploadQuestions"));
$form->setTitle($this->lng->txt("import_question"));
include_once "./Services/Form/classes/class.ilFileInputGUI.php";
$fi = new ilFileInputGUI($this->lng->txt("select_file"), "qtidoc");
$fi->setSuffixes(array("xml", "zip"));
$fi->setRequired(true);
$form->addItem($fi);
$form->addCommandButton("uploadQuestions", $this->lng->txt("import"));
$form->addCommandButton("questions", $this->lng->txt("cancel"));
$tpl->setContent($form->getHTML());
}
示例14: initFormContent
/**
* Shows a form to add or edit content
*
* @param int $a_mode
* @param int $a_content_id optional content id
* @access protected
*/
protected function initFormContent($a_mode, $a_content_id = 0)
{
if ($this->cform instanceof ilPropertyFormGUI) {
return;
}
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$this->cform = new ilPropertyFormGUI();
switch ($a_mode) {
case self::CONTENT_MOD_EDIT:
$positive_cmd = $this->is_record ? 'updateRecord' : 'updateContent';
// Header
$this->ctrl->setParameter($this, 'content_id', (int) $_REQUEST['content_id']);
$this->cform->setTitle($this->txt('edit_content'));
// Buttons
$this->cform->addCommandButton($positive_cmd, $this->txt('save'));
$this->cform->addCommandButton('showContent', $this->txt('cancel'));
// Form action
if ($a_content_id) {
$this->ctrl->setParameter($this, 'content_id', $a_content_id);
}
$this->cform->setFormAction($this->ctrl->getFormAction($this, $positive_cmd));
break;
case self::CONTENT_MOD_ADD:
// Header
$this->cform->setTitle($this->txt('add_new_content'));
// Buttons
$this->cform->addCommandButton('addContent', $this->txt('save'));
$this->cform->addCommandButton('showContent', $this->txt('cancel'));
// Form action
$this->cform->setFormAction($this->ctrl->getFormAction($this, 'addContent'));
break;
}
// Title
$tit = new ilTextInputGUI($this->txt('title'), 'tit');
// $tit->setRequired(true);
$tit->setSize(40);
$tit->setMaxLength(127);
$this->cform->addItem($tit);
// Description
$des = new ilTextAreaInputGUI($this->txt('description'), 'des');
$des->setRows(3);
$this->cform->addItem($des);
if ($this->is_record == false) {
// File
$fil = new ilFileInputGUI($this->txt('file'), 'file');
if ($a_mode == self::CONTENT_MOD_ADD) {
$fil->setRequired(true);
}
$content_file_types = strlen(ilAdobeConnectServer::getSetting('content_file_types')) > 1 ? ilAdobeConnectServer::getSetting('content_file_types') : 'ppt, pptx, flv, swf, pdf, gif, jpg, png, mp3, html';
$fil->setSuffixes(explode(',', str_replace(' ', '', $content_file_types)));
$this->cform->addItem($fil);
}
}
示例15: editQuestion
/**
* Creates an output of the edit form for the question
*
* @access public
*/
public function editQuestion($checkonly = FALSE)
{
$save = $this->isSaveCommand();
$this->getQuestionTemplate();
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->outQuestionType());
$form->setMultipart(true);
$form->setTableWidth("100%");
$form->setId("assjavaapplet");
$this->addBasicQuestionFormProperties($form);
// points
$points = new ilNumberInputGUI($this->lng->txt("points"), "points");
$points->setValue($this->object->getPoints());
$points->setRequired(TRUE);
$points->setSize(3);
$points->setMinValue(0.0);
$form->addItem($points);
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("applet_attributes"));
$form->addItem($header);
// java applet
$javaapplet = $this->object->getJavaAppletFilename();
$applet = new ilFileInputGUI($this->lng->txt('javaapplet'), 'javaappletName');
$applet->setSuffixes(array('jar', 'class'));
$applet->setRequired(false);
if (strlen($javaapplet)) {
$filename = new ilNonEditableValueGUI($this->lng->txt('filename'), 'uploaded_javaapplet');
$filename->setValue($javaapplet);
$applet->addSubItem($filename);
$delete = new ilCheckboxInputGUI('', 'delete_applet');
$delete->setOptionTitle($this->lng->txt('delete'));
$delete->setValue(1);
$applet->addSubItem($delete);
}
$form->addItem($applet);
// Code
$code = new ilTextInputGUI($this->lng->txt("code"), "java_code");
$code->setValue($this->object->getJavaCode());
$code->setRequired(TRUE);
$form->addItem($code);
if (!strlen($javaapplet)) {
// Archive
$archive = new ilTextInputGUI($this->lng->txt("archive"), "java_archive");
$archive->setValue($this->object->getJavaArchive());
$archive->setRequired(false);
$form->addItem($archive);
// Codebase
$codebase = new ilTextInputGUI($this->lng->txt("codebase"), "java_codebase");
$codebase->setValue($this->object->getJavaCodebase());
$codebase->setRequired(false);
$form->addItem($codebase);
}
// Width
$width = new ilNumberInputGUI($this->lng->txt("width"), "java_width");
$width->setDecimals(0);
$width->setSize(6);
$width->setMinValue(50);
$width->setMaxLength(6);
$width->setValue($this->object->getJavaWidth());
$width->setRequired(TRUE);
$form->addItem($width);
// Height
$height = new ilNumberInputGUI($this->lng->txt("height"), "java_height");
$height->setDecimals(0);
$height->setSize(6);
$height->setMinValue(50);
$height->setMaxLength(6);
$height->setValue($this->object->getJavaHeight());
$height->setRequired(TRUE);
$form->addItem($height);
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("applet_parameters"));
$form->addItem($header);
include_once "./Modules/TestQuestionPool/classes/class.ilKVPWizardInputGUI.php";
$kvp = new ilKVPWizardInputGUI($this->lng->txt("applet_parameters"), "kvp");
$values = array();
for ($i = 0; $i < $this->object->getParameterCount(); $i++) {
$param = $this->object->getParameter($i);
array_push($values, array($param['name'], $param['value']));
}
if (count($values) == 0) {
array_push($values, array("", ""));
}
$kvp->setKeyName($this->lng->txt('name'));
$kvp->setValueName($this->lng->txt('value'));
$kvp->setValues($values);
$form->addItem($kvp);
$this->addQuestionFormCommandButtons($form);
$errors = false;
if ($save) {
$form->setValuesByPost();
$errors = !$form->checkInput();
$form->setValuesByPost();
//.........这里部分代码省略.........