当前位置: 首页>>代码示例>>PHP>>正文


PHP ilFileInputGUI::setSize方法代码示例

本文整理汇总了PHP中ilFileInputGUI::setSize方法的典型用法代码示例。如果您正苦于以下问题:PHP ilFileInputGUI::setSize方法的具体用法?PHP ilFileInputGUI::setSize怎么用?PHP ilFileInputGUI::setSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilFileInputGUI的用法示例。


在下文中一共展示了ilFileInputGUI::setSize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getFileLinkHTML

 /**
  * Get HTML for file link
  * @return	string		file link html
  */
 function getFileLinkHTML()
 {
     global $ilCtrl, $lng;
     if (!is_object($this->uploaded_file)) {
         $tpl = new ilTemplate("tpl.link_file.html", true, true, "Modules/LearningModule");
         $tpl->setCurrentBlock("form");
         $tpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this, "saveFileLink", "", true));
         $tpl->setVariable("TXT_SELECT_FILE", $lng->txt("cont_select_file"));
         $tpl->setVariable("TXT_SAVE_LINK", $lng->txt("cont_create_link"));
         $tpl->setVariable("CMD_SAVE_LINK", "saveFileLink");
         include_once "./Services/Form/classes/class.ilFileInputGUI.php";
         $fi = new ilFileInputGUI("", "link_file");
         $fi->setSize(15);
         $tpl->setVariable("INPUT", $fi->getToolbarHTML());
         $tpl->parseCurrentBlock();
         return $tpl->get();
     } else {
         $tpl = new ilTemplate("tpl.link_file.html", true, true, "Modules/LearningModule");
         $tpl->setCurrentBlock("link_js");
         //			$tpl->setVariable("LINK_FILE",
         //				$this->prepareJavascriptOutput("[iln dfile=\"".$this->uploaded_file->getId()."\"] [/iln]")
         //				);
         $tpl->setVariable("TAG_B", '[iln dfile=\\x22' . $this->uploaded_file->getId() . '\\x22]');
         $tpl->setVariable("TAG_E", "[/iln]");
         $tpl->setVariable("TXT_FILE", $this->uploaded_file->getTitle());
         //			$tpl->parseCurrentBlock();
         return $tpl->get();
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:33,代码来源:class.ilInternalLinkGUI.php

示例2: initSettingsForm

 /**
  * Init settings form.
  * This command uses the form class to display an input form.
  */
 protected function initSettingsForm()
 {
     $this->settingsForm = new ilPropertyFormGUI();
     // Title and description (Standard)
     $titleField = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $titleField->setMaxLength(128);
     $titleField->setRequired(true);
     $this->settingsForm->addItem($titleField);
     $descField = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     $descField->setCols(50);
     $descField->setRows(5);
     $this->settingsForm->addItem($descField);
     // Online flag
     $onlineField = new ilCheckboxInputGUI($this->lng->txt('online'), 'online');
     $this->settingsForm->addItem($onlineField);
     // Max booking time
     //		$maxtimeField = new ilRoomSharingTimeInputGUI($this->lng->txt('rep_robj_xrs_max_book_time'), 'max_book_time');
     //		$maxtimeField->setShowTime(true);
     //		$maxtimeField->setMinuteStepSize(5);
     //		$maxtimeField->setShowDate(false);
     //		$this->settingsForm->addItem($maxtimeField);
     require_once './Customizing/global/plugins/Services/Repository/RepositoryObject/RoomSharing/classes/utils/class.xrsTimeInputGUI.php';
     $xrsTimeInputGUI = new xrsTimeInputGUI($this->lng->txt('rep_robj_xrs_max_book_time'), 'max_book_time');
     $this->settingsForm->addItem($xrsTimeInputGUI);
     // Rooms agreement
     $roomsAgrField = new ilFileInputGUI($this->lng->txt('rep_robj_xrs_rooms_user_agreement'), "rooms_agreement");
     $roomsAgrField->setSize(50);
     $roomsAgrField->setRequired(false);
     $roomsAgrField->setInfo($this->lng->txt("rep_robj_xrs_room_agreement_filetypes") . " .bmp, .jpg, .jpeg, .png, .gif, .txt, .pdf");
     $this->settingsForm->addItem($roomsAgrField);
     $this->settingsForm->addCommandButton('updateSettings', $this->lng->txt('save'));
     $this->settingsForm->setTitle($this->lng->txt('edit_properties'));
     $this->settingsForm->setFormAction($this->ctrl->getFormAction($this));
 }
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:38,代码来源:class.ilObjRoomSharingGUI.php

示例3: initImportForm

 /**
  * Init import form.
  */
 public function initImportForm()
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
     $this->ctrl->setParameter($this, "new_type", $new_type);
     $form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
     $form->setTableWidth("600px");
     // import file
     $fi = new ilFileInputGUI($this->lng->txt("file"), "xmldoc");
     $fi->setSuffixes(array("zip"));
     $fi->setRequired(true);
     $fi->setSize(30);
     $form->addItem($fi);
     // validation
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_validate_file"), "validate");
     $cb->setInfo($this->lng->txt(""));
     $form->addItem($cb);
     $form->addCommandButton("importFile", $lng->txt("import"));
     $form->addCommandButton("cancel", $lng->txt("cancel"));
     $form->setTitle($this->lng->txt("import_" . $new_type));
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:28,代码来源:class.ilObjContentObjectGUI.php

示例4: listFiles

 /**
  * list files
  */
 function listFiles()
 {
     global $ilToolbar, $lng, $ilCtrl;
     // determine directory
     // FIXME: I have to call stripSlashes here twice, because I could not
     //        determine where the second layer of slashes is added to the
     //        URL Parameter
     $cur_subdir = ilUtil::stripSlashes(ilUtil::stripSlashes($_GET["cdir"]));
     $new_subdir = ilUtil::stripSlashes(ilUtil::stripSlashes($_GET["newdir"]));
     if ($new_subdir == "..") {
         $cur_subdir = substr($cur_subdir, 0, strrpos($cur_subdir, "/"));
     } else {
         if (!empty($new_subdir)) {
             if (!empty($cur_subdir)) {
                 $cur_subdir = $cur_subdir . "/" . $new_subdir;
             } else {
                 $cur_subdir = $new_subdir;
             }
         }
     }
     $cur_subdir = str_replace("..", "", $cur_subdir);
     $cur_dir = !empty($cur_subdir) ? $this->main_dir . "/" . $cur_subdir : $this->main_dir;
     $this->ctrl->setParameter($this, "cdir", $cur_subdir);
     // toolbar for adding files/directories
     $ilToolbar->setFormAction($ilCtrl->getFormAction($this), true);
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     if ($this->getAllowDirectories() && $this->getAllowDirectoryCreation()) {
         $ti = new ilTextInputGUI($this->lng->txt("cont_new_dir"), "new_dir");
         $ti->setMaxLength(80);
         $ti->setSize(10);
         $ilToolbar->addInputItem($ti, true);
         $ilToolbar->addFormButton($lng->txt("create"), "createDirectory");
         $ilToolbar->addSeparator();
     }
     include_once "./Services/Form/classes/class.ilFileInputGUI.php";
     if ($this->getAllowFileCreation()) {
         $fi = new ilFileInputGUI($this->lng->txt("cont_new_file"), "new_file");
         $fi->setSize(10);
         $ilToolbar->addInputItem($fi, true);
         $ilToolbar->addFormButton($lng->txt("upload"), "uploadFile");
     }
     include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
     if (ilUploadFiles::_getUploadDirectory()) {
         $ilToolbar->addSeparator();
         $files = ilUploadFiles::_getUploadFiles();
         $options[""] = $lng->txt("cont_select_from_upload_dir");
         foreach ($files as $file) {
             $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
             $options[$file] = $file;
         }
         include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
         $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
         $si->setOptions($options);
         $ilToolbar->addInputItem($si, true);
         $ilToolbar->addFormButton($lng->txt("copy"), "uploadFile");
     }
     // load files templates
     include_once "./Services/FileSystem/classes/class.ilFileSystemTableGUI.php";
     $fs_table = new ilFileSystemTableGUI($this, "listFiles", $cur_dir, $cur_subdir, $this->label_enable, $this->file_labels, $this->label_header, $this->commands, $this->getPostDirPath());
     $fs_table->setId($this->getTableId());
     if ($this->getTitle() != "") {
         $fs_table->setTitle($this->getTitle());
     }
     if ($_GET["resetoffset"] == 1) {
         $fs_table->resetOffset();
     }
     $this->tpl->setContent($fs_table->getHTML());
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:71,代码来源:class.ilFileSystemGUI.php

示例5: createFileInputFormItem

 /**
  * Creates an input field for the davinci text file upload
  *
  * @return \ilFileInputGUI file input form item
  */
 protected function createFileInputFormItem()
 {
     $file = new ilFileInputGUI($this->lng->txt("rep_robj_xrs_daVinci_import_file"), "upload_file");
     $file->setSize(50);
     $file->setRequired(true);
     $file->setALlowDeletion(true);
     $file->setSuffixes(array('txt'));
     return $file;
 }
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:14,代码来源:class.ilRoomSharingDaVinciImportGUI.php

示例6: 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();
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:32,代码来源:class.ilMailAttachmentGUI.php

示例7: createFileInputFormItem

 /**
  * Creates an input field for floor plans that should be uploaded.
  *
  * @return ilFileInputGUI file input form item
  */
 protected function createFileInputFormItem()
 {
     $file = new ilFileInputGUI($this->lng->txt("rep_robj_xrs_room_floor_plans"), "upload_file");
     $file->setSize(50);
     $file->setRequired(true);
     $file->setALlowDeletion(true);
     $file->setInfo($this->lng->txt("rep_robj_xrs_floor_plans_filetypes") . " .bmp, .jpg, .jpeg, .png, .gif");
     return $file;
 }
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:14,代码来源:class.ilRoomSharingFloorPlansGUI.php


注:本文中的ilFileInputGUI::setSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。