本文整理汇总了PHP中getXMLWriter函数的典型用法代码示例。如果您正苦于以下问题:PHP getXMLWriter函数的具体用法?PHP getXMLWriter怎么用?PHP getXMLWriter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getXMLWriter函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: dumplabel
public function dumplabel()
{
$lid = sanitize_int(Yii::app()->request->getParam('lid'));
// DUMP THE RELATED DATA FOR A SINGLE QUESTION INTO A SQL FILE FOR IMPORTING LATER ON OR
// ON ANOTHER SURVEY SETUP DUMP ALL DATA WITH RELATED QID FROM THE FOLLOWING TABLES
// 1. questions
// 2. answers
$lids = returnGlobal('lids');
if (!$lid && !$lids) {
die('No LID has been provided. Cannot dump label set.');
}
if ($lid) {
$lids = array($lid);
}
$lids = array_map('sanitize_int', $lids);
$fn = "limesurvey_labelset_" . implode('_', $lids) . ".lsl";
$xml = getXMLWriter();
$this->_addHeaders($fn, "text/html/force-download", "Mon, 26 Jul 1997 05:00:00 GMT", "cache");
$xml->openURI('php://output');
$xml->setIndent(TRUE);
$xml->startDocument('1.0', 'UTF-8');
$xml->startElement('document');
$xml->writeElement('LimeSurveyDocType', 'Label set');
$xml->writeElement('DBVersion', getGlobalSetting("DBVersion"));
// Label sets table
$lsquery = "SELECT * FROM {{labelsets}} WHERE lid=" . implode(' or lid=', $lids);
buildXMLFromQuery($xml, $lsquery, 'labelsets');
// Labels
$lquery = "SELECT lid, code, title, sortorder, language, assessment_value FROM {{labels}} WHERE lid=" . implode(' or lid=', $lids);
buildXMLFromQuery($xml, $lquery, 'labels');
$xml->endElement();
// close columns
$xml->endDocument();
exit;
}
开发者ID:ryu1inaba,项目名称:LimeSurvey,代码行数:35,代码来源:export.php
示例2: returnglobal
// 1. questions
// 2. answers
//Ensure script is not run directly, avoid path disclosure
include_once "login_check.php";
require_once "export_data_functions.php";
$lids = returnglobal('lids');
$lid = returnglobal('lid');
if (!$lid && !$lids) {
die('No LID has been provided. Cannot dump label set.');
}
if ($lid) {
$lids = array($lid);
}
$lids = array_map('sanitize_int', $lids);
$fn = "limesurvey_labelset_" . implode('_', $lids) . ".lsl";
$xml = getXMLWriter();
header("Content-Type: text/html/force-download");
header("Content-Disposition: attachment; filename={$fn}");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: cache");
// HTTP/1.0
$xml->openURI('php://output');
$xml->setIndent(true);
$xml->startDocument('1.0', 'UTF-8');
$xml->startElement('document');
$xml->writeElement('LimeSurveyDocType', 'Label set');
$xml->writeElement('DBVersion', $dbversionnumber);
getXMLStructure($xml, $lids);
开发者ID:himanshu12k,项目名称:ce-www,代码行数:31,代码来源:dumplabel.php
示例3: questionExport
function questionExport($action, $iSurveyID, $gid, $qid)
{
$fn = "limesurvey_question_{$qid}.lsq";
$xml = getXMLWriter();
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename={$fn}");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: cache");
// HTTP/1.0
$xml->openURI('php://output');
$xml->setIndent(true);
$xml->startDocument('1.0', 'UTF-8');
$xml->startElement('document');
$xml->writeElement('LimeSurveyDocType', 'Question');
$xml->writeElement('DBVersion', getGlobalSetting('DBVersion'));
$xml->startElement('languages');
$aLanguages = Survey::model()->findByPk($iSurveyID)->additionalLanguages;
$aLanguages[] = Survey::model()->findByPk($iSurveyID)->language;
foreach ($aLanguages as $sLanguage) {
$xml->writeElement('language', $sLanguage);
}
$xml->endElement();
questionGetXMLStructure($xml, $gid, $qid);
$xml->endElement();
// close columns
$xml->endDocument();
exit;
}
开发者ID:wrenchpilot,项目名称:LimeSurvey,代码行数:31,代码来源:export_helper.php
注:本文中的getXMLWriter函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论