當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ilTemplate::setVAriable方法代碼示例

本文整理匯總了PHP中ilTemplate::setVAriable方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilTemplate::setVAriable方法的具體用法?PHP ilTemplate::setVAriable怎麽用?PHP ilTemplate::setVAriable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ilTemplate的用法示例。


在下文中一共展示了ilTemplate::setVAriable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 /**
  * Render html
  */
 function render($a_mode = "")
 {
     global $lng;
     $quota_exceeded = $quota_legend = false;
     if (self::$check_wsp_quota) {
         include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
         if (!ilDiskQuotaHandler::isUploadPossible()) {
             $lng->loadLanguageModule("file");
             $quota_exceeded = $lng->txt("personal_workspace_quota_exceeded_warning");
         } else {
             $quota_legend = ilDiskQuotaHandler::getStatusLegend();
         }
     }
     $f_tpl = new ilTemplate("tpl.prop_file.html", true, true, "Services/Form");
     // show filename selection if enabled
     if ($this->isFileNameSelectionEnabled()) {
         $f_tpl->setCurrentBlock('filename');
         $f_tpl->setVariable('POST_FILENAME', $this->getFileNamePostVar());
         $f_tpl->setVariable('VAL_FILENAME', $this->getFilename());
         $f_tpl->setVariable('FILENAME_ID', $this->getFieldId());
         $f_tpl->setVAriable('TXT_FILENAME_HINT', $lng->txt('if_no_title_then_filename'));
         $f_tpl->parseCurrentBlock();
     } else {
         if (trim($this->getValue() != "")) {
             if (!$this->getDisabled() && $this->getALlowDeletion()) {
                 $f_tpl->setCurrentBlock("delete_bl");
                 $f_tpl->setVariable("POST_VAR_D", $this->getPostVar());
                 $f_tpl->setVariable("TXT_DELETE_EXISTING", $lng->txt("delete_existing_file"));
                 $f_tpl->parseCurrentBlock();
             }
             $f_tpl->setCurrentBlock('prop_file_propval');
             $f_tpl->setVariable('FILE_VAL', $this->getValue());
             $f_tpl->parseCurrentBlock();
         }
     }
     if ($a_mode != "toolbar") {
         if (!$quota_exceeded) {
             $this->outputSuffixes($f_tpl);
             $f_tpl->setCurrentBlock("max_size");
             $f_tpl->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice") . " " . $this->getMaxFileSizeString());
             $f_tpl->parseCurrentBlock();
             if ($quota_legend) {
                 $f_tpl->setVariable("TXT_MAX_SIZE", $quota_legend);
                 $f_tpl->parseCurrentBlock();
             }
         } else {
             $f_tpl->setCurrentBlock("max_size");
             $f_tpl->setVariable("TXT_MAX_SIZE", $quota_exceeded);
             $f_tpl->parseCurrentBlock();
         }
     } else {
         if ($quota_exceeded) {
             return $quota_exceeded;
         }
     }
     $pending = $this->getPending();
     if ($pending) {
         $f_tpl->setCurrentBlock("pending");
         $f_tpl->setVariable("TXT_PENDING", $lng->txt("file_upload_pending") . ": " . $pending);
         $f_tpl->parseCurrentBlock();
     }
     if ($this->getDisabled() || $quota_exceeded) {
         $f_tpl->setVariable("DISABLED", " disabled=\"disabled\"");
     }
     $f_tpl->setVariable("POST_VAR", $this->getPostVar());
     $f_tpl->setVariable("ID", $this->getFieldId());
     $f_tpl->setVariable("SIZE", $this->getSize());
     return $f_tpl->get();
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:72,代碼來源:class.ilFileInputGUI.php

示例2: render

 /**
  * Render html
  */
 function render($a_mode = "")
 {
     global $lng;
     $f_tpl = new ilTemplate("tpl.prop_file.html", true, true, "Services/Form");
     // show filename selection if enabled
     if ($this->isFileNameSelectionEnabled()) {
         $f_tpl->setCurrentBlock('filename');
         $f_tpl->setVariable('POST_FILENAME', $this->getFileNamePostVar());
         $f_tpl->setVariable('VAL_FILENAME', $this->getFilename());
         $f_tpl->setVariable('FILENAME_ID', $this->getFieldId());
         $f_tpl->setVAriable('TXT_FILENAME_HINT', $lng->txt('if_no_title_then_filename'));
         $f_tpl->parseCurrentBlock();
     } else {
         if (trim($this->getValue() != "")) {
             if (!$this->getDisabled() && $this->getALlowDeletion()) {
                 $f_tpl->setCurrentBlock("delete_bl");
                 $f_tpl->setVariable("POST_VAR_D", $this->getPostVar());
                 $f_tpl->setVariable("TXT_DELETE_EXISTING", $lng->txt("delete_existing_file"));
                 $f_tpl->parseCurrentBlock();
             }
             $f_tpl->setCurrentBlock('prop_file_propval');
             $f_tpl->setVariable('FILE_VAL', $this->getValue());
             $f_tpl->parseCurrentBlock();
         }
     }
     if ($a_mode != "toolbar") {
         $this->outputSuffixes($f_tpl);
         $f_tpl->setCurrentBlock("max_size");
         $f_tpl->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice") . " " . $this->getMaxFileSizeString());
         $f_tpl->parseCurrentBlock();
     }
     $pending = $this->getPending();
     if ($pending) {
         $f_tpl->setCurrentBlock("pending");
         $f_tpl->setVariable("TXT_PENDING", $lng->txt("file_upload_pending") . ": " . $pending);
         $f_tpl->parseCurrentBlock();
     }
     $f_tpl->setVariable("POST_VAR", $this->getPostVar());
     $f_tpl->setVariable("ID", $this->getFieldId());
     $f_tpl->setVariable("SIZE", $this->getSize());
     return $f_tpl->get();
 }
開發者ID:khanhnnvn,項目名稱:ilias_E-learning,代碼行數:45,代碼來源:class.ilFileInputGUI.php


注:本文中的ilTemplate::setVAriable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。