本文整理汇总了PHP中ilYuiUtil::initDragDrop方法的典型用法代码示例。如果您正苦于以下问题:PHP ilYuiUtil::initDragDrop方法的具体用法?PHP ilYuiUtil::initDragDrop怎么用?PHP ilYuiUtil::initDragDrop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilYuiUtil
的用法示例。
在下文中一共展示了ilYuiUtil::initDragDrop方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __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");
}
示例2: renderPage
//.........这里部分代码省略.........
}
$ilCtrl->setParameter($this, "pg", $this->current_page);
$ilCtrl->setParameter($this, "pgov", "");
$this->renderToolbar($pages);
if ($pages) {
$ttpl = new ilTemplate("tpl.il_svy_svy_page_view.html", true, true, "Modules/Survey");
$ttpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this));
$ttpl->setVariable("WYSIWYG_ACTION", $ilCtrl->getFormAction($this));
$lng->loadLanguageModule("form");
$read_only = $this->has_datasets || !$rbacsystem->checkAccess("write", $this->ref_id);
$commands = $multi_commands = array();
if (!$read_only) {
// clipboard is empty
if (!$_SESSION["survey_page_view"][$this->ref_id]["clipboard"]) {
$multi_commands[] = array("cmd" => "multiDelete", "text" => $lng->txt("delete"));
$multi_commands[] = array("cmd" => "multiCut", "text" => $lng->txt("cut"));
$multi_commands[] = array("cmd" => "multiCopy", "text" => $lng->txt("copy"));
} else {
if (!$this->suppress_clipboard_msg) {
ilUtil::sendInfo($lng->txt("survey_clipboard_notice"));
}
$multi_commands[] = array("cmd" => "clearClipboard", "text" => $lng->txt("survey_dnd_clear_clipboard"));
}
// help
$ttpl->setCurrentBlock("help_img");
$ttpl->setVariable("IMG_HELP", ilUtil::getImagePath("streaked_area.png"));
$ttpl->parseCurrentBlock();
$ttpl->setCurrentBlock("help_section");
$ttpl->setVariable("TXT_HELP", $lng->txt("form_hierarchy_add_elements"));
$ttpl->parseCurrentBlock();
$ttpl->setCurrentBlock("help_img");
$ttpl->setVariable("IMG_HELP", ilUtil::getImagePath("icon_cont_el_s.png"));
$ttpl->parseCurrentBlock();
$ttpl->setVariable("IMG_HELP", ilUtil::getImagePath("drop_streaked_area.png"));
$ttpl->parseCurrentBlock();
$ttpl->setCurrentBlock("help_section");
$ttpl->setVariable("TXT_HELP", $lng->txt("form_hierarchy_drag_drop_help"));
$ttpl->parseCurrentBlock();
$ttpl->setCurrentBlock("help_img");
$ttpl->setVariable("IMG_HELP", ilUtil::getImagePath("icon_cont_el_s.png"));
$ttpl->parseCurrentBlock();
$ttpl->setCurrentBlock("help_section");
$ttpl->setVariable("TXT_HELP", $lng->txt("survey_dnd_double_click_to_delete"));
$ttpl->parseCurrentBlock();
$ttpl->setVariable("DND_INIT_JS", "initDragElements();");
// tiny mce
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$tags = ilObjAdvancedEditing::_getUsedHTMLTags("survey");
include_once "./Services/RTE/classes/class.ilTinyMCE.php";
$tiny = new ilTinyMCE("3.3.9.2");
$ttpl->setVariable("WYSIWYG_BLOCKFORMATS", $tiny->_buildAdvancedBlockformatsFromHTMLTags($tags));
$ttpl->setVariable("WYSIWYG_VALID_ELEMENTS", $tiny->_getValidElementsFromHTMLTags($tags));
$buttons_1 = $tiny->_buildAdvancedButtonsFromHTMLTags(1, $tags);
$buttons_2 = $tiny->_buildAdvancedButtonsFromHTMLTags(2, $tags) . ',' . $tiny->_buildAdvancedTableButtonsFromHTMLTags($tags) . ($tiny->getStyleSelect() ? ',styleselect' : '');
$buttons_3 = $tiny->_buildAdvancedButtonsFromHTMLTags(3, $tags);
$ttpl->setVariable('WYSIWYG_BUTTONS_1', $tiny->_removeRedundantSeparators($buttons_1));
$ttpl->setVariable('WYSIWYG_BUTTONS_2', $tiny->_removeRedundantSeparators($buttons_2));
$ttpl->setVariable('WYSIWYG_BUTTONS_3', $tiny->_removeRedundantSeparators($buttons_3));
}
// commands
if (count($multi_commands) > 0 || count($commands) > 0) {
$single = false;
foreach ($commands as $cmd) {
$ttpl->setCurrentBlock("cmd");
$ttpl->setVariable("ORG_CMD", "renderPage");
$ttpl->setVariable("CMD", $cmd["cmd"]);
$ttpl->setVariable("CMD_TXT", $cmd["text"]);
$ttpl->parseCurrentBlock();
$single = true;
}
$multi = false;
foreach ($multi_commands as $cmd) {
$ttpl->setCurrentBlock("multi_cmd");
$ttpl->setVariable("ORG_CMD_MULTI", "renderPage");
$ttpl->setVariable("MULTI_CMD", $cmd["cmd"]);
$ttpl->setVariable("MULTI_CMD_TXT", $cmd["text"]);
$ttpl->parseCurrentBlock();
$multi = true;
}
if ($multi) {
$ttpl->setCurrentBlock("multi_cmds");
$ttpl->setVariable("MCMD_ALT", $lng->txt("commands"));
$ttpl->setVariable("MCMD_IMG", ilUtil::getImagePath("arrow_downright.png"));
$ttpl->parseCurrentBlock();
}
if ($single || $multi) {
$ttpl->setCurrentBlock("commands");
$ttpl->parseCurrentBlock();
}
}
// nodes
$ttpl->setVariable("NODES", $this->getPageNodes($pages[$this->current_page - 1], $this->has_previous_page, $this->has_next_page, $read_only));
$tpl->setContent($ttpl->get());
// add js to template
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initDragDrop();
$tpl->addJavascript("./Modules/Survey/js/SurveyPageView.js");
$tpl->addJavascript("./Services/RTE/tiny_mce_3_3_9_2/tiny_mce_src.js");
}
}
示例3: 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();
}
示例4: show
/**
* fill data section
*
* @access protected
*
*/
protected function show()
{
global $lng, $ilUser;
// config
$raster = 15;
if ($this->user_settings->getDayStart()) {
// push starting point to last "slot" of hour BEFORE morning aggregation
$morning_aggr = ($this->user_settings->getDayStart() - 1) * 60 + (60 - $raster);
} else {
$morning_aggr = 0;
}
$evening_aggr = $this->user_settings->getDayEnd() * 60;
$this->tpl = new ilTemplate('tpl.day_view.html', true, true, 'Services/Calendar');
include_once './Services/YUI/classes/class.ilYuiUtil.php';
ilYuiUtil::initDragDrop();
ilYuiUtil::initPanel();
if (isset($_GET["bkid"])) {
$user_id = $_GET["bkid"];
$no_add = true;
} elseif ($ilUser->getId() == ANONYMOUS_USER_ID) {
$user_id = $ilUser->getId();
$no_add = true;
} else {
$user_id = $ilUser->getId();
$no_add = false;
}
include_once 'Services/Calendar/classes/class.ilCalendarSchedule.php';
$this->scheduler = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_DAY, $user_id);
$this->scheduler->addSubitemCalendars(true);
$this->scheduler->calculate();
$daily_apps = $this->scheduler->getByDay($this->seed, $this->timezone);
$hours = $this->parseInfoIntoRaster($daily_apps, $morning_aggr, $evening_aggr, $raster);
$colspan = $this->calculateColspan($hours);
$navigation = new ilCalendarHeaderNavigationGUI($this, $this->seed, ilDateTime::DAY);
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->seed->get(IL_CAL_DATE));
// add milestone link
include_once 'Services/Calendar/classes/class.ilCalendarSettings.php';
$settings = ilCalendarSettings::_getInstance();
include_once "Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
if (!$no_add) {
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->seed->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'idate', $this->seed->get(IL_CAL_DATE));
$new_app_url = $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'add');
if ($settings->getEnableGroupMilestones()) {
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->seed->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'idate', $this->seed->get(IL_CAL_DATE));
$new_ms_url = $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'addMilestone');
$this->tpl->setCurrentBlock("new_ms");
$this->tpl->setVariable('DD_ID', $this->seed->get(IL_CAL_UNIX));
$this->tpl->setVariable('DD_TRIGGER', ilGlyphGUI::get(ilGlyphGUI::ADD));
$this->tpl->setVariable('URL_DD_NEW_APP', $new_app_url);
$this->tpl->setVariable('TXT_DD_NEW_APP', $this->lng->txt('cal_new_app'));
$this->tpl->setVariable('URL_DD_NEW_MS', $new_ms_url);
$this->tpl->setVariable('TXT_DD_NEW_MS', $this->lng->txt('cal_new_ms'));
$this->tpl->parseCurrentBlock();
} else {
$this->tpl->setCurrentBlock("new_app1");
$this->tpl->setVariable('H_NEW_APP_SRC', ilGlyphGUI::get(ilGlyphGUI::ADD, $this->lng->txt('cal_new_app')));
$this->tpl->setVariable('NEW_APP_LINK', $new_app_url);
$this->tpl->parseCurrentBlock();
}
$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
}
$this->tpl->setVariable('NAVIGATION', $navigation->getHTML());
$this->tpl->setVariable('HEADER_DATE', $this->seed_info['mday'] . ' ' . ilCalendarUtil::_numericMonthToString($this->seed_info['mon'], false));
$this->tpl->setVariable('HEADER_DAY', ilCalendarUtil::_numericDayToString($this->seed_info['wday'], true));
$this->tpl->setVariable('HCOLSPAN', $colspan - 1);
$this->tpl->setVariable('TXT_TIME', $lng->txt("time"));
// show fullday events
foreach ($daily_apps as $event) {
if ($event['fullday']) {
$this->showFulldayAppointment($event);
}
}
$this->tpl->setCurrentBlock('fullday_apps');
$this->tpl->setVariable('TXT_F_DAY', $lng->txt("cal_all_day"));
$this->tpl->setVariable('COLSPAN', $colspan - 1);
$this->tpl->parseCurrentBlock();
// parse the hour rows
foreach ($hours as $numeric => $hour) {
if (!($numeric % 60) || $numeric == $morning_aggr && $morning_aggr || $numeric == $evening_aggr && $evening_aggr) {
if (!$no_add) {
$this->tpl->setCurrentBlock("new_app2");
$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->seed->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'idate', $this->seed->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'hour', floor($numeric / 60));
$this->tpl->setVariable('NEW_APP_HOUR_LINK', $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'add'));
$this->tpl->setVariable('NEW_APP_SRC', ilGlyphGUI::get(ilGlyphGUI::ADD, $this->lng->txt('cal_new_app')));
$this->tpl->parseCurrentBlock();
}
// aggregation rows
if ($numeric == $morning_aggr && $morning_aggr || $numeric == $evening_aggr && $evening_aggr) {
$this->tpl->setVariable('TIME_ROWSPAN', 1);
//.........这里部分代码省略.........
示例5: 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
//.........这里部分代码省略.........
示例6: getTestOutputJS
function getTestOutputJS($active_id, $pass = NULL, $is_postponed = FALSE, $user_post_solution = FALSE)
{
// generate the question output
include_once "./Services/UICore/classes/class.ilTemplate.php";
$template = new ilTemplate("tpl.il_as_qpl_matching_output_js.html", TRUE, TRUE, "Modules/TestQuestionPool");
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);
}
}
if (is_array($user_post_solution)) {
$solutions = array();
foreach ($user_post_solution['matching'][$this->object->getId()] as $definition => $term) {
array_push($solutions, array("value1" => $term, "value2" => $definition));
}
} else {
$solutions =& $this->object->getSolutionValues($active_id, $pass);
}
foreach ($solutions as $idx => $solution_value) {
if ($this->object->getOutputType() == OUTPUT_JAVASCRIPT) {
if ($solution_value["value2"] > -1 && $solution_value["value1"] > -1) {
$template->setCurrentBlock("restoreposition");
$template->setVariable("TERM_ID", $solution_value["value1"]);
$template->setVariable("PICTURE_DEFINITION_ID", $solution_value["value2"]);
$template->parseCurrentBlock();
}
}
}
}
// shuffle output
$terms = $this->object->getTerms();
$definitions = $this->object->getDefinitions();
switch ($this->object->getShuffle()) {
case 1:
$terms = $this->object->pcArrayShuffle($terms);
if (count($solutions)) {
$definitions = $this->sortDefinitionsBySolution($solutions);
} else {
$definitions = $this->object->pcArrayShuffle($definitions);
}
break;
case 2:
$terms = $this->object->pcArrayShuffle($terms);
break;
case 3:
if (count($solutions)) {
$definitions = $this->sortDefinitionsBySolution($solutions);
} else {
$definitions = $this->object->pcArrayShuffle($definitions);
}
break;
}
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
ilYuiUtil::initDragDrop();
// create definitions
$counter = 0;
foreach ($definitions as $definition) {
if (strlen($definition->picture)) {
$template->setCurrentBlock("definition_picture");
$template->setVariable("DEFINITION_ID", $definition->identifier);
$template->setVariable("IMAGE_HREF", $this->object->getImagePathWeb() . $definition->picture);
$thumbweb = $this->object->getImagePathWeb() . $this->object->getThumbPrefix() . $definition->picture;
$thumb = $this->object->getImagePath() . $this->object->getThumbPrefix() . $definition->picture;
if (!@file_exists($thumb)) {
$this->object->rebuildThumbnails();
}
$template->setVariable("THUMBNAIL_HREF", $thumbweb);
$template->setVariable("THUMB_ALT", $this->lng->txt("image"));
$template->setVariable("THUMB_TITLE", $this->lng->txt("image"));
$template->setVariable("TEXT_DEFINITION", strlen($definition->text) ? ilUtil::prepareFormOutput($definition->text) : '');
$template->setVariable("TEXT_PREVIEW", $this->lng->txt('preview'));
$template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('enlarge.png'));
$template->parseCurrentBlock();
} else {
$template->setCurrentBlock("definition_text");
$template->setVariable("DEFINITION", $this->object->prepareTextareaOutput($definition->text, true));
$template->parseCurrentBlock();
}
$template->setCurrentBlock("droparea");
$template->setVariable("ID_DROPAREA", $definition->identifier);
$template->setVariable("QUESTION_ID", $this->object->getId());
if ($this->object->getEstimatedElementHeight() > 0) {
$template->setVariable("ELEMENT_HEIGHT", " style=\"height: " . $this->object->getEstimatedElementHeight() . "px;\"");
}
$template->parseCurrentBlock();
$template->setCurrentBlock("init_dropareas");
$template->setVariable("COUNTER", $counter++);
$template->setVariable("ID_DROPAREA", $definition->identifier);
$template->parseCurrentBlock();
}
// create terms
$counter = 0;
foreach ($terms as $term) {
if (strlen($term->picture)) {
$template->setCurrentBlock("term_picture");
$template->setVariable("TERM_ID", $term->identifier);
$template->setVariable("IMAGE_HREF", $this->object->getImagePathWeb() . $term->picture);
//.........这里部分代码省略.........
示例7: show
/**
* fill data section
*
* @access public
*
*/
public function show()
{
global $ilUser, $lng;
// config
$raster = 15;
if ($this->user_settings->getDayStart()) {
// push starting point to last "slot" of hour BEFORE morning aggregation
$morning_aggr = ($this->user_settings->getDayStart() - 1) * 60 + (60 - $raster);
} else {
$morning_aggr = 0;
}
$evening_aggr = $this->user_settings->getDayEnd() * 60;
$this->tpl = new ilTemplate('tpl.week_view.html', true, true, 'Services/Calendar');
include_once './Services/YUI/classes/class.ilYuiUtil.php';
ilYuiUtil::initDragDrop();
ilYuiUtil::initPanel();
$navigation = new ilCalendarHeaderNavigationGUI($this, $this->seed, ilDateTime::WEEK);
$this->tpl->setVariable('NAVIGATION', $navigation->getHTML());
if (isset($_GET["bkid"])) {
$user_id = $_GET["bkid"];
$disable_empty = true;
$no_add = true;
} elseif ($ilUser->getId() == ANONYMOUS_USER_ID) {
$user_id = $ilUser->getId();
$disable_empty = false;
$no_add = true;
} else {
$user_id = $ilUser->getId();
$disable_empty = false;
$no_add = false;
}
include_once 'Services/Calendar/classes/class.ilCalendarSchedule.php';
$this->scheduler = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_WEEK, $user_id, $disable_empty);
$this->scheduler->addSubitemCalendars(true);
$this->scheduler->calculate();
$counter = 0;
$hours = null;
$all_fullday = array();
foreach (ilCalendarUtil::_buildWeekDayList($this->seed, $this->user_settings->getWeekStart())->get() as $date) {
$daily_apps = $this->scheduler->getByDay($date, $this->timezone);
$hours = $this->parseHourInfo($daily_apps, $date, $counter, $hours, $morning_aggr, $evening_aggr, $raster);
$this->weekdays[] = $date;
$num_apps[$date->get(IL_CAL_DATE)] = count($daily_apps);
$all_fullday[] = $daily_apps;
$counter++;
}
$colspans = $this->calculateColspans($hours);
include_once 'Services/Calendar/classes/class.ilCalendarSettings.php';
$settings = ilCalendarSettings::_getInstance();
include_once "Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
// Table header
$counter = 0;
foreach (ilCalendarUtil::_buildWeekDayList($this->seed, $this->user_settings->getWeekStart())->get() as $date) {
$date_info = $date->get(IL_CAL_FKT_GETDATE, '', 'UTC');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $date->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'idate', $date->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendardaygui', 'seed', $date->get(IL_CAL_DATE));
if (!$no_add) {
$new_app_url = $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'add');
if ($settings->getEnableGroupMilestones()) {
$new_ms_url = $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'addMilestone');
$this->tpl->setCurrentBlock("new_ms");
$this->tpl->setVariable('DD_ID', $date->get(IL_CAL_UNIX));
$this->tpl->setVariable('DD_TRIGGER', ilGlyphGUI::get(ilGlyphGUI::ADD));
$this->tpl->setVariable('URL_DD_NEW_APP', $new_app_url);
$this->tpl->setVariable('TXT_DD_NEW_APP', $this->lng->txt('cal_new_app'));
$this->tpl->setVariable('URL_DD_NEW_MS', $new_ms_url);
$this->tpl->setVariable('TXT_DD_NEW_MS', $this->lng->txt('cal_new_ms'));
$this->tpl->parseCurrentBlock();
} else {
$this->tpl->setCurrentBlock("new_app");
$this->tpl->setVariable('NEW_APP_LINK', $new_app_url);
$this->tpl->setVariable('NEW_APP_SRC', ilGlyphGUI::get(ilGlyphGUI::ADD, $this->lng->txt('cal_new_app')));
// $this->tpl->setVariable('NEW_APP_ALT',$this->lng->txt('cal_new_app'));
$this->tpl->parseCurrentBlock();
}
$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
}
$dayname = ilCalendarUtil::_numericDayToString($date->get(IL_CAL_FKT_DATE, 'w'), true);
$daydate = $date_info['mday'] . ' ' . ilCalendarUtil::_numericMonthToString($date_info['mon'], false);
if (!$disable_empty || $num_apps[$date->get(IL_CAL_DATE)] > 0) {
$link = $this->ctrl->getLinkTargetByClass('ilcalendardaygui', '');
$this->ctrl->clearParametersByClass('ilcalendardaygui');
$this->tpl->setCurrentBlock("day_view1_link");
$this->tpl->setVariable('HEADER_DATE', $daydate);
$this->tpl->setVariable('DAY_VIEW_LINK', $link);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("day_view2_link");
$this->tpl->setVariable('DAYNAME', $dayname);
$this->tpl->setVariable('DAY_VIEW_LINK', $link);
$this->tpl->parseCurrentBlock();
} else {
$this->tpl->setCurrentBlock("day_view1_no_link");
$this->tpl->setVariable('HEADER_DATE', $daydate);
//.........这里部分代码省略.........
示例8: 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));
}
示例9: show
/**
* Fills the table with data for whole week.
*/
public function show($export = false)
{
if ($export && isset($_SESSION['weeklySeed'])) {
$this->seed = $_SESSION['weeklySeed'];
} else {
$_SESSION['weeklySeed'] = $this->seed;
}
if (!$this->permission->checkPrivilege(PRIVC::SEE_BOOKINGS_OF_ROOMS)) {
ilUtil::sendFailure($this->lng->txt("rep_robj_xrs_no_permission_for_action"));
$this->ctrl->redirectByClass('ilinfoscreengui', 'showSummary', 'showSummary');
return false;
}
global $ilUser;
$this->setSubTabs('weekview');
//intervalsize
$raster = 15;
if ($this->user_settings->getDayStart()) {
// push starting point to last "slot" of hour BEFORE morning aggregation
$morning_aggr = ($this->user_settings->getDayStart() - 1) * 60 + (60 - $raster);
} else {
$morning_aggr = 0;
}
$evening_aggr = $this->user_settings->getDayEnd() * 60;
$this->tpl = new ilTemplate('tpl.room_week_view.html', true, true, 'Customizing/global/plugins/Services/Repository/RepositoryObject/RoomSharing');
ilYuiUtil::initDragDrop();
ilYuiUtil::initPanel();
$navigation = new ilCalendarHeaderNavigationGUI($this, $this->seed, ilDateTime::WEEK);
$this->tpl->setVariable('NAVIGATION', $navigation->getHTML());
if (isset($_GET["bkid"])) {
$user_id = $_GET["bkid"];
$disable_empty = true;
$no_add = true;
} elseif ($ilUser->getId() == ANONYMOUS_USER_ID) {
$user_id = $ilUser->getId();
$disable_empty = false;
$no_add = true;
} else {
$user_id = $ilUser->getId();
$disable_empty = false;
$no_add = false;
}
$room = new ilRoomSharingRoom($this->pool_id, $this->room_id);
$this->tpl->setVariable('ROOM', $this->lng->txt('rep_robj_xrs_room_occupation_title') . " " . $room->getName());
$this->scheduler = new ilRoomSharingCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_WEEK, $user_id, $room);
$this->scheduler->addSubitemCalendars(true);
$this->scheduler->calculate();
$counter = 0;
$hours = NULL;
foreach (ilCalendarUtil::_buildWeekDayList($this->seed, $this->user_settings->getWeekStart())->get() as $date) {
$daily_apps = $this->scheduler->getByDay($date, $this->timezone);
$hours = $this->parseHourInfo($daily_apps, $date, $counter, $hours, $morning_aggr, $evening_aggr, $raster);
$this->weekdays[] = $date;
$num_apps[$date->get(IL_CAL_DATE)] = count($daily_apps);
$counter++;
}
$colspans = $this->calculateColspans($hours);
$settings = ilCalendarSettings::_getInstance();
$exportLink = $this->ctrl->getLinkTargetByClass("ilroomsharingcalendarweekgui", "export");
$this->tpl->setCurrentBlock("export_block");
$this->tpl->setVariable('EXPORT_LINK', $exportLink);
$this->tpl->parseCurrentBlock();
// Table header
$counter = 0;
foreach (ilCalendarUtil::_buildWeekDayList($this->seed, $this->user_settings->getWeekStart())->get() as $date) {
$date_info = $date->get(IL_CAL_FKT_GETDATE, '', 'UTC');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $date->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'idate', $date->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendardaygui', 'seed', $date->get(IL_CAL_DATE));
$dayname = ilCalendarUtil::_numericDayToString($date->get(IL_CAL_FKT_DATE, 'w'), true);
$this->days[$counter] = $date;
$daydate = $date_info['mday'] . ' ' . ilCalendarUtil::_numericMonthToString($date_info['mon'], false);
if (!$disable_empty || $num_apps[$date->get(IL_CAL_DATE)] > 0) {
$link = $this->ctrl->getLinkTargetByClass('ilcalendardaygui', '');
$this->ctrl->clearParametersByClass('ilcalendardaygui');
$this->tpl->setCurrentBlock("day_view1_link");
$this->tpl->setVariable('HEADER_DATE', $daydate);
$this->tpl->setVariable('DAY_VIEW_LINK', $link);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("day_view2_link");
$this->tpl->setVariable('DAYNAME', $dayname);
$this->tpl->setVariable('DAY_VIEW_LINK', $link);
$this->tpl->parseCurrentBlock();
} else {
$this->tpl->setCurrentBlock("day_view1_no_link");
$this->tpl->setVariable('HEADER_DATE', $daydate);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("day_view2_no_link");
$this->tpl->setVariable('DAYNAME', $dayname);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock('day_header_row');
$this->tpl->setVariable('DAY_COLSPAN', max($colspans[$counter], 1));
$this->tpl->parseCurrentBlock();
$counter++;
}
$new_link_counter = 0;
foreach ($hours as $num_hour => $hours_per_day) {
//.........这里部分代码省略.........
示例10: show
/**
* fill data section
*
* @access public
*
*/
public function show()
{
global $tpl, $ilUser;
$this->tpl = new ilTemplate('tpl.month_view.html', true, true, 'Services/Calendar');
include_once './Services/YUI/classes/class.ilYuiUtil.php';
ilYuiUtil::initDragDrop();
ilYuiUtil::initPanel();
$navigation = new ilCalendarHeaderNavigationGUI($this, $this->seed, ilDateTime::MONTH);
$this->tpl->setVariable('NAVIGATION', $navigation->getHTML());
for ($i = (int) $this->user_settings->getWeekStart(); $i < 7 + (int) $this->user_settings->getWeekStart(); $i++) {
$this->tpl->setCurrentBlock('month_header_col');
$this->tpl->setVariable('TXT_WEEKDAY', ilCalendarUtil::_numericDayToString($i, true));
$this->tpl->parseCurrentBlock();
}
if (isset($_GET["bkid"])) {
$user_id = $_GET["bkid"];
$disable_empty = true;
$no_add = true;
} else {
if ($ilUser->getId() == ANONYMOUS_USER_ID) {
$user_id = $ilUser->getId();
$disable_empty = false;
$no_add = true;
} else {
$user_id = $ilUser->getId();
$disable_empty = false;
$no_add = false;
}
}
$is_portfolio_embedded = false;
if (ilCalendarCategories::_getInstance()->getMode() == ilCalendarCategories::MODE_PORTFOLIO_CONSULTATION) {
$no_add = true;
$is_portfolio_embedded = true;
}
include_once 'Services/Calendar/classes/class.ilCalendarSchedule.php';
$this->scheduler = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_MONTH, $user_id);
$this->scheduler->addSubitemCalendars(true);
if (sizeof($this->schedule_filters)) {
foreach ($this->schedule_filters as $filter) {
$this->scheduler->addFilter($filter);
}
}
$this->scheduler->calculate();
include_once 'Services/Calendar/classes/class.ilCalendarSettings.php';
$settings = ilCalendarSettings::_getInstance();
$counter = 0;
foreach (ilCalendarUtil::_buildMonthDayList($this->seed->get(IL_CAL_FKT_DATE, 'm'), $this->seed->get(IL_CAL_FKT_DATE, 'Y'), $this->user_settings->getWeekStart())->get() as $date) {
$counter++;
$has_events = (bool) $this->showEvents($date);
if (!$no_add) {
include_once "Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'idate', $date->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->seed->get(IL_CAL_DATE));
$new_app_url = $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'add');
if ($settings->getEnableGroupMilestones()) {
$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->seed->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'idate', $date->get(IL_CAL_DATE));
$new_ms_url = $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'addMilestone');
$this->tpl->setCurrentBlock("new_ms");
$this->tpl->setVariable('DD_ID', $date->get(IL_CAL_UNIX));
$this->tpl->setVariable('DD_TRIGGER', ilGlyphGUI::get(ilGlyphGUI::ADD));
$this->tpl->setVariable('URL_DD_NEW_APP', $new_app_url);
$this->tpl->setVariable('TXT_DD_NEW_APP', $this->lng->txt('cal_new_app'));
$this->tpl->setVariable('URL_DD_NEW_MS', $new_ms_url);
$this->tpl->setVariable('TXT_DD_NEW_MS', $this->lng->txt('cal_new_ms'));
$this->tpl->parseCurrentBlock();
} else {
$this->tpl->setCurrentBlock("new_app");
$this->tpl->setVariable('ADD_LINK', $new_app_url);
$this->tpl->setVariable('NEW_SRC', ilGlyphGUI::get(ilGlyphGUI::ADD, $this->lng->txt('cal_new_app')));
$this->tpl->parseCurrentBlock();
}
}
$day = $date->get(IL_CAL_FKT_DATE, 'j');
$month = $date->get(IL_CAL_FKT_DATE, 'n');
if ($day == 1) {
$month_day = '1 ' . ilCalendarUtil::_numericMonthToString($month, false);
} else {
$month_day = $day;
}
if (!$is_portfolio_embedded && (!$disable_empty || $has_events)) {
$this->tpl->setCurrentBlock('month_day_link');
$this->ctrl->clearParametersByClass('ilcalendardaygui');
$this->ctrl->setParameterByClass('ilcalendardaygui', 'seed', $date->get(IL_CAL_DATE));
$this->tpl->setVariable('OPEN_DAY_VIEW', $this->ctrl->getLinkTargetByClass('ilcalendardaygui', ''));
$this->ctrl->clearParametersByClass('ilcalendardaygui');
} else {
$this->tpl->setCurrentBlock('month_day_no_link');
}
$this->tpl->setVariable('MONTH_DAY', $month_day);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('month_col');
//.........这里部分代码省略.........