本文整理汇总了PHP中ilUtil::deliverData方法的典型用法代码示例。如果您正苦于以下问题:PHP ilUtil::deliverData方法的具体用法?PHP ilUtil::deliverData怎么用?PHP ilUtil::deliverData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilUtil
的用法示例。
在下文中一共展示了ilUtil::deliverData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleRequest
/**
* Handle Request
* @return
*/
public function handleRequest()
{
$this->initIlias();
$this->initTokenHandler();
if ($this->getTokenHandler()->getIcal() and !$this->getTokenHandler()->isIcalExpired()) {
ilUtil::deliverData($this->getTokenHandler(), 'calendar.ics', 'text/calendar', 'utf-8');
}
include_once './Services/Calendar/classes/Export/class.ilCalendarExport.php';
include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
if ($this->getTokenHandler()->getSelectionType() == ilCalendarAuthenticationToken::SELECTION_CALENDAR) {
$export = new ilCalendarExport(array($this->getTokenHandler()->getCalendar()));
} else {
$cats = ilCalendarCategories::_getInstance();
$cats->initialize(ilCalendarCategories::MODE_REMOTE_ACCESS);
$export = new ilCalendarExport($cats->getCategories(true));
}
$export->export();
$this->getTokenHandler()->setIcal($export->getExportString());
$this->getTokenHandler()->storeIcal();
ilUtil::deliverData($export->getExportString(), 'calendar.ics', 'text/calendar', 'utf-8');
#echo $export->getExportString();
#echo nl2br($export->getExportString());
#$fp = fopen('ilias.ics', 'w');
#fwrite($fp,$export->getExportString());
$GLOBALS['ilAuth']->logout();
exit;
}
示例2: exportLogObject
/**
* Called when the a log should be exported
*/
public function exportLogObject()
{
$from = mktime($_POST['log_from']['time']['h'], $_POST['log_from']['time']['m'], 0, $_POST['log_from']['date']['m'], $_POST['log_from']['date']['d'], $_POST['log_from']['date']['y']);
$until = mktime($_POST['log_until']['time']['h'], $_POST['log_until']['time']['m'], 0, $_POST['log_until']['date']['m'], $_POST['log_until']['date']['d'], $_POST['log_until']['date']['y']);
$test = $_POST['sel_test'];
$csv = array();
$separator = ";";
$row = array($this->lng->txt("assessment_log_datetime"), $this->lng->txt("user"), $this->lng->txt("assessment_log_text"), $this->lng->txt("question"));
include_once "./Modules/Test/classes/class.ilObjTest.php";
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$available_tests =& ilObjTest::_getAvailableTests(1);
array_push($csv, ilUtil::processCSVRow($row, TRUE, $separator));
$log_output =& $this->object->getLog($from, $until, $test);
$users = array();
foreach ($log_output as $key => $log) {
if (!array_key_exists($log["user_fi"], $users)) {
$users[$log["user_fi"]] = ilObjUser::_lookupName($log["user_fi"]);
}
$title = "";
if ($log["question_fi"] || $log["original_fi"]) {
$title = assQuestion::_getQuestionTitle($log["question_fi"]);
if (strlen($title) == 0) {
$title = assQuestion::_getQuestionTitle($log["original_fi"]);
}
$title = $this->lng->txt("assessment_log_question") . ": " . $title;
}
$csvrow = array();
$date = new ilDateTime($log['tstamp'], IL_CAL_UNIX);
array_push($csvrow, $date->get(IL_CAL_FKT_DATE, 'Y-m-d H:i'));
array_push($csvrow, trim($users[$log["user_fi"]]["title"] . " " . $users[$log["user_fi"]]["firstname"] . " " . $users[$log["user_fi"]]["lastname"]));
array_push($csvrow, trim($log["logtext"]));
array_push($csvrow, $title);
array_push($csv, ilUtil::processCSVRow($csvrow, TRUE, $separator));
}
$csvoutput = "";
foreach ($csv as $row) {
$csvoutput .= join($row, $separator) . "\n";
}
ilUtil::deliverData($csvoutput, str_replace(" ", "_", "log_" . $from . "_" . $until . "_" . $available_tests[$test]) . ".csv");
}
示例3: exportCSV
/**
* Events List CSV Export
*
* @access public
* @param
*
*/
public function exportCSV()
{
global $tree, $ilAccess;
include_once 'Services/Utilities/classes/class.ilCSVWriter.php';
include_once 'Modules/Session/classes/class.ilEventParticipants.php';
$members = $this->members_obj->getParticipants();
$members = ilUtil::_sortIds($members, 'usr_data', 'lastname', 'usr_id');
$events = array();
foreach ($tree->getSubtree($tree->getNodeData($this->course_ref_id), false, 'sess') as $event_id) {
$tmp_event = ilObjectFactory::getInstanceByRefId($event_id, false);
if (!is_object($tmp_event) or !$ilAccess->checkAccess('write', '', $event_id)) {
continue;
}
$events[] = $tmp_event;
}
$this->csv = new ilCSVWriter();
$this->csv->addColumn($this->lng->txt("lastname"));
$this->csv->addColumn($this->lng->txt("firstname"));
$this->csv->addColumn($this->lng->txt("login"));
foreach ($events as $event_obj) {
// TODO: do not export relative dates
$this->csv->addColumn($event_obj->getTitle() . ' (' . $event_obj->getFirstAppointment()->appointmentToString() . ')');
}
$this->csv->addRow();
foreach ($members as $user_id) {
$name = ilObjUser::_lookupName($user_id);
$this->csv->addColumn($name['lastname']);
$this->csv->addColumn($name['firstname']);
$this->csv->addColumn(ilObjUser::_lookupLogin($user_id));
foreach ($events as $event_obj) {
$event_part = new ilEventParticipants((int) $event_obj->getId());
$this->csv->addColumn($event_part->hasParticipated($user_id) ? $this->lng->txt('event_participated') : $this->lng->txt('event_not_participated'));
}
$this->csv->addRow();
}
$date = new ilDate(time(), IL_CAL_UNIX);
ilUtil::deliverData($this->csv->getCSVString(), $date->get(IL_CAL_FKT_DATE, 'Y-m-d') . "_course_events.csv", "text/csv");
}
示例4: exportHTML
/**
*
*/
public function exportHTML()
{
/**
* @var $tpl ilTemplate
* @var $lng ilLanguage
* @var $ilAccess ilAccessHandler
* @var $ilias ILIAS
*/
global $lng, $tpl, $ilAccess, $ilias;
if (!$ilAccess->checkAccess('read,visible', '', $_GET['ref_id'])) {
$ilias->raiseError($lng->txt('permission_denied'), $ilias->error_obj->MESSAGE);
}
ilDatePresentation::setUseRelativeDates(false);
$tpl = new ilTemplate('tpl.forums_export_html.html', true, true, 'Modules/Forum');
$location_stylesheet = ilUtil::getStyleSheetLocation();
$tpl->setVariable('LOCATION_STYLESHEET', $location_stylesheet);
$tpl->setVariable('BASE', substr(ILIAS_HTTP_PATH, -1) == '/' ? ILIAS_HTTP_PATH : ILIAS_HTTP_PATH . '/');
$num_threads = count((array) $_POST['thread_ids']);
for ($j = 0; $j < $num_threads; $j++) {
$topic = new ilForumTopic((int) $_POST['thread_ids'][$j], $this->is_moderator);
$this->frm->setMDB2WhereCondition('top_pk = %s ', array('integer'), array($topic->getForumId()));
if (is_array($thread_data = $this->frm->getOneTopic())) {
if (0 == $j) {
$tpl->setVariable('TITLE', $thread_data['top_name']);
}
$first_post = $topic->getFirstPostNode();
$topic->setOrderField('frm_posts_tree.rgt');
$post_collection = $topic->getPostTree($first_post);
$z = 0;
foreach ($post_collection as $post) {
$this->renderPostHtml($tpl, $post, $z++, self::MODE_EXPORT_CLIENT);
}
$tpl->setCurrentBlock('thread_headline');
$tpl->setVariable('T_TITLE', $topic->getSubject());
if ($this->is_moderator) {
$tpl->setVariable('T_NUM_POSTS', $topic->countPosts());
} else {
$tpl->setVariable('T_NUM_POSTS', $topic->countActivePosts());
}
$tpl->setVariable('T_NUM_VISITS', $topic->getVisits());
$tpl->setVariable('T_FORUM', $thread_data['top_name']);
$authorinfo = new ilForumAuthorInformation($topic->getThrAuthorId(), $topic->getDisplayUserId(), $topic->getUserAlias(), $topic->getImportName());
$tpl->setVariable('T_AUTHOR', $authorinfo->getAuthorName());
$tpl->setVariable('T_TXT_FORUM', $lng->txt('forum') . ': ');
$tpl->setVariable('T_TXT_TOPIC', $lng->txt('forums_thread') . ': ');
$tpl->setVariable('T_TXT_AUTHOR', $lng->txt('forums_thread_create_from') . ': ');
$tpl->setVariable('T_TXT_NUM_POSTS', $lng->txt('forums_articles') . ': ');
$tpl->setVariable('T_TXT_NUM_VISITS', $lng->txt('visits') . ': ');
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock('thread_block');
$tpl->parseCurrentBlock();
}
ilUtil::deliverData($tpl->get('DEFAULT', false, false, false, true, false, false), 'forum_html_export_' . $_GET['ref_id'] . '.html');
}
示例5: send_paragraph
function send_paragraph($par_id, $filename)
{
$this->builddom();
$mydom = $this->dom;
$xpc = xpath_new_context($mydom);
//$path = "//PageContent[position () = $par_id]/Paragraph";
//$path = "//Paragraph[$par_id]";
$path = "/descendant::Paragraph[position() = {$par_id}]";
$res =& xpath_eval($xpc, $path);
if (count($res->nodeset) != 1) {
die("Should not happen");
}
$context_node = $res->nodeset[0];
// get plain text
$childs = $context_node->child_nodes();
for ($j = 0; $j < count($childs); $j++) {
$content .= $mydom->dump_node($childs[$j]);
}
$content = str_replace("<br />", "\n", $content);
$content = str_replace("<br/>", "\n", $content);
$plain_content = html_entity_decode($content);
ilUtil::deliverData($plain_content, $filename);
/*
$file_type = "application/octet-stream";
header("Content-type: ".$file_type);
header("Content-disposition: attachment; filename=\"$filename\"");
echo $plain_content;*/
exit;
}
示例6: deliverPDFfromFO
/**
* Delivers a PDF file from a XSL-FO string
*
* @param string $fo The XSL-FO string
* @access public
*/
public function deliverPDFfromFO($fo, $title = null)
{
global $ilLog;
include_once "./Services/Utilities/classes/class.ilUtil.php";
$fo_file = ilUtil::ilTempnam() . ".fo";
$fp = fopen($fo_file, "w");
fwrite($fp, $fo);
fclose($fp);
include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
try {
$pdf_base64 = ilRpcClientFactory::factory('RPCTransformationHandler')->ilFO2PDF($fo);
$filename = strlen($title) ? $title : $this->getTitle();
ilUtil::deliverData($pdf_base64->scalar, ilUtil::getASCIIFilename($filename) . ".pdf", "application/pdf", false, true);
return true;
} catch (XML_RPC2_FaultException $e) {
$ilLog->write(__METHOD__ . ': ' . $e->getMessage());
return false;
} catch (Exception $e) {
$ilLog->write(__METHOD__ . ': ' . $e->getMessage());
return false;
}
/*
include_once "./Services/Transformation/classes/class.ilFO2PDF.php";
$fo2pdf = new ilFO2PDF();
$fo2pdf->setFOString($fo);
$result = $fo2pdf->send();
$filename = (strlen($title)) ? $title : $this->getTitle();
ilUtil::deliverData($result, ilUtil::getASCIIFilename($filename) . ".pdf", "application/pdf", false, true);
*/
}
示例7: exportReleased
/**
* export released
*
* @access protected
* @return
*/
protected function exportReleased()
{
global $ilObjDataCache;
include_once './Services/WebServices/ECS/classes/class.ilECSExport.php';
$exported = ilECSExport::getExportedIds();
$ilObjDataCache->preloadObjectCache($exported);
include_once 'Services/Utilities/classes/class.ilCSVWriter.php';
$writer = new ilCSVWriter();
$writer->addColumn($this->lng->txt('title'));
$writer->addColumn($this->lng->txt('description'));
$writer->addColumn($this->lng->txt('ecs_field_courseID'));
$writer->addColumn($this->lng->txt('ecs_field_term'));
$writer->addColumn($this->lng->txt('ecs_field_lecturer'));
$writer->addColumn($this->lng->txt('ecs_field_courseType'));
$writer->addColumn($this->lng->txt('ecs_field_semester_hours'));
$writer->addColumn($this->lng->txt('ecs_field_credits'));
$writer->addColumn($this->lng->txt('ecs_field_room'));
$writer->addColumn($this->lng->txt('ecs_field_cycle'));
$writer->addColumn($this->lng->txt('ecs_field_begin'));
$writer->addColumn($this->lng->txt('ecs_field_end'));
$writer->addColumn($this->lng->txt('last_update'));
include_once './Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
$settings = ilECSDataMappingSettings::_getInstance();
foreach ($exported as $obj_id) {
include_once './Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php';
$values = ilAdvancedMDValues::_getValuesByObjId($obj_id);
$writer->addRow();
$writer->addColumn(ilObject::_lookupTitle($obj_id));
$writer->addColumn(ilObject::_lookupDescription($obj_id));
$field = $settings->getMappingByECSName('courseID');
$writer->addColumn(isset($values[$field]) ? $values[$field] : '');
$field = $settings->getMappingByECSName('term');
$writer->addColumn(isset($values[$field]) ? $values[$field] : '');
$field = $settings->getMappingByECSName('lecturer');
$writer->addColumn(isset($values[$field]) ? $values[$field] : '');
$field = $settings->getMappingByECSName('courseType');
$writer->addColumn(isset($values[$field]) ? $values[$field] : '');
$field = $settings->getMappingByECSName('semester_hours');
$writer->addColumn(isset($values[$field]) ? $values[$field] : '');
$field = $settings->getMappingByECSName('credits');
$writer->addColumn(isset($values[$field]) ? $values[$field] : '');
$field = $settings->getMappingByECSName('room');
$writer->addColumn(isset($values[$field]) ? $values[$field] : '');
$field = $settings->getMappingByECSName('cycle');
$writer->addColumn(isset($values[$field]) ? $values[$field] : '');
$field = $settings->getMappingByECSName('begin');
$writer->addColumn(isset($values[$field]) ? ilFormat::formatUnixTime($values[$field], true) : '');
$field = $settings->getMappingByECSName('end');
$writer->addColumn(isset($values[$field]) ? ilFormat::formatUnixTime($values[$field], true) : '');
$writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
}
ilUtil::deliverData($writer->getCSVString(), date("Y_m_d") . "_ecs_export.csv", "text/csv");
}
示例8: downloadJavaServerIniObject
/**
* Create and offer server ini file for download
* @return
*/
protected function downloadJavaServerIniObject()
{
$this->initJavaServerIniForm();
if ($this->form->checkInput()) {
include_once './Services/WebServices/RPC/classes/class.ilRpcIniFileWriter.php';
$ini = new ilRpcIniFileWriter();
$ini->setHost($this->form->getInput('ho'));
$ini->setPort($this->form->getInput('po'));
$ini->setIndexPath($this->form->getInput('in'));
$ini->setLogPath($this->form->getInput('lo'));
$ini->setLogLevel($this->form->getInput('le'));
$ini->setNumThreads($this->form->getInput('cp'));
$ini->setMaxFileSize($this->form->getInput('fs'));
$ini->write();
ilUtil::deliverData($ini->getIniString(), 'ilServer.ini', 'text/plain', 'utf-8');
return true;
}
$this->form->setValuesByPost();
ilUtil::sendFailure($this->lng->txt('err_check_input'));
$this->setGeneralSettingsSubTabs('java_server');
$this->tpl->setContent($this->form->getHTML());
return true;
}
示例9: createPreview
/**
* Creates a PDF preview of the XSL-FO certificate
*/
public function createPreview()
{
global $ilLog;
ilDatePresentation::setUseRelativeDates(false);
$xslfo = file_get_contents($this->getXSLPath());
include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
try {
$pdf_base64 = ilRpcClientFactory::factory('RPCTransformationHandler')->ilFO2PDF($this->exchangeCertificateVariables($xslfo));
ilUtil::deliverData($pdf_base64->scalar, $this->getAdapter()->getCertificateFilename(), "application/pdf");
} catch (XML_RPC2_FaultException $e) {
$ilLog->write(__METHOD__ . ': ' . $e->getMessage());
return false;
} catch (Exception $e) {
$ilLog->write(__METHOD__ . ': ' . $e->getMessage());
return false;
}
ilDatePresentation::setUseRelativeDates(true);
/*
include_once "./Services/Transformation/classes/class.ilFO2PDF.php";
$fo2pdf = new ilFO2PDF();
$fo2pdf->setFOString($this->exchangeCertificateVariables($xslfo));
$result = $fo2pdf->send();
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::deliverData($result, $this->getAdapter()->getCertificateFilename(), "application/pdf");
*/
}
示例10: exportNotesHTML
/**
* export selected notes to html
*/
function exportNotesHTML()
{
$tpl = new ilTemplate("tpl.main.html", true, true);
$this->export_html = true;
$this->multi_selection = false;
$tpl->setVariable("CONTENT", $this->getNotesHTML());
ilUtil::deliverData($tpl->get(), "notes.html");
}
示例11: exportCodes
function exportCodes()
{
global $ilAccess, $ilErr, $lng;
if (!$ilAccess->checkAccess('read', '', $this->ref_id)) {
$ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
}
include_once "./Services/User/classes/class.ilAccountCodesTableGUI.php";
$utab = new ilAccountCodesTableGUI($this, "listCodes");
include_once './Services/User/classes/class.ilAccountCode.php';
$codes = ilAccountCode::getCodesForExport($utab->filter["code"], $utab->filter["valid_until"], $utab->filter["generated"]);
if (sizeof($codes)) {
// #13497
ilUtil::deliverData(implode("\r\n", $codes), "ilias_account_codes_" . date("d-m-Y") . ".txt", "text/plain");
} else {
ilUtil::sendFailure($lng->txt("account_export_codes_no_data"));
$this->listCodes();
}
}
示例12: export
/**
* export bookmarks
*/
function export($deliver = true)
{
$bm_ids = $_GET['bm_id'] ? array($_GET['bm_id']) : $_POST['bm_id'];
if (!$bm_ids) {
$this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
}
$export_ids = array();
foreach ($bm_ids as $id) {
if ($this->tree->isInTree($id)) {
//list($type, $obj_id) = explode(":", $id);
//$export_ids[]=$obj_id;
$export_ids[] = $id;
}
}
require_once "./Services/Bookmarks/classes/class.ilBookmarkImportExport.php";
$html_content = ilBookmarkImportExport::_exportBookmark($export_ids, true, $this->lng->txt("bookmarks_of") . " " . $this->ilias->account->getFullname());
if ($deliver) {
ilUtil::deliverData($html_content, 'bookmarks.html', "application/save", $charset = "");
} else {
return $html_content;
}
}
示例13: exportCodes
public function exportCodes()
{
$codes = $this->coupon_obj->getCodesByCouponId($_GET["coupon_id"]);
if (is_array($codes)) {
include_once './Services/Utilities/classes/class.ilCSVWriter.php';
$csv = new ilCSVWriter();
$csv->setDelimiter("");
foreach ($codes as $data) {
if ($data["pcc_code"]) {
$csv->addColumn($data["pcc_code"]);
$csv->addRow();
}
}
ilUtil::deliverData($csv->getCSVString(), "code_export_" . date("Ymdhis") . ".csv");
}
$this->showCodes();
return true;
}
示例14: exportHTML
/**
* Export to HTML.
*
*/
function exportHTML()
{
global $lng, $tpl, $ilUser, $ilAccess, $ilias;
if (!$ilAccess->checkAccess('read,visible', '', $_GET['ref_id'])) {
$ilias->raiseError($lng->txt('permission_denied'), $ilias->error_obj->MESSAGE);
}
$tplEx = new ilTemplate('tpl.forums_export_html.html', true, true, 'Modules/Forum');
// threads
//for ($j = 0; $j < count($_POST['forum_id']); $j++)
for ($j = 0; $j < count($_POST['thread_ids']); $j++) {
//$objCurrentTopic = new ilForumTopic(addslashes($_POST['forum_id'][$j]), $ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']));
$objCurrentTopic = new ilForumTopic(addslashes($_POST['thread_ids'][$j]), $ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']));
// get forum- and thread-data
$this->frm->setMDB2WhereCondition('top_pk = %s ', array('integer'), array($objCurrentTopic->getForumId()));
if (is_array($frmData = $this->frm->getOneTopic())) {
$objFirstPostNode = $objCurrentTopic->getFirstPostNode();
$objCurrentTopic->setOrderField('frm_posts_tree.rgt');
$postTree = $objCurrentTopic->getPostTree($objFirstPostNode);
$posNum = count($postTree);
$z = 0;
foreach ($postTree as $post) {
$tplEx->setCurrentBlock('posts_row');
$rowCol = ilUtil::switchColor($z++, 'tblrow2', 'tblrow1');
$tplEx->setVariable('ROWCOL', $rowCol);
$authorinfo = new ilForumAuthorInformation($post->getUserId(), $post->getUserAlias(), $post->getImportName());
$tplEx->setVariable('AUTHOR', $authorinfo->getAuthorName());
if ($post->getUserId()) {
// get create- and update-dates
if ($post->getUpdateUserId()) {
$authorinfo = new ilForumAuthorInformation($post->getUpdateUserId(), '', '');
$tplEx->setVariable('POST_UPDATE', "<br />[" . $lng->txt('edited_on') . ": " . $this->frm->convertDate($post->getChangeDate()) . " - " . strtolower($lng->txt('from')) . " " . $authorinfo->getAuthorName() . "]");
}
if ($authorinfo->getAuthor()->getPref('public_profile') != 'n') {
$tplEx->setVariable('TXT_REGISTERED', $lng->txt('registered_since'));
$tplEx->setVariable('REGISTERED_SINCE', $this->frm->convertDate($authorinfo->getAuthor()->getCreateDate()));
}
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id'])) {
$numPosts = $this->frm->countUserArticles($post->getUserId());
} else {
$numPosts = $this->frm->countActiveUserArticles($post->getUserId());
}
$tplEx->setVariable('TXT_NUM_POSTS', $lng->txt('forums_posts'));
$tplEx->setVariable('NUM_POSTS', $numPosts);
}
$tplEx->setVariable('SUBJECT', $post->getSubject());
$tplEx->setVariable('TXT_CREATE_DATE', $lng->txt('forums_thread_create_date'));
$tplEx->setVariable('POST_DATE', $this->frm->convertDate($post->getCreateDate()));
$tplEx->setVariable('SPACER', "<hr noshade width=\"100%\" size=\"1\" align=\"center\" />");
if ($post->isCensored()) {
$tplEx->setVariable('POST', nl2br(stripslashes($post->getCensorshipComment())));
} else {
/** @todo mjansen: possible bugfix for mantis #8223 */
if ($post->getMessage() == strip_tags($post->getMessage())) {
// We can be sure, that there are not html tags
$post->setMessage(nl2br($post->getMessage()));
}
$tplEx->setVariable('POST', ilRTE::_replaceMediaObjectImageSrc($this->frm->prepareText($post->getMessage(), 0, '', 'export'), 1));
}
$tplEx->parseCurrentBlock('posts_row');
unset($author);
}
// foreach ($postTree as $post)
$tplEx->setCurrentBlock('posttable');
$tplEx->setVariable('TXT_AUTHOR', $lng->txt('author'));
$tplEx->setVariable('TXT_POST', $lng->txt('forums_thread') . ': ' . $objCurrentTopic->getSubject());
$tplEx->parseCurrentBlock('posttable');
// Thread Headline
$tplEx->setCurrentBlock('thread_headline');
$tplEx->setVariable('T_TITLE', $objCurrentTopic->getSubject());
if ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id'])) {
$tplEx->setVariable('T_NUM_POSTS', $objCurrentTopic->countPosts());
} else {
$tplEx->setVariable('T_NUM_POSTS', $objCurrentTopic->countActivePosts());
}
$tplEx->setVariable('T_NUM_VISITS', $objCurrentTopic->getVisits());
$tplEx->setVariable('T_FORUM', $frmData['top_name']);
$authorinfo = new ilForumAuthorInformation($objCurrentTopic->getUserId(), $objCurrentTopic->getUserAlias(), $objCurrentTopic->getImportName());
$tplEx->setVariable('T_AUTHOR', $authorinfo->getAuthorName());
$tplEx->setVariable('T_TXT_FORUM', $lng->txt('forum') . ': ');
$tplEx->setVariable('T_TXT_TOPIC', $lng->txt('forums_thread') . ': ');
$tplEx->setVariable('T_TXT_AUTHOR', $lng->txt('forums_thread_create_from') . ': ');
$tplEx->setVariable('T_TXT_NUM_POSTS', $lng->txt('forums_articles') . ': ');
$tplEx->setVariable('T_TXT_NUM_VISITS', $lng->txt('visits') . ': ');
$tplEx->parseCurrentBlock('thread_headline');
$tplEx->setCurrentBlock('thread_block');
$tplEx->parseCurrentBlock('thread_block');
$tplEx->setCurrentBlock('forum_block');
$tplEx->parseCurrentBlock('forum_block');
}
// if (is_array($frmData = $this->frm->getOneTopic()))
}
// for ($j = 0; $j < count($_POST["forum_id"]); $j++)
ilUtil::deliverData($tplEx->get(), 'forum_html_export_' . $_GET['ref_id'] . '.html');
exit;
}
示例15: downloadXml
/**
* Command: Download an xml file (accounts or booking)
*
* The file type is given in $_GET['xmltype']
* The part ID is given in $_GET['part_id']
*/
protected function downloadXml()
{
switch ($_GET['xmltype']) {
case 'accounts':
$file = $this->object->getAccountsXML();
$filename = 'accounts' . $this->object->getId() . '.xml';
break;
case 'booking':
$part_obj = $this->object->getPart($_GET['part_id']);
$file = $part_obj->getBookingXML();
$filename = 'booking' . $part_obj->getPartId() . '.xml';
break;
default:
$this->editQuestion();
return;
}
ilUtil::deliverData($file, $filename, 'text/xml', false);
}