本文整理汇总了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;
}
示例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);
示例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;
}