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


PHP ilTemplate::addJavaScript方法代碼示例

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


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

示例1: showUnitsOfCategory

 /**
  *
  */
 protected function showUnitsOfCategory()
 {
     /**
      * @var $ilToolbar ilToolbarGUI
      */
     global $ilToolbar;
     $category = $this->getCategoryById((int) $_GET['category_id'], false);
     $this->tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
     $this->tpl->addJavaScript("./Services/Form/js/Form.js");
     $this->lng->loadLanguageModule('form');
     require_once 'Modules/TestQuestionPool/classes/tables/class.ilUnitTableGUI.php';
     $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, $this->getUnitCategoryOverviewCommand()));
     if ($this->isCRUDContext()) {
         $ilToolbar->addButton($this->lng->txt('un_add_unit'), $this->ctrl->getLinkTarget($this, 'showUnitCreationForm'));
     }
     $table = new ilUnitTableGUI($this, 'showUnitsOfCategory', $category);
     $units = $this->repository->loadUnitsForCategory($category->getId());
     $data = array();
     foreach ($units as $unit) {
         /**
          * @var $unit assFormulaQuestionUnit
          */
         $data[] = array('unit_id' => $unit->getId(), 'unit' => $unit->getUnit(), 'baseunit' => $unit->getBaseunitTitle(), 'baseunit_id' => $unit->getBaseUnit(), 'factor' => $unit->getFactor(), 'sequence' => $unit->getSequence());
     }
     $table->setData($data);
     $this->tpl->setContent($table->getHTML());
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:30,代碼來源:class.ilUnitConfigurationGUI.php

示例2: __construct

 public function __construct()
 {
     global $tpl, $ilCtrl, $ilToolbar, $ilTabs, $lng, $ilAccess, $ilDB, $ilLocator;
     $this->ctrl = $ilCtrl;
     $this->tpl = $tpl;
     $this->toolbar = $ilToolbar;
     $this->tabs = $ilTabs;
     $this->ref_id = (int) $_GET['ref_id'];
     $this->crs = ilObjectFactory::getInstanceByRefId($this->ref_id);
     $this->definition = srCertificateDefinition::where(array('ref_id' => $this->ref_id))->first();
     $this->pl = ilCertificatePlugin::getInstance();
     $this->lng = $lng;
     $this->access = $ilAccess;
     $this->db = $ilDB;
     $this->ctrl->saveParameter($this, 'ref_id');
     $this->tpl->addJavaScript($this->pl->getStyleSheetLocation('uihk_certificate.js'));
     $this->lng->loadLanguageModule('common');
     $ilLocator->addRepositoryItems();
     $this->tpl->setVariable("LOCATOR", $ilLocator->getHTML());
 }
開發者ID:studer-raimann,項目名稱:Certificate,代碼行數:20,代碼來源:class.srCertificateDefinitionGUI.php

示例3: showFormCmd

 /**
  * command method that prints the question set config form
  * 
  * @param ilPropertyFormGUI $form
  */
 public function showFormCmd(ilPropertyFormGUI $form = null)
 {
     $this->questionSetConfig->loadFromDb();
     if ($this->questionSetConfig->areDepenciesBroken($this->tree)) {
         ilUtil::sendFailure($this->questionSetConfig->getDepenciesBrokenMessage($this->lng));
     } elseif ($this->questionSetConfig->areDepenciesInVulnerableState($this->tree)) {
         ilUtil::sendInfo($this->questionSetConfig->getDepenciesInVulnerableStateMessage($this->lng));
     }
     if ($form === null) {
         $form = $this->buildForm();
     }
     $this->tpl->setContent($this->ctrl->getHTML($form));
     $this->tpl->addJavaScript('Modules/Test/js/ilTestDynamicQuestionSetConfig.js');
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:19,代碼來源:class.ilObjTestDynamicQuestionSetConfigGUI.php

示例4: build

 public function build()
 {
     $this->setId('tst_results_toolbar');
     if ($this->isSkillResultButtonEnabled()) {
         require_once 'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php';
         $link = ilLinkButton::getInstance();
         // always returns a new instance
         $link->setUrl($this->ctrl->getLinkTargetByClass('ilTestSkillEvaluationGUI', ilTestSkillEvaluationGUI::CMD_SHOW));
         $link->setCaption($this->lng->txt("tst_show_comp_results"), false);
         $this->addButtonInstance($link);
         $this->addSeparator();
     }
     $this->addButton($this->lng->txt('print'), 'javascript:window.print();');
     if (strlen($this->getPdfExportLinkTarget())) {
         require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
         $link = ilLinkButton::getInstance();
         // always returns a new instance
         $link->setUrl($this->getPdfExportLinkTarget());
         $link->setCaption($this->getPdfExportLabel(), false);
         $link->setOmitPreventDoubleSubmission(true);
         $this->addButtonInstance($link);
     }
     if (strlen($this->getCertificateLinkTarget())) {
         $this->addButton($this->lng->txt('certificate'), $this->getCertificateLinkTarget());
     }
     if (strlen($this->getShowBestSolutionsLinkTarget())) {
         $this->addSeparator();
         $this->addButton($this->lng->txt('tst_btn_show_best_solutions'), $this->getShowBestSolutionsLinkTarget());
     } elseif (strlen($this->getHideBestSolutionsLinkTarget())) {
         $this->addSeparator();
         $this->addButton($this->lng->txt('tst_btn_hide_best_solutions'), $this->getHideBestSolutionsLinkTarget());
     }
     if (count($this->getParticipantSelectorOptions())) {
         $this->addSeparator();
         require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
         $sel = new ilSelectInputGUI('', 'active_id');
         $sel->setOptions($this->getParticipantSelectorOptionsWithHintOption());
         $this->addInputItem($sel);
         $link = ilLinkButton::getInstance();
         // always returns a new instance
         $link->setUrl('#');
         $link->setId('ilTestResultParticipantJumper');
         $link->setCaption($this->lng->txt('tst_res_jump_to_participant_btn'), false);
         $this->addButtonInstance($link);
         $this->tpl->addJavaScript('Modules/Test/js/ilTestResultParticipantSelector.js');
     }
 }
開發者ID:bheyser,項目名稱:qplskl,代碼行數:47,代碼來源:class.ilTestResultsToolbarGUI.php

示例5: __construct

 public function __construct()
 {
     global $tpl, $ilCtrl, $ilToolbar, $ilTabs, $lng, $ilAccess, $ilDB, $rbacreview, $ilUser;
     /** @var ilCtrl ctrl */
     $this->ctrl = $ilCtrl;
     $this->tpl = $tpl;
     $this->toolbar = $ilToolbar;
     $this->tabs = $ilTabs;
     $this->type = isset($_GET['type_id']) ? srCertificateType::find((int) $_GET['type_id']) : null;
     $this->pl = ilCertificatePlugin::getInstance();
     $this->lng = $lng;
     $this->access = $ilAccess;
     $this->db = $ilDB;
     $this->tpl->addJavaScript($this->pl->getStyleSheetLocation('uihk_certificate.js'));
     $this->lng->loadLanguageModule('common');
     $this->tpl->setTitleIcon(ilCertificatePlugin::getPluginIconImage());
     $this->rbac = $rbacreview;
     $this->user = $ilUser;
 }
開發者ID:studer-raimann,項目名稱:Certificate,代碼行數:19,代碼來源:class.srCertificateTypeGUI.php

示例6: addAvailabilityProperties

 /**
  * @param ilPropertyFormGUI $form
  */
 private function addAvailabilityProperties(ilPropertyFormGUI $form)
 {
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setChecked($this->testOBJ->isOnline());
     $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
     $form->addItem($online);
     $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'activation_type');
     $act_type->setChecked($this->testOBJ->isActivationLimited());
     // $act_type->setInfo($this->lng->txt('tst_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI($this->lng->txt("rep_time_period"), "access_period");
     $dur->setShowTime(true);
     $date = $this->testOBJ->getActivationStartingTime();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->testOBJ->getActivationEndingTime();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $act_type->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
     $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info'));
     $visible->setChecked($this->testOBJ->getActivationVisibility());
     $act_type->addSubItem($visible);
     $form->addItem($act_type);
 }
開發者ID:bheyser,項目名稱:qplskl,代碼行數:40,代碼來源:class.ilObjTestSettingsGeneralGUI.php

示例7: buildAdjustQuestionForm

 /**
  * @param $question_id
  * @param $question_pool_id
  *
  * @return ilPropertyFormGUI
  */
 protected function buildAdjustQuestionForm($question_id, $question_pool_id)
 {
     require_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     require_once './Modules/TestQuestionPool/classes/class.assQuestion.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setMultipart(FALSE);
     $form->setTableWidth("100%");
     $form->setId("adjustment");
     /** @var $question assQuestionGUI|ilGuiQuestionScoringAdjustable|ilGuiAnswerScoringAdjustable */
     $question = assQuestion::instantiateQuestionGUI($question_id);
     $form->setTitle($question->object->getTitle() . '<br /><small>(' . $question->outQuestionType() . ')</small>');
     $hidden_question_id = new ilHiddenInputGUI('q_id');
     $hidden_question_id->setValue($question_id);
     $form->addItem($hidden_question_id);
     $hidden_qpl_id = new ilHiddenInputGUI('qpl_id');
     $hidden_qpl_id->setValue($question_pool_id);
     $form->addItem($hidden_qpl_id);
     $this->populateScoringAdjustments($question, $form);
     $manscoring_section = new ilFormSectionHeaderGUI();
     $manscoring_section->setTitle($this->lng->txt('manscoring'));
     $form->addItem($manscoring_section);
     $manscoring_preservation = new ilCheckboxInputGUI($this->lng->txt('preserve_manscoring'), 'preserve_manscoring');
     $manscoring_preservation->setChecked(true);
     $manscoring_preservation->setInfo($this->lng->txt('preserve_manscoring_info'));
     $form->addItem($manscoring_preservation);
     $form->addCommandButton("savescoringfortest", $this->lng->txt("save"));
     $participants = $this->object->getParticipants();
     $active_ids = array_keys($participants);
     $results = array();
     foreach ($active_ids as $active_id) {
         $passes[] = $this->object->_getPass($active_id);
         foreach ($passes as $key => $pass) {
             for ($i = 0; $i <= $pass; $i++) {
                 $results[] = $question->object->getSolutionValues($active_id, $i);
             }
         }
     }
     $relevant_answers = array();
     foreach ($results as $result) {
         foreach ($result as $answer) {
             if ($answer['question_fi'] == $question->object->getId()) {
                 $relevant_answers[] = $answer;
             }
         }
     }
     $answers_view = $question->getAggregatedAnswersView($relevant_answers);
     include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
     iljQueryUtil::initjQuery();
     include_once 'Services/YUI/classes/class.ilYuiUtil.php';
     ilYuiUtil::initPanel();
     ilYuiUtil::initOverlay();
     $this->tpl->addJavascript('./Services/UIComponent/Overlay/js/ilOverlay.js');
     $this->tpl->addJavaScript("./Services/JavaScript/js/Basic.js");
     $container = new ilTemplate('tpl.il_as_tst_adjust_answer_aggregation_container.html', true, true, 'Modules/Test');
     $container->setVariable('FORM_ELEMENT_NAME', 'aggr_usr_answ');
     $container->setVariable('CLOSE_HTML', json_encode(ilGlyphGUI::get(ilGlyphGUI::CLOSE, $this->lng->txt('close'))));
     $container->setVariable('TXT_SHOW_ANSWER_OVERVIEW', $this->lng->txt('show_answer_overview'));
     $container->setVariable('TXT_CLOSE', $this->lng->txt('close'));
     $container->setVariable('ANSWER_OVERVIEW', $answers_view);
     $custom_input = new ilCustomInputGUI('', 'aggr_usr_answ');
     $custom_input->setHtml($container->get());
     $form->addItem($custom_input);
     return $form;
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:71,代碼來源:class.ilScoringAdjustmentGUI.php

示例8: buildForm

 private function buildForm()
 {
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
     $form->setTableWidth("100%");
     $form->setId("test_properties");
     if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) {
         // general properties
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("tst_general_properties"));
         $form->addItem($header);
     }
     // title & description (meta data)
     include_once 'Services/MetaData/classes/class.ilMD.php';
     $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
     $md_section = $md_obj->getGeneral();
     $title = new ilTextInputGUI($this->lng->txt("title"), "title");
     $title->setRequired(true);
     $title->setValue($md_section->getTitle());
     $form->addItem($title);
     $ids = $md_section->getDescriptionIds();
     if ($ids) {
         $desc_obj = $md_section->getDescription(array_pop($ids));
         $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
         $desc->setCols(50);
         $desc->setRows(4);
         $desc->setValue($desc_obj->getDescription());
         $form->addItem($desc);
     }
     // anonymity
     $anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
     if ($this->testOBJ->participantDataExist()) {
         $anonymity->setDisabled(true);
     }
     $rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
     $anonymity->addOption($rb);
     $rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
     $anonymity->addOption($rb);
     $anonymity->setValue((int) $this->testOBJ->getAnonymity());
     $form->addItem($anonymity);
     // test mode (question set type)
     $questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
     $questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc"));
     $questSetType->addOption($questSetTypeFixed);
     $questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc"));
     $questSetType->addOption($questSetTypeRandom);
     $questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc"));
     $questSetType->addOption($questSetTypeContinues);
     $questSetType->setValue($this->testOBJ->getQuestionSetType());
     if ($this->testOBJ->participantDataExist()) {
         $questSetType->setDisabled(true);
     }
     $form->addItem($questSetType);
     // pool usage
     $pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
     $pool_usage->setValue(1);
     $pool_usage->setChecked($this->testOBJ->getPoolUsage());
     $form->addItem($pool_usage);
     // enable_archiving
     $enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
     $enable_archiving->setValue(1);
     $enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
     $form->addItem($enable_archiving);
     // activation/availability  (no template support yet)
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setChecked($this->testOBJ->isOnline());
     $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
     $form->addItem($online);
     $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
     $act_type->setInfo($act_ref_info);
     $act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt->setInfo($this->lng->txt('tst_availability_limitless_info'));
     $act_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
     $opt->setInfo($this->lng->txt('tst_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI("", "access_period");
     $dur->setShowTime(true);
     $date = $this->testOBJ->getActivationStartingTime();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->testOBJ->getActivationEndingTime();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $opt->addSubItem($dur);
//.........這裏部分代碼省略.........
開發者ID:Walid-Synakene,項目名稱:ilias,代碼行數:101,代碼來源:class.ilObjTestSettingsGeneralGUI.php

示例9: ilTemplate

 /**
  * SCO preview
  */
 function sco_preview()
 {
     global $tpl, $ilCtrl, $lng;
     // init main template
     $tpl = new ilTemplate("tpl.main.html", true, true);
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     $tpl->setBodyClass("");
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->slm_object->getStyleSheetId()));
     $tpl->parseCurrentBlock();
     // get javascript
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery();
     iljQueryUtil::initjQueryUI();
     $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/pure.js");
     $tpl->addJavaScript("./Modules/Scorm2004/scripts/pager.js");
     $tpl->addOnLoadCode("pager.Init();");
     $tree = new ilTree($this->slm_object->getId());
     $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
     $tree->setTreeTablePK("slm_id");
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php";
     include_once "./Services/MetaData/classes/class.ilMD.php";
     $meta = new ilMD($this->node_object->getSLMId(), $this->node_object->getId(), $this->node_object->getType());
     $desc_ids = $meta->getGeneral()->getDescriptionIds();
     $sco_description = $meta->getGeneral()->getDescription($desc_ids[0])->getDescription();
     // get sco template
     $sco_tpl = new ilTemplate("tpl.sco.html", true, true, "Modules/Scorm2004");
     // navigation
     $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId());
     ilSCORM2004Asset::renderNavigation($sco_tpl, "", $lk);
     // meta page (description and objectives)
     ilSCORM2004Asset::renderMetaPage($sco_tpl, $this->node_object, $this->node_object->getType());
     // init export (this initialises glossary template)
     ilSCORM2004PageGUI::initExport();
     $terms = $this->node_object->getGlossaryTermIds();
     // render page
     foreach ($tree->getSubTree($tree->getNodeData($this->node_object->getId()), true, 'page') as $page) {
         $page_obj = new ilSCORM2004PageGUI($this->node_object->getType(), $page["obj_id"], 0, $this->slm_object->getId());
         $page_obj->setPresentationTitle($page["title"]);
         $page_obj->setOutputMode(IL_PAGE_PREVIEW);
         $page_obj->setStyleId($this->slm_object->getStyleSheetId());
         if (count($terms) > 1) {
             $page_obj->setGlossaryOverviewInfo(ilSCORM2004ScoGUI::getGlossaryOverviewId(), $this->node_object);
         }
         $sco_tpl->setCurrentBlock("page_preview");
         $html = $ilCtrl->getHTML($page_obj);
         //$sco_tpl->setVariable("PAGE_PRV", $page_obj->showPage("export"));
         $sco_tpl->setVariable("PAGE_PRV", $html);
         $sco_tpl->parseCurrentBlock();
     }
     $output = $sco_tpl->get();
     // append glossary entries on the sco level
     $output .= ilSCORM2004PageGUI::getGlossaryHTML($this->node_object);
     //insert questions
     require_once './Modules/Scorm2004/classes/class.ilQuestionExporter.php';
     $output = preg_replace_callback("/{{{{{(Question;)(il__qst_[0-9]+)}}}}}/", array(get_class($this), 'insertQuestion'), $output);
     //		$output = preg_replace("/&#123;/","",$output);
     //		$output = preg_replace("/&#125;/","",$output);
     $output = "<script>var ScormApi=null;" . ilQuestionExporter::questionsJS() . "</script>" . $output;
     $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId());
     //		include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php");
     //		ilSCORM2004PageGUI::addPreparationJavascript($tpl, $lk);
     $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/question_handling.js");
     $tpl->addCss("./Modules/Scorm2004/templates/default/question_handling.css");
     include_once "./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
     ilOverlayGUI::initJavascript();
     //inline JS
     $output .= '<script type="text/javascript" src="./Modules/Scorm2004/scripts/questions/question_handling.js"></script>';
     $tpl->setVariable("CONTENT", $output);
 }
開發者ID:bheyser,項目名稱:qplskl,代碼行數:74,代碼來源:class.ilSCORM2004ScoGUI.php

示例10: ilTemplate

 */
global $ilIliasIniFile, $ilUser;
$tpl = new ilTemplate(dirname(__FILE__) . '/tpl.latex.html', true, true);
$tpl->resetJavascript();
require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
$jquery_path = iljQueryUtil::getLocaljQueryPath();
if (strpos($jquery_path, './') === 0) {
    $jquery_path = substr($jquery_path, 2);
} else {
    if (strpos($jquery_path, '.') === 0) {
        $jquery_path = substr($jquery_path, 1);
    }
}
$mathJaxSetting = new ilSetting('MathJax');
if ($mathJaxSetting->get('enable')) {
    $tpl->addJavaScript($mathJaxSetting->get('path_to_mathjax'));
    $tpl->setCurrentBlock('js_on_change_math_jax');
    $tpl->touchBlock('js_on_change_math_jax');
    $tpl->parseCurrentBlock();
    $tpl->setCurrentBlock('delimiter_latex');
    $tpl->setVariable('DELIMITER', (int) $mathJaxSetting->get('limiter'));
    $tpl->parseCurrentBlock();
} else {
    if (strlen($ilIliasIniFile->readVariable('tools', 'latex'))) {
        $tpl->setCurrentBlock('js_on_change_latex');
        $tpl->setVariable('LATEX_URL', $ilIliasIniFile->readVariable('tools', 'latex'));
        $tpl->parseCurrentBlock();
    }
}
$tpl->addJavaScript(str_repeat('../', $steps) . $jquery_path, true, 1);
$tpl->fillJavaScriptFiles(true);
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:31,代碼來源:latex.php


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