本文整理汇总了PHP中ilYuiUtil::initConnection方法的典型用法代码示例。如果您正苦于以下问题:PHP ilYuiUtil::initConnection方法的具体用法?PHP ilYuiUtil::initConnection怎么用?PHP ilYuiUtil::initConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilYuiUtil
的用法示例。
在下文中一共展示了ilYuiUtil::initConnection方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
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");
}
示例3: 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"));
}
示例4: 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();
}
示例5: 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);
}
示例6: getOutput
/**
* Creates output
* recursive method
* @access public
* @return string
*/
function getOutput()
{
global $ilBench, $tpl, $lng;
$ilBench->start("Explorer", "getOutput");
$this->format_options[0]["tab"] = array();
$depth = $this->getMaximumTreeDepth();
for ($i = 0; $i < $depth; ++$i) {
$this->createLines($i);
}
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initConnection();
$tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
$tpl->addBlockFile("EXPLORER_TOP", "exp_top", "tpl.explorer_top.html");
//echo "hh";
// set global body class
// $tpl->setBodyClass("il_Explorer");
$tpl_tree = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
// updater
if (($_GET["ict"] || $_POST["collapseAll"] != "" || $_POST["expandAll"] != "") && $this->up_frame != "") {
$tpl_tree->setCurrentBlock("updater");
$tpl_tree->setVariable("UPDATE_FRAME", $this->up_frame);
$tpl_tree->setVariable("UPDATE_SCRIPT", $this->up_script);
if (is_array($this->up_params)) {
$up_str = $lim = "";
foreach ($this->up_params as $p) {
$up_str .= $lim . "'" . $p . "'";
$lim = ",";
}
$tpl_tree->setVariable("UPDATE_PARAMS", $up_str);
}
$tpl_tree->parseCurrentBlock();
}
$cur_depth = -1;
foreach ($this->format_options as $key => $options) {
//echo "-".$options["depth"]."-";
if (!$options["visible"]) {
continue;
}
// end tags
$this->handleListEndTags($tpl_tree, $cur_depth, $options["depth"]);
// start tags
$this->handleListStartTags($tpl_tree, $cur_depth, $options["depth"]);
$cur_depth = $options["depth"];
if ($options["visible"] and $key != 0) {
$this->formatObject($tpl_tree, $options["child"], $options, $options['obj_id']);
}
if ($key == 0) {
$this->formatHeader($tpl_tree, $options["child"], $options);
}
}
//if ($GLOBALS["ilUser"]->getLogin() == "alex") var_dump($this->format_options);
$this->handleListEndTags($tpl_tree, $cur_depth, -1);
$ilBench->stop("Explorer", "getOutput");
$tpl_tree->setVariable("TREE_LEAD", "");
if ($this->tree_lead != "") {
$tpl_tree->setCurrentBlock("tree_lead");
$tpl_tree->setVariable("TREE_LEAD", $this->tree_lead);
$tpl_tree->parseCurrentBlock();
}
if ($this->getId() != "") {
$tpl_tree->setVariable("TREE_ID", 'id="' . $this->getId() . '_tree"');
}
$html = $tpl_tree->get();
if ($this->getUseStandardFrame()) {
$mtpl = new ilTemplate("tpl.main.html", true, true);
$mtpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
$mtpl->setVariable("BODY_CLASS", "il_Explorer");
$mtpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
if ($this->getTitle() != "") {
$mtpl->setVariable("TXT_EXPLORER_HEADER", $this->getTitle());
}
if ($this->getId() != "") {
$mtpl->setVariable("ID", 'id="' . $this->getId() . '"');
}
$mtpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false));
$mtpl->setCurrentBlock("content");
$mtpl->setVariable("EXPLORER", $html);
$mtpl->setVariable("EXP_REFRESH", $lng->txt("refresh"));
$mtpl->parseCurrentBlock();
$html = $mtpl->get();
}
return $html;
}
示例7: showPage
/**
* display content of page
*/
function showPage()
{
global $tree, $ilUser, $lng, $ilCtrl, $ilSetting, $ilTabs;
// jquery and jquery ui are always provided for components
include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
iljQueryUtil::initjQuery();
iljQueryUtil::initjQueryUI();
// $this->initSelfAssessmentRendering();
include_once "./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php";
ilObjMediaObjectGUI::includePresentationJS($GLOBALS["tpl"]);
$GLOBALS["tpl"]->addJavaScript("./Services/COPage/js/ilCOPagePres.js");
// needed for overlays in iim
include_once "./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
ilOverlayGUI::initJavascript();
include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php";
ilPlayerUtil::initMediaElementJs($GLOBALS["tpl"]);
// init template
//if($this->outputToTemplate())
//{
if ($this->getOutputMode() == "edit") {
//echo ":".$this->getTemplateTargetVar().":";
$tpl = new ilTemplate("tpl.page_edit_wysiwyg.html", true, true, "Services/COPage");
//$this->tpl->addBlockFile($this->getTemplateTargetVar(), "adm_content", "tpl.page_edit_wysiwyg.html", "Services/COPage");
// to do: status dependent class
$tpl->setVariable("CLASS_PAGE_TD", "ilc_Page");
// user comment
if ($this->isEnabledChangeComments()) {
$tpl->setCurrentBlock("change_comment");
$tpl->setVariable("TXT_ADD_COMMENT", $this->lng->txt("cont_add_change_comment"));
$tpl->parseCurrentBlock();
}
$tpl->setVariable("WYSIWYG_ACTION", $ilCtrl->getFormActionByClass("ilpageeditorgui", "", "", true));
// determine media, html and javascript mode
$sel_media_mode = $ilUser->getPref("ilPageEditor_MediaMode") == "disable" ? "disable" : "enable";
$sel_html_mode = $ilUser->getPref("ilPageEditor_HTMLMode") == "disable" ? "disable" : "enable";
$sel_js_mode = "disable";
//if($ilSetting->get("enable_js_edit", 1))
//{
$sel_js_mode = ilPageEditorGUI::_doJSEditing() ? "enable" : "disable";
//}
// show prepending html
$tpl->setVariable("PREPENDING_HTML", $this->getPrependingHtml());
$tpl->setVariable("TXT_CONFIRM_DELETE", $lng->txt("cont_confirm_delete"));
// presentation view
if ($this->getViewPageLink() != "") {
$ilTabs->addNonTabbedLink("pres_view", $this->lng->txt("cont_presentation_view"), $this->getViewPageLink(), $this->getViewPageTarget());
}
// show actions drop down
$this->addActionsMenu($tpl, $sel_media_mode, $sel_html_mode, $sel_js_mode);
// get js files for JS enabled editing
if ($sel_js_mode == "enable") {
$this->insertHelp($tpl);
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initDragDrop();
ilYuiUtil::initConnection();
ilYuiUtil::initPanel(false);
$GLOBALS["tpl"]->addJavaScript("./Services/COPage/js/ilcopagecallback.js");
$GLOBALS["tpl"]->addJavascript("Services/COPage/js/page_editing.js");
include_once './Services/Style/classes/class.ilObjStyleSheet.php';
$GLOBALS["tpl"]->addOnloadCode("var preloader = new Image();\n\t\t\t\t\t\tpreloader.src = './templates/default/images/loader.svg';\n\t\t\t\t\t\tilCOPage.setContentCss('" . ilObjStyleSheet::getContentStylePath((int) $this->getStyleId()) . ", " . ilUtil::getStyleSheetLocation() . ", ./Services/COPage/css/tiny_extra.css" . "')");
//$GLOBALS["tpl"]->addJavascript("Services/RTE/tiny_mce_3_3_9_2/il_tiny_mce_src.js");
$GLOBALS["tpl"]->addJavascript("Services/COPage/tiny/4_1_5/tinymce.js");
$tpl->touchBlock("init_dragging");
$cfg = $this->getPageConfig();
$tpl->setVariable("IL_TINY_MENU", self::getTinyMenu($this->getPageObject()->getParentType(), $cfg->getEnableInternalLinks(), $cfg->getEnableWikiLinks(), $cfg->getEnableKeywords(), $this->getStyleId(), true, true, $cfg->getEnableAnchors()));
// add int link parts
include_once "./Services/Link/classes/class.ilInternalLinkGUI.php";
$tpl->setCurrentBlock("int_link_prep");
$tpl->setVariable("INT_LINK_PREP", ilInternalLinkGUI::getInitHTML($ilCtrl->getLinkTargetByClass(array("ilpageeditorgui", "ilinternallinkgui"), "", false, true, false)));
$tpl->parseCurrentBlock();
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initConnection();
$GLOBALS["tpl"]->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
}
// multiple actions
$cnt_pcs = $this->getPageObject()->countPageContents();
if ($cnt_pcs > 1 || $this->getPageObject()->getParentType() != "qpl" && $cnt_pcs > 0) {
$tpl->setCurrentBlock("multi_actions");
if ($sel_js_mode == "enable") {
$tpl->setVariable("ONCLICK_DE_ACTIVATE_SELECTED", 'onclick="return ilEditMultiAction(\'activateSelected\');"');
$tpl->setVariable("ONCLICK_DELETE_SELECTED", 'onclick="return ilEditMultiAction(\'deleteSelected\');"');
$tpl->setVariable("ONCLICK_ASSIGN_CHARACTERISTIC", 'onclick="return ilEditMultiAction(\'assignCharacteristicForm\');"');
$tpl->setVariable("ONCLICK_COPY_SELECTED", 'onclick="return ilEditMultiAction(\'copySelected\');"');
$tpl->setVariable("ONCLICK_CUT_SELECTED", 'onclick="return ilEditMultiAction(\'cutSelected\');"');
$tpl->setVariable("TXT_SELECT_ALL", $this->lng->txt("select_all"));
$tpl->setVariable("ONCLICK_SELECT_ALL", 'onclick="return ilEditMultiAction(\'selectAll\');"');
}
$tpl->setVariable("TXT_DE_ACTIVATE_SELECTED", $this->lng->txt("cont_ed_enable"));
$tpl->setVariable("TXT_ASSIGN_CHARACTERISTIC", $this->lng->txt("cont_assign_characteristic"));
$tpl->setVariable("TXT_DELETE_SELECTED", $this->lng->txt("cont_delete_selected"));
$tpl->setVariable("TXT_COPY_SELECTED", $this->lng->txt("copy"));
$tpl->setVariable("TXT_CUT_SELECTED", $this->lng->txt("cut"));
$tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
$tpl->parseCurrentBlock();
}
} else {
// presentation or preview here
//.........这里部分代码省略.........
示例8: initGUI
public function initGUI(ilObjCloudGUI $gui_class, $perm_create_folder, $perm_upload_items, $perm_delete_files, $perm_delete_folders, $perm_download, $perm_files_visible, $perm_folders_visible)
{
global $ilTabs, $lng, $tpl;
$ilTabs->activateTab("content");
$this->setGuiClass($gui_class);
$this->setPermUploadItems($perm_upload_items);
$this->setPermCreateFolders($perm_create_folder);
$this->setPermDeleteFiles($perm_delete_files);
$this->setPermDeleteFolders($perm_delete_folders);
$this->setPermDownload($perm_download);
$this->setPermFilesVisible($perm_files_visible);
$this->setPermFoldersVisible($perm_folders_visible);
try {
ilCloudConnector::checkServiceActive($this->getGUIClass()->object->getServiceName());
$this->beforeInitGUI();
$tpl->addJavaScript("./Modules/Cloud/js/ilCloudFileList.js");
$tpl->addJavaScript("./Modules/Cloud/js/jquery.address.js");
$tpl->addJavascript("./Services/UIComponent/AdvancedSelectionList/js/AdvancedSelectionList.js");
$tpl->addCss("./Modules/Cloud/templates/css/cloud.css");
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initConnection();
$this->tpl_file_tree = new ilTemplate("tpl.cloud_file_tree.html", true, true, "Modules/Cloud");
$file_tree = new ilCloudFileTree($this->getGUIClass()->object->getRootFolder(), $this->getGUIClass()->object->getRootId(), $this->getGUIClass()->object->getId(), $this->getGUIClass()->object->getServiceName());
$file_tree->storeFileTreeToSession();
$this->addToolbar($file_tree->getRootNode());
$this->tpl_file_tree->setVariable("ASYNC_GET_BLOCK", json_encode($this->getGUIClass()->ctrl->getLinkTargetByClass("ilobjcloudgui", "asyncGetBlock", true)));
$this->tpl_file_tree->setVariable("ASYNC_CREATE_FOLDER", json_encode($this->getGUIClass()->ctrl->getLinkTargetByClass("ilcloudplugincreatefoldergui", "asyncCreateFolder", true)));
$this->tpl_file_tree->setVariable("ASYNC_UPLOAD_FILE", json_encode($this->getGUIClass()->ctrl->getLinkTargetByClass("ilcloudpluginuploadgui", "asyncUploadFile", true)));
$this->tpl_file_tree->setVariable("ASYNC_DELETE_ITEM", json_encode($this->getGUIClass()->ctrl->getLinkTargetByClass("ilcloudplugindeletegui", "asyncDeleteItem", true)));
$this->tpl_file_tree->setVariable("ROOT_ID", json_encode($file_tree->getRootNode()->getId()));
$this->tpl_file_tree->setVariable("ROOT_PATH", json_encode($file_tree->getRootNode()->getPath()));
if (isset($_POST["path"])) {
$this->tpl_file_tree->setVariable("CURRENT_PATH", json_encode($_POST["path"]));
$file_tree->updateFileTree($_POST["path"]);
$node = $file_tree->getNodeFromPath($_POST["path"]);
$this->tpl_file_tree->setVariable("CURRENT_ID", json_encode($node->getId()));
} else {
$this->tpl_file_tree->setVariable("CURRENT_PATH", json_encode($file_tree->getRootNode()->getPath()));
$this->tpl_file_tree->setVariable("CURRENT_ID", json_encode($file_tree->getRootNode()->getID()));
}
$txt_max_file_size = $lng->txt("file_notice") . " " . ilCloudConnector::getPluginClass($this->getGUIClass()->object->getServiceName(), $this->getGUIClass()->object->getId())->getMaxFileSize() . " MB";
$this->tpl_file_tree->setVariable("MAX_FILE_SIZE", json_encode($txt_max_file_size));
$this->beforeSetContent();
$tpl->setContent($this->tpl_file_tree->get());
$tpl->setPermanentLink("cld", $this->getGuiClass()->object->getRefId(), "_path__endPath");
/**
else
{
$file_tree = ilCloudFileTree::getFileTreeFromSession();
if($_GET["current_path"] && $_GET["current_id"] && $file_tree && $file_tree->getId() == $this->getGUIClass()->object->getId())
{
$path = $_GET["current_path"];
$id = $_GET["current_id"];
}
else
{
$path = $gui_class->object->getRootFolder();
$id = $gui_class->object->getRootId();
ilCloudFileTree::clearFileTreeSession();
$file_tree = new ilCloudFileTree($this->getGUIClass()->object->getRootFolder(), $this->getGUIClass()->object->getRootId(), $this->getGUIClass()->object->getId(), $this->getGUIClass()->object->getServiceName());
}
$file_tree->updateFileTree($path);
$file_tree_gui = ilCloudConnector::getFileTreeGUIClass($this->getService(), $file_tree);
$this->content = $file_tree_gui->getFolderHtml($this->getGuiClass(), $id, $this->getPermDeleteFiles(), $this->getPermDeleteFolders(), $this->getPermDownload(), $this->getPermFilesVisible(), $this->getPermCreateFolders());
$tpl->setContent($this->content);
}**/
$this->afterInitGUI();
} catch (Exception $e) {
if ($e->getCode() == ilCloudException::AUTHENTIFICATION_FAILED) {
$this->getGUIClass()->object->setAuthComplete(false);
$this->getGUIClass()->object->doUpdate();
}
ilUtil::sendFailure($e->getMessage());
}
}
示例9: renderFilter
/**
* Render Filter section
*/
private function renderFilter()
{
global $lng, $tpl;
$filter = $this->getFilterItems();
$opt_filter = $this->getFilterItems(true);
$tpl->addJavascript("./Services/Table/js/ServiceTable.js");
if (count($filter) == 0 && count($opt_filter) == 0) {
return;
}
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initConnection();
$ccnt = 0;
// render standard filter
if (count($filter) > 0) {
foreach ($filter as $item) {
if ($ccnt >= $this->getFilterCols()) {
$this->tpl->setCurrentBlock("filter_row");
$this->tpl->parseCurrentBlock();
$ccnt = 0;
}
$this->tpl->setCurrentBlock("filter_item");
$this->tpl->setVariable("OPTION_NAME", $item->getTitle());
$this->tpl->setVariable("F_INPUT_ID", $item->getFieldId());
$this->tpl->setVariable("INPUT_HTML", $item->getTableFilterHTML());
$this->tpl->parseCurrentBlock();
$ccnt++;
}
}
// render optional filter
if (count($opt_filter) > 0) {
$this->determineSelectedFilters();
foreach ($opt_filter as $item) {
if ($this->isFilterSelected($item->getPostVar())) {
if ($ccnt >= $this->getFilterCols()) {
$this->tpl->setCurrentBlock("filter_row");
$this->tpl->parseCurrentBlock();
$ccnt = 0;
}
$this->tpl->setCurrentBlock("filter_item");
$this->tpl->setVariable("OPTION_NAME", $item->getTitle());
$this->tpl->setVariable("F_INPUT_ID", $item->getFieldId());
$this->tpl->setVariable("INPUT_HTML", $item->getTableFilterHTML());
$this->tpl->parseCurrentBlock();
$ccnt++;
}
}
// filter selection
$items = array();
foreach ($opt_filter as $item) {
$k = $item->getPostVar();
$items[$k] = array("txt" => $item->getTitle(), "selected" => $this->isFilterSelected($k));
}
include_once "./Services/UIComponent/CheckboxListOverlay/classes/class.ilCheckboxListOverlayGUI.php";
$cb_over = new ilCheckboxListOverlayGUI("tbl_filters_" . $this->getId());
$cb_over->setLinkTitle($lng->txt("optional_filters"));
$cb_over->setItems($items);
$cb_over->setFormCmd($this->getParentCmd());
$cb_over->setFieldVar("tblff" . $this->getId());
$cb_over->setHiddenVar("tblfsf" . $this->getId());
$cb_over->setSelectionHeaderClass("ilTableMenuItem");
$this->tpl->setCurrentBlock("filter_select");
// apply should be the first submit because of enter/return, inserting hidden submit
$this->tpl->setVariable("HIDDEN_CMD_APPLY", $this->filter_cmd);
$this->tpl->setVariable("FILTER_SELECTOR", $cb_over->getHTML());
$this->tpl->parseCurrentBlock();
}
// if any filter
if ($ccnt > 0 || count($opt_filter) > 0) {
$this->tpl->setVariable("TXT_FILTER", $lng->txt("filter"));
if ($ccnt > 0) {
if ($ccnt < $this->getFilterCols()) {
for ($i = $ccnt; $i <= $this->getFilterCols(); $i++) {
$this->tpl->touchBlock("filter_empty_cell");
}
}
$this->tpl->setCurrentBlock("filter_row");
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("filter_buttons");
$this->tpl->setVariable("CMD_APPLY", $this->filter_cmd);
$this->tpl->setVariable("TXT_APPLY", $lng->txt("apply_filter"));
$this->tpl->setVariable("CMD_RESET", $this->reset_cmd);
$this->tpl->setVariable("TXT_RESET", $lng->txt("reset_filter"));
} else {
if (count($opt_filter) > 0) {
$this->tpl->setCurrentBlock("optional_filter_hint");
$this->tpl->setVariable('TXT_OPT_HINT', $lng->txt('optional_filter_hint'));
$this->tpl->parseCurrentBlock();
}
}
$this->tpl->setCurrentBlock("filter_section");
$this->tpl->setVariable("FIL_ID", $this->getId());
$this->tpl->parseCurrentBlock();
// (keep) filter hidden?
if ($this->loadProperty("filter") != 1) {
if (!$this->getDisableFilterHiding()) {
$this->tpl->setCurrentBlock("filter_hidden");
$this->tpl->setVariable("FI_ID", $this->getId());
//.........这里部分代码省略.........
示例10: setAsynch
/**
* Set asynch mode (this is set to true, if list should get items asynchronously)
*
* @param boolean turn asynch mode on/off
*/
function setAsynch($a_val)
{
if ($a_val) {
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initConnection();
}
$this->asynch = $a_val;
}
示例11: getInitHTML
/**
* Get initialisation HTML to use interna link editing
*/
function getInitHTML($a_url, $a_move_to_body = false)
{
global $tpl, $lng;
$lng->loadLanguageModule("link");
$tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
include_once "./Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php";
ilExplorerBaseGUI::init();
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initConnection();
$tpl->addJavascript("./Services/Link/js/ilIntLink.js");
include_once "./Services/UIComponent/Modal/classes/class.ilModalGUI.php";
$modal = ilModalGUI::getInstance();
$modal->setHeading($lng->txt("link_link"));
$modal->setId("ilIntLinkModal");
$modal->setBody("<div id='ilIntLinkModalContent'></div>");
$ltpl = new ilTemplate("tpl.int_link_panel.html", true, true, "Services/Link");
$ltpl->setVariable("MODAL", $modal->getHTML());
$ltpl->setVariable("IL_INT_LINK_URL", $a_url);
return $ltpl->get();
}
示例12: editData
//.........这里部分代码省略.........
$dtpl->setVariable("COL_ICON", ilUtil::getImagePath("col.png"));
$dtpl->setVariable("COL_ONCLICK", "COL_" . $move_type);
$dtpl->setVariable("NR", $j);
$dtpl->parseCurrentBlock();
}
$dtpl->setCurrentBlock("row");
$dtpl->parseCurrentBlock();
}
for ($j = 0; $j < count($res2->nodeset); $j++) {
// first col: row icons
if ($j == 0) {
if ($i == 0) {
if (count($res->nodeset) == 1) {
$move_type = "none";
} else {
$move_type = "forward";
}
} else {
if ($i == count($res->nodeset) - 1) {
$move_type = "backward";
} else {
$move_type = "both";
}
}
$dtpl->setCurrentBlock("row_icon");
$dtpl->setVariable("ROW_ICON_ALT", $lng->txt("content_row"));
$dtpl->setVariable("ROW_ICON", ilUtil::getImagePath("row.png"));
$dtpl->setVariable("ROW_ONCLICK", "ROW_" . $move_type);
$dtpl->setVariable("NR", $i);
$dtpl->parseCurrentBlock();
}
// cell
if ($res2->nodeset[$j]->get_attribute("Hidden") != "Y") {
$dtpl->setCurrentBlock("cell");
if (is_array($_POST["cmd"]) && key($_POST["cmd"]) == "update") {
$s_text = ilUtil::stripSlashes("cell_" . $i . "_" . $j, false);
} else {
$s_text = ilPCParagraph::xml2output($this->content_obj->getCellText($i, $j), true, false);
include_once "./Services/COPage/classes/class.ilPCParagraphGUI.php";
$s_text = ilPCParagraphGUI::xml2outputJS($s_text, "TableContent", $this->content_obj->readPCId() . "_" . $i . "_" . $j);
}
$dtpl->setVariable("PAR_TA_NAME", "cell[" . $i . "][" . $j . "]");
$dtpl->setVariable("PAR_TA_ID", "cell_" . $i . "_" . $j);
$dtpl->setVariable("PAR_TA_CONTENT", $s_text);
$cs = $res2->nodeset[$j]->get_attribute("ColSpan");
$rs = $res2->nodeset[$j]->get_attribute("RowSpan");
$dtpl->setVariable("WIDTH", "140");
$dtpl->setVariable("HEIGHT", "80");
if ($cs > 1) {
$dtpl->setVariable("COLSPAN", 'colspan="' . $cs . '"');
$dtpl->setVariable("WIDTH", 140 + ($cs - 1) * 146);
}
if ($rs > 1) {
$dtpl->setVariable("ROWSPAN", 'rowspan="' . $rs . '"');
$dtpl->setVariable("HEIGHT", 80 + ($rs - 1) * 86);
}
$dtpl->parseCurrentBlock();
}
}
$dtpl->setCurrentBlock("row");
$dtpl->parseCurrentBlock();
}
// init menues
$types = array("row", "col");
$moves = array("none", "backward", "both", "forward");
$commands = array("row" => array("newRowAfter" => "cont_ed_new_row_after", "newRowBefore" => "cont_ed_new_row_before", "moveRowUp" => "cont_ed_row_up", "moveRowDown" => "cont_ed_row_down", "deleteRow" => "cont_ed_delete_row"), "col" => array("newColAfter" => "cont_ed_new_col_after", "newColBefore" => "cont_ed_new_col_before", "moveColLeft" => "cont_ed_col_left", "moveColRight" => "cont_ed_col_right", "deleteCol" => "cont_ed_delete_col"));
foreach ($types as $type) {
foreach ($moves as $move) {
foreach ($commands[$type] as $command => $lang_var) {
if ($move == "none" && substr($command, 0, 4) == "move") {
continue;
}
if ($move == "backward" && in_array($command, array("movedown", "moveright")) || $move == "forward" && in_array($command, array("moveup", "moveleft"))) {
continue;
}
$this->tpl->setCurrentBlock("menu_item");
$this->tpl->setVariable("MENU_ITEM_TITLE", $lng->txt($lang_var));
$this->tpl->setVariable("CMD", $command);
$this->tpl->setVariable("TYPE", $type);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("menu");
$this->tpl->setVariable("TYPE", $type);
$this->tpl->setVariable("MOVE", $move);
$this->tpl->parseCurrentBlock();
}
}
$this->tpl->setVariable("FORMACTION2", $ilCtrl->getFormAction($this, "tableAction"));
$this->tpl->setVariable("TXT_ACTION", $this->lng->txt("cont_table"));
// js editing preparation
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initDragDrop();
ilYuiUtil::initConnection();
ilYuiUtil::initPanel(false);
$GLOBALS["tpl"]->addJavascript("Services/RTE/tiny_mce_3_3_9_2/il_tiny_mce_src.js");
$GLOBALS["tpl"]->addJavaScript("./Services/COPage/js/ilcopagecallback.js");
$GLOBALS["tpl"]->addJavascript("Services/COPage/js/page_editing.js");
$GLOBALS["tpl"]->addOnloadCode("var preloader = new Image();\n\t\t\tpreloader.src = './templates/default/images/loader.gif';\n\t\t\tilCOPage.setContentCss('" . ilObjStyleSheet::getContentStylePath((int) $this->getStyleId()) . ", " . ilUtil::getStyleSheetLocation() . ", ./Services/COPage/css/tiny_extra.css');\n\t\t\tilCOPage.editTD('cell_0_0');\n\t\t\t\t");
$this->tpl->setVariable("IL_TINY_MENU", ilPageObjectGUI::getTinyMenu($this->pg_obj->getParentType(), false, $this->pg_obj->getParentType() == "wpg", false, $this->getStyleId(), false, true));
}
示例13: getMp3PlayerHtml
/**
* Get Html for MP3 Player
*/
function getMp3PlayerHtml($a_preview = false)
{
global $tpl, $lng;
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initConnection();
$tpl->addJavascript("./Services/MediaObjects/js/MediaObjects.js");
if (!self::$lightbox_initialized && $a_preview) {
include_once "./Services/UIComponent/Lightbox/classes/class.ilLightboxGUI.php";
$lb = new ilLightboxGUI("media_lightbox");
$lb->setWidth("660px");
$lb->addLightbox();
self::$lightbox_initialized = true;
}
require_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
include_once "./Services/MediaObjects/classes/class.ilExternalMediaAnalyzer.php";
// youtube
/* if (ilExternalMediaAnalyzer::isYouTube($this->getFile()))
{
$p = ilExternalMediaAnalyzer::extractYouTubeParameters($this->getFile());
$html = '<object width="320" height="240">'.
'<param name="movie" value="http://www.youtube.com/v/'.$p["v"].'?fs=1">'.
'</param><param name="allowFullScreen" value="true"></param>'.
'<param name="allowscriptaccess" value="always">'.
'</param><embed src="http://www.youtube.com/v/'.$p["v"].'?fs=1" '.
'type="application/x-shockwave-flash" allowscriptaccess="always" '.
'allowfullscreen="true" width="320" height="240"></embed></object>';
return $html;
}
// vimeo
if (ilExternalMediaAnalyzer::isVimeo($this->getFile()))
{
$p = ilExternalMediaAnalyzer::extractVimeoParameters($this->getFile());
$html = '<iframe src="http://player.vimeo.com/video/'.$p["id"].'" width="320" height="240" '.
'frameborder="0"></iframe>';
return $html;
}
*/
$mimeType = $this->mimeType == "" ? ilObjMediaObject::getMimeType(basename($this->getFile())) : $this->mimeType;
include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php";
// video tag
if (in_array($mimeType, array("video/mp4", "video/m4v", "video/rtmp", "video/x-flv", "video/webm", "video/youtube", "video/vimeo", "video/ogg"))) {
ilPlayerUtil::initMediaElementJs();
if ($mimeType == "video/quicktime") {
$mimeType = "video/mov";
}
$mp_tpl = new ilTemplate("tpl.flv_player.html", true, true, "Services/MediaObjects");
// preview
if ($a_preview) {
if ($this->getDownloadLink() != "") {
$mp_tpl->setCurrentBlock("download");
$mp_tpl->setVariable("TXT_DOWNLOAD", $lng->txt("download"));
$mp_tpl->setVariable("HREF_DOWNLOAD", $this->getDownloadLink());
$mp_tpl->parseCurrentBlock();
}
$mp_tpl->setCurrentBlock("preview");
if ($this->getVideoPreviewPic() != "") {
$mp_tpl->setVariable("IMG_SRC", $this->getVideoPreviewPic());
} else {
$mp_tpl->setVariable("IMG_SRC", ilUtil::getImagePath("mcst_preview.svg"));
}
$mp_tpl->setVariable("IMG_ALT", $this->video_preview_pic_alt);
$mp_tpl->setVariable("PTITLE", $this->getTitle());
$mp_tpl->parseCurrentBlock();
}
// sources
$mp_tpl->setCurrentBlock("source");
$mp_tpl->setVariable("FILE", $this->getFile());
$mp_tpl->setVariable("MIME", $mimeType);
$mp_tpl->parseCurrentBlock();
if (in_array($this->getAlternativeVideoMimeType(), array("video/mp4", "video/webm"))) {
$mp_tpl->setCurrentBlock("source");
$mp_tpl->setVariable("FILE", $this->getAlternativeVideoFile());
$mp_tpl->setVariable("MIME", $this->getAlternativeVideoMimeType());
$mp_tpl->parseCurrentBlock();
}
$mp_tpl->setCurrentBlock("mejs_video");
if ($a_preview) {
$mp_tpl->setVariable("CLASS", "ilNoDisplay");
}
$mp_tpl->setVariable("PLAYER_NR", $this->id . "_" . $this->current_nr);
$mp_tpl->setVariable("EVENT_URL", $this->event_callback_url);
$height = $this->getDisplayHeight();
$width = $this->getDisplayWidth();
if (is_int(strpos($mimeType, "audio/mpeg"))) {
$height = "30";
}
$mp_tpl->setVariable("DISPLAY_HEIGHT", $height);
$mp_tpl->setVariable("DISPLAY_WIDTH", $width);
$mp_tpl->setVariable("PREVIEW_PIC", $this->getVideoPreviewPic());
$mp_tpl->setVariable("SWF_FILE", ilPlayerUtil::getFlashVideoPlayerFilename(true));
$mp_tpl->setVariable("FFILE", $this->getFile());
$mp_tpl->setVariable("TITLE", $this->getTitle());
$mp_tpl->setVariable("DESCRIPTION", $this->getDescription());
include_once "./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
//.........这里部分代码省略.........