本文整理汇总了PHP中ilYuiUtil类的典型用法代码示例。如果您正苦于以下问题:PHP ilYuiUtil类的具体用法?PHP ilYuiUtil怎么用?PHP ilYuiUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ilYuiUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
* @access public
*/
public function __construct(ilObjForumGUI $gui, ilForumTopic $topic, ilForumProperties $properties)
{
global $tpl, $ilCtrl;
$this->gui = $gui;
$this->topic = $topic;
$this->properties = $properties;
$this->tpl = new ilTemplate('tpl.frm_tree.html', true, true, 'Modules/Forum');
ilYuiUtil::initConnection();
$tpl->addJavaScript(ilYuiUtil::getLocalPath() . '/yahoo/yahoo-min.js');
$tpl->addJavaScript(ilYuiUtil::getLocalPath() . '/event/event-min.js');
$tpl->addJavaScript('./Modules/Forum/js/treeview.js');
$tpl->addJavaScript('./Modules/Forum/js/treeview_extensions.js');
$tpl->addCss('./Modules/Forum/css/forum_tree.css');
// Set ref_id for urls
$ilCtrl->setParameter($this->gui, 'thr_pk', $this->topic->getId());
$ilCtrl->setParameter($this->gui, 'backurl', null);
// Set urls for async commands
$this->tpl->setVariable('THR_TREE_STATE_URL', $ilCtrl->getLinkTarget($this->gui, 'setTreeStateAsynch', '', true, false));
$this->tpl->setVariable('THR_TREE_FETCH_CHILDREN_URL', $ilCtrl->getLinkTarget($this->gui, 'fetchTreeChildrenAsync', '', true, false));
// Fetch root id of the thread node
$this->root_id = $this->topic->getFirstPostNode()->getId();
if (!is_array($_SESSION['frm'][$this->topic->getId()]['openTreeNodes'])) {
$_SESSION['frm'][(int) $this->topic->getId()]['openTreeNodes'] = array(0);
}
// Prevent key gaps
shuffle($_SESSION['frm'][(int) $this->topic->getId()]['openTreeNodes']);
}
示例2: __construct
/**
* @param ilObjectGUI $a_parent_obj
* @param string $a_parent_cmd
*/
public function __construct(ilObjectGUI $a_parent_obj, $a_parent_cmd)
{
/**
* @var $ilCtrl ilCtrl
*/
global $ilCtrl;
$this->ctrl = $ilCtrl;
// Call this immediately in constructor
$this->setId('tos_agreement_by_lng');
$this->setDefaultOrderDirection('ASC');
$this->setDefaultOrderField('language');
$this->setExternalSorting(false);
$this->setExternalSegmentation(false);
parent::__construct($a_parent_obj, $a_parent_cmd);
$this->setTitle($this->lng->txt('tos_agreement_by_lng'));
$this->addColumn($this->lng->txt('language'), 'language');
$this->addColumn($this->lng->txt('tos_agreement'), 'agreement');
$this->addColumn($this->lng->txt('tos_agreement_document'), 'agreement_document');
$this->optionalColumns = (array) $this->getSelectableColumns();
$this->visibleOptionalColumns = (array) $this->getSelectedColumns();
foreach ($this->visibleOptionalColumns as $column) {
$this->addColumn($this->optionalColumns[$column]['txt'], $column);
}
$this->setFormAction($this->ctrl->getFormAction($a_parent_obj, 'applyAgreementByLanguageFilter'));
$this->setRowTemplate('tpl.tos_agreement_by_lng_table_row.html', 'Services/TermsOfService');
$this->setShowRowsSelector(true);
require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
require_once 'Services/YUI/classes/class.ilYuiUtil.php';
iljQueryUtil::initjQuery();
ilYuiUtil::initPanel();
ilYuiUtil::initOverlay();
$this->initFilter();
$this->setFilterCommand('applyAgreementByLanguageFilter');
$this->setResetCommand('resetAgreementByLanguageFilter');
}
示例3: __construct
public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
{
global $lng, $ilCtrl, $tpl;
parent::__construct($a_id, $a_id_type, $a_parent_node_id);
$lng->loadLanguageModule("dcl");
if (isset($_REQUEST['table_id'])) {
$this->table_id = $_REQUEST['table_id'];
} elseif ($a_id > 0) {
$this->table_id = $this->object->getMainTableId();
}
/**
* @var ilCtrl $ilCtrl
*/
if (!$ilCtrl->isAsynch()) {
ilYuiUtil::initConnection();
ilOverlayGUI::initJavascript();
$tpl->addJavaScript('Modules/DataCollection/js/ilDataCollection.js');
$tpl->addJavaScript("Modules/DataCollection/js/datacollection.js");
$this->tpl->addOnLoadCode("ilDataCollection.setEditUrl('" . $ilCtrl->getLinkTargetByClass(array('ilrepositorygui', 'ilobjdatacollectiongui', 'ildatacollectionrecordeditgui'), 'edit', '', true) . "');");
$this->tpl->addOnLoadCode("ilDataCollection.setCreateUrl('" . $ilCtrl->getLinkTargetByClass(array('ilrepositorygui', 'ilobjdatacollectiongui', 'ildatacollectionrecordeditgui'), 'create', '', true) . "');");
$this->tpl->addOnLoadCode("ilDataCollection.setSaveUrl('" . $ilCtrl->getLinkTargetByClass(array('ilrepositorygui', 'ilobjdatacollectiongui', 'ildatacollectionrecordeditgui'), 'save', '', true) . "');");
$this->tpl->addOnLoadCode("ilDataCollection.setDataUrl('" . $ilCtrl->getLinkTargetByClass(array('ilrepositorygui', 'ilobjdatacollectiongui', 'ildatacollectionrecordeditgui'), 'getRecordData', '', true) . "');");
}
$ilCtrl->saveParameter($this, "table_id");
}
示例4: ilBlockGUI
/**
* Constructor
*
* @param
*/
function ilBlockGUI()
{
global $ilUser, $tpl, $ilCtrl;
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initConnection();
$tpl->addJavaScript("./Services/Block/js/ilblockcallback.js");
$this->setLimit($ilUser->getPref("hits_per_page"));
}
示例5: executeCommand
/**
* execute command
*/
function executeCommand()
{
global $ilDB, $lng, $ilPluginAdmin, $ilTabs, $tree;
$ilTabs->clearTargets();
$this->ctrl->saveParameter($this, "sequence");
$this->ctrl->saveParameter($this, "active_id");
$this->initAssessmentSettings();
require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
$this->dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->object);
$this->dynamicQuestionSetConfig->loadFromDb();
$testSessionFactory = new ilTestSessionFactory($this->object);
$this->testSession = $testSessionFactory->getSession($_GET['active_id']);
$this->ensureExistingTestSession($this->testSession);
$this->initProcessLocker($this->testSession->getActiveId());
$testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object);
$this->testSequence = $testSequenceFactory->getSequenceByTestSession($this->testSession);
$this->testSequence->loadFromDb();
include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
iljQueryUtil::initjQuery();
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initConnectionWithAnimation();
if ($this->object->getKioskMode()) {
include_once 'Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php';
ilOverlayGUI::initJavascript();
}
$this->handlePasswordProtectionRedirect();
$cmd = $this->ctrl->getCmd();
$nextClass = $this->ctrl->getNextClass($this);
switch ($nextClass) {
case 'ilassquestionpagegui':
$questionId = $this->testSequence->getQuestionForSequence($this->calculateSequence());
require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
$page_gui = new ilAssQuestionPageGUI($questionId);
$ret = $this->ctrl->forwardCommand($page_gui);
break;
case 'ilassquestionhintrequestgui':
$questionGUI = $this->object->createQuestionGUI("", $this->testSequenceFactory->getSequenceByTestSession()->getQuestionForSequence($this->calculateSequence()));
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
$gui = new ilAssQuestionHintRequestGUI($this, self::CMD_SHOW_QUESTION, $this->testSession, $questionGUI);
$this->ctrl->forwardCommand($gui);
break;
case 'ildynamicquestionsetstatistictablegui':
$this->ctrl->forwardCommand($this->buildQuestionSetFilteredStatisticTableGUI());
break;
case 'iltestpasswordprotectiongui':
require_once 'Modules/Test/classes/class.ilTestPasswordProtectionGUI.php';
$gui = new ilTestPasswordProtectionGUI($this->ctrl, $this->tpl, $this->lng, $this, $this->passwordChecker);
$ret = $this->ctrl->forwardCommand($gui);
break;
default:
$cmd .= 'Cmd';
$ret =& $this->{$cmd}();
break;
}
return $ret;
}
示例6: getHTML
/**
* @return string
*/
public function getHTML()
{
ilYuiUtil::initJson();
$chatSetting = new ilSetting('chatroom');
if ($this->getCurrentDetailLevel() == 0 || !$chatSetting->get('chat_enabled', 0) || !(bool) @ilChatroomServerConnector::checkServerConnection()) {
return '';
} else {
return parent::getHTML();
}
}
示例7: initOverlay
protected function initOverlay()
{
include_once 'Services/YUI/classes/class.ilYuiUtil.php';
ilYuiUtil::initOverlay();
$this->tpl->addCss('Modules/TestQuestionPool/templates/default/lac_legend.css');
//$this->setAnchor('fixed_content', 'tr', 'tr');
// we use css instead, does not hoppel over screen for initially visible overlays
//$this->setTrigger('lac_legend_toggle_btn', 'click');
// is done by own listener that also changes the toggle label
$this->setVisible($this->isInitialVisibilityEnabled());
$this->setAutoHide(false);
$this->add();
}
示例8: __construct
/**
* Constructor
*
* @param
*/
function __construct()
{
global $lng, $tpl;
$this->maxdepth = -1;
$this->multi_commands = array();
$this->commands = array();
$this->drag_target[] = array();
$this->drag_content[] = array();
$lng->loadLanguageModule("form");
$this->setCheckboxName("cbox");
parent::ilFormGUI();
$this->help_items = array();
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initDragDrop();
$tpl->addJavascript("./Services/Form/js/ServiceFormHierarchyForm.js");
}
示例9: executeCommand
/**
* execute command
*/
function executeCommand()
{
global $ilDB, $lng, $ilPluginAdmin, $ilTabs, $tree;
$ilTabs->clearTargets();
$this->ctrl->saveParameter($this, "sequence");
$this->ctrl->saveParameter($this, "active_id");
require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
$this->dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->object);
$this->dynamicQuestionSetConfig->loadFromDb();
$testSessionFactory = new ilTestSessionFactory($this->object);
$this->testSession = $testSessionFactory->getSession($_GET['active_id']);
$testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object);
$this->testSequence = $testSequenceFactory->getSequence($this->testSession);
$this->testSequence->loadFromDb();
include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
iljQueryUtil::initjQuery();
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initConnectionWithAnimation();
if ($this->object->getKioskMode()) {
include_once 'Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php';
ilOverlayGUI::initJavascript();
}
$cmd = $this->ctrl->getCmd();
$nextClass = $this->ctrl->getNextClass($this);
switch ($nextClass) {
case 'ilassquestionhintrequestgui':
$questionGUI = $this->object->createQuestionGUI("", $this->testSequenceFactory->getSequence()->getQuestionForSequence($this->calculateSequence()));
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
$gui = new ilAssQuestionHintRequestGUI($this, $this->testSession, $questionGUI);
$this->ctrl->forwardCommand($gui);
break;
case 'ilfilteredquestionstablegui':
$this->ctrl->forwardCommand($this->buildFilteredQuestionsTableGUI());
break;
default:
$cmd .= 'Cmd';
$ret =& $this->{$cmd}();
break;
}
return $ret;
}
示例10: executeCommand
/**
* execute command
*/
function executeCommand()
{
global $ilUser;
$cmd = $this->ctrl->getCmd();
$next_class = $this->ctrl->getNextClass($this);
$this->ctrl->saveParameter($this, "sequence");
$this->ctrl->saveParameter($this, "active_id");
if (preg_match("/^gotoquestion_(\\d+)\$/", $cmd, $matches)) {
$cmd = "gotoquestion";
if (strlen($matches[1])) {
$this->ctrl->setParameter($this, 'gotosequence', $matches[1]);
}
}
if ($_GET["active_id"]) {
$this->object->setTestSession($_GET["active_id"]);
} else {
$this->object->setTestSession();
}
include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
iljQueryUtil::initjQuery();
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initConnectionWithAnimation();
$cmd = $this->getCommand($cmd);
switch ($next_class) {
case 'ilassquestionhintrequestgui':
$questionGUI = $this->object->createQuestionGUI("", $this->object->getTestSequence()->getQuestionForSequence($this->calculateSequence()));
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
$gui = new ilAssQuestionHintRequestGUI($this, $this->object->getTestSession(), $questionGUI);
$ret = $this->ctrl->forwardCommand($gui);
break;
default:
$ret =& $this->{$cmd}();
break;
}
return $ret;
}
示例11: getHtml
/**
* @return string
*/
public function getHtml()
{
/**
* @var $lng ilLanguage
* @var $tpl ilTemplate
*/
global $lng, $tpl;
if ($this->getSessionReminder()->isActive()) {
require_once 'Services/jQuery/classes/class.iljQueryUtil.php';
iljQueryUtil::initjQuery();
require_once 'Services/YUI/classes/class.ilYuiUtil.php';
ilYuiUtil::initCookie();
$tpl->addJavaScript('./Services/Authentication/js/session_reminder.js');
$reminder_tpl = new ilTemplate('tpl.session_reminder.html', true, true, 'Services/Authentication');
$reminder_tpl->setVariable('DEBUG', defined('DEVMODE') && DEVMODE ? 1 : 0);
$reminder_tpl->setVariable('CLIENT_ID', CLIENT_ID);
$reminder_tpl->setVariable('SESSION_NAME', session_name());
$reminder_tpl->setVariable('FREQUENCY', 60);
$reminder_tpl->setVariable('SESSION_ID', session_id());
$reminder_tpl->setVariable('URL', './sessioncheck.php?client_id=' . CLIENT_ID . '&lang=' . $lng->getLangKey());
return $reminder_tpl->get();
}
return '';
}
示例12: insert
/**
* Insert property html
*/
function insert(&$a_tpl)
{
global $lng;
$template = new ilTemplate("tpl.prop_flashfile.html", true, true, "Services/Form");
if ($this->getApplet() != "") {
$this->outputSuffixes($template);
if (count($this->getParameters())) {
$index = 0;
$params = array();
foreach ($this->getParameters() as $name => $value) {
array_push($params, urlencode($name) . "=" . urlencode($value));
$template->setCurrentBlock("applet_param_input");
$template->setVariable("TEXT_NAME", $lng->txt("name"));
$template->setVariable("TEXT_VALUE", $lng->txt("value"));
$template->setVariable("PARAM_INDEX", $index);
$template->setVariable("POST_VAR_P", $this->getPostVar());
$template->setVariable("VALUE_NAME", "value=\"" . ilUtil::prepareFormOutput($name) . "\"");
$template->setVariable("VALUE_VALUE", "value=\"" . ilUtil::prepareFormOutput($value) . "\"");
$template->setVariable("TEXT_DELETE_PARAM", $lng->txt("delete_parameter"));
$template->parseCurrentBlock();
$index++;
}
$template->setCurrentBlock("applet_parameter");
$template->setVariable("PARAM_VALUE", join($params, "&"));
$template->parseCurrentBlock();
$template->setCurrentBlock("flash_vars");
$template->setVariable("PARAM_VALUE", join($params, "&"));
$template->parseCurrentBlock();
}
$template->setCurrentBlock("applet");
$template->setVariable("TEXT_ADD_PARAM", $lng->txt("add_parameter"));
$template->setVariable("APPLET_WIDTH", $this->getWidth());
$template->setVariable("APPLET_HEIGHT", $this->getHeight());
$template->setVariable("POST_VAR_D", $this->getPostVar());
$template->setVariable("FILENAME", $this->getApplet());
$template->setVariable("TEXT_WIDTH", $lng->txt("width"));
$template->setVariable("TEXT_HEIGHT", $lng->txt("height"));
$template->setVariable("APPLET_FILE", $this->getApplet());
$template->setVariable("APPLET_PATH", $this->getAppletPathWeb() . $this->getApplet());
if ($this->getWidth()) {
$template->setVariable("VALUE_WIDTH", "value=\"" . $this->getWidth() . "\"");
}
if ($this->getHeight()) {
$template->setVariable("VALUE_HEIGHT", "value=\"" . $this->getHeight() . "\"");
}
$template->setVariable("ID", $this->getFieldId());
$template->setVariable("TXT_DELETE_EXISTING", $lng->txt("delete_existing_file"));
$template->parseCurrentBlock();
}
$js_tpl = new ilTemplate('tpl.flashAddParam.js', true, true, 'Services/Form');
$js_tpl->setVariable("TEXT_NAME", $lng->txt("name"));
$js_tpl->setVariable("TEXT_VALUE", $lng->txt("value"));
$js_tpl->setVariable("POST_VAR", $this->getPostVar());
$js_tpl->setVariable("TEXT_DELETE_PARAM", $lng->txt("delete_parameter"));
$js_tpl->setVariable("TEXT_CONFIRM_DELETE_PARAMETER", $lng->txt("confirm_delete_parameter"));
$template->setVariable("POST_VAR", $this->getPostVar());
$template->setVariable("ID", $this->getFieldId());
$template->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice") . " " . $this->getMaxFileSizeString());
$template->setVariable("JAVASCRIPT_FLASH", $js_tpl->get());
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $template->get());
$a_tpl->parseCurrentBlock();
global $tpl;
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initConnectionWithAnimation();
}
示例13: getInitHTML
/**
* Get initialisation HTML to use interna link editing
*/
function getInitHTML($a_url)
{
global $tpl;
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initPanel(false);
ilYuiUtil::initConnection();
ilYuiUtil::initDragDrop();
$tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
$tpl->addJavascript("./Services/Link/js/ilIntLink.js");
$ltpl = new ilTemplate("tpl.int_link_panel.html", true, true, "Services/Link");
$ltpl->setVariable("IL_INT_LINK_URL", $a_url);
return $ltpl->get();
}
示例14: getTestOutput
function getTestOutput($active_id, $pass = NULL, $is_postponed = FALSE, $use_post_solutions = FALSE, $show_feedback = FALSE)
{
// generate the question output
$template = new ilTemplate("tpl.il_as_qpl_orderinghorizontal_output.html", TRUE, TRUE, "Modules/TestQuestionPool");
$elements = $this->object->getRandomOrderingElements();
if ($active_id) {
$solutions = NULL;
include_once "./Modules/Test/classes/class.ilObjTest.php";
if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) {
if (is_null($pass)) {
$pass = ilObjTest::_getPass($active_id);
}
}
$solutions =& $this->object->getSolutionValues($active_id, $pass);
if (count($solutions) == 1) {
$elements = split("{::}", $solutions[0]["value1"]);
}
}
if (strlen($_SESSION['qst_selection'])) {
$this->object->moveRight($_SESSION['qst_selection'], $active_id, $pass);
unset($_SESSION['qst_selection']);
$solutions =& $this->object->getSolutionValues($active_id, $pass);
if (count($solutions) == 1) {
$elements = split("{::}", $solutions[0]["value1"]);
}
}
if (count($solutions) == 0) {
$_SESSION['qst_ordering_horizontal_elements'] = $elements;
} else {
unset($_SESSION['qst_ordering_horizontal_elements']);
}
$idx = 0;
foreach ($elements as $id => $element) {
$template->setCurrentBlock("element");
$template->setVariable("ELEMENT_ID", "e_" . $this->object->getId() . "_{$id}");
$template->setVariable("ELEMENT_VALUE", ilUtil::prepareFormOutput($element));
$this->ctrl->setParameterByClass('iltestoutputgui', 'qst_selection', $idx);
$idx++;
$url = $this->ctrl->getLinkTargetByClass('iltestoutputgui', 'gotoQuestion');
$template->setVariable("MOVE_RIGHT", $url);
$template->setVariable("TEXT_MOVE_RIGHT", $this->lng->txt('move_right'));
$template->setVariable("RIGHT_IMAGE", ilUtil::getImagePath('nav_arr_R.png'));
$template->parseCurrentBlock();
}
if ($this->object->textsize >= 10) {
echo $template->setVariable("STYLE", " style=\"font-size: " . $this->object->textsize . "%;\"");
}
$template->setVariable("VALUE_ORDERRESULT", ' value="' . join($elements, '{::}') . '"');
$template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE));
$questionoutput = $template->get();
if (!$show_question_only) {
// get page object output
$questionoutput = $this->getILIASPage($questionoutput);
}
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initDragDropAnimation();
$this->tpl->addJavascript("./Modules/TestQuestionPool/templates/default/orderinghorizontal.js");
$questionoutput = $template->get();
$pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
return $pageoutput;
}
示例15: addJavaScript
/**
* Add javascript files that are necessary to run accordion
*/
static function addJavaScript()
{
global $tpl;
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initEvent();
ilYuiUtil::initDom();
ilYuiUtil::initAnimation();
ilYuiUtil::initConnection();
$tpl->addJavaScript("./Services/Accordion/js/accordion.js", true, 3);
}