本文整理汇总了PHP中getPrintableHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP getPrintableHeader函数的具体用法?PHP getPrintableHeader怎么用?PHP getPrintableHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getPrintableHeader函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: db_execute_assoc
$degresult = db_execute_assoc($degquery);
if (!isset($surveyfaxto) || !$surveyfaxto and isset($surveyfaxnumber)) {
$surveyfaxto = $surveyfaxnumber;
//Use system fax number if none is set in survey.
}
$pdf_form = '';
if (isset($usepdfexport) && $usepdfexport == 1 && !in_array($surveyprintlang, $notsupportlanguages)) {
$pdf_form = '
<form action="' . $scriptname . '?action=showprintablesurvey&sid=' . $surveyid . '&lang=' . $surveyprintlang . '" method="post">
<input type="submit" value="' . $clang->gT('PDF Export') . '"/>
<input type="hidden" name="checksessionbypost" value="' . htmlspecialchars($_SESSION['checksessionpost']) . '"/>
<input type="hidden" name="printableexport" value="true"/>
</form>
';
}
$headelements = getPrintableHeader();
//if $showsgqacode is enabled at config.php show table name for reference
if (isset($showsgqacode) && $showsgqacode == true) {
$surveyname = $surveyname . "<br />[" . $clang->gT('Database') . " " . $clang->gT('table') . ": {$surveytable}]";
} else {
$surveyname = "";
}
$survey_output = array('SITENAME' => $sitename, 'SURVEYNAME' => $surveyname, 'SURVEYDESCRIPTION' => $surveydesc, 'WELCOME' => $welcome, 'END' => $end, 'THEREAREXQUESTIONS' => 0, 'SUBMIT_TEXT' => $clang->gT("Submit Your Survey."), 'SUBMIT_BY' => $surveyexpirydate, 'THANKS' => $clang->gT("Thank you for completing this survey."), 'PDF_FORM' => $pdf_form, 'HEADELEMENTS' => $headelements, 'TEMPLATEURL' => PRINT_TEMPLATE_URL, 'FAXTO' => $surveyfaxto, 'PRIVACY' => '', 'GROUPS' => '');
$survey_output['FAX_TO'] = '';
if (!empty($surveyfaxto) && $surveyfaxto != '000-00000000') {
$survey_output['FAX_TO'] = $clang->gT("Please fax your completed survey to:") . " {$surveyfaxto}";
}
if ($surveystartdate != '') {
$survey_output['SUBMIT_BY'] = sprintf($clang->gT("Please submit by %s"), $surveyexpirydate);
}
/**
开发者ID:karime7gezly,项目名称:OpenConextApps-LimeSurvey,代码行数:31,代码来源:printablesurvey.php
示例2: _initialise
//.........这里部分代码省略.........
foreach ($Load as $qs) {
$files[] = array("name" => $qs);
}
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/startpage.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/load.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/endpage.pstpl"), array(), $aData);
$myoutput[] = "\n";
break;
case 'clearall':
unset($files);
foreach ($Clearall as $qs) {
$files[] = array("name" => $qs);
}
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/startpage.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/clearall.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/endpage.pstpl"), array(), $aData);
$myoutput[] = "\n";
break;
case 'completed':
unset($files);
$myoutput[] = "";
foreach ($CompletedTemplate as $qs) {
$files[] = array("name" => $qs);
$myoutput = array_merge($myoutput, doreplacement(getTemplatePath($templatename) . "/{$qs}", $aData));
}
break;
case 'printablesurvey':
unset($files);
foreach ($printablesurveytemplate as $qs) {
$files[] = array("name" => $qs);
}
$questionoutput = array();
foreach (file("{$templatedir}/print_question.pstpl") as $op) {
$questionoutput[] = templatereplace($op, array('QUESTION_NUMBER' => '1', 'QUESTION_CODE' => 'Q1', 'QUESTION_MANDATORY' => $clang->gT('*'), 'QUESTION_SCENARIO' => 'Only answer this if certain conditions are met.', 'QUESTION_CLASS' => ' mandatory list-radio', 'QUESTION_TYPE_HELP' => $clang->gT('Please choose *only one* of the following:'), 'QUESTION_MAN_MESSAGE' => '', 'QUESTION_VALID_MESSAGE' => '', 'QUESTION_FILE_VALID_MESSAGE' => '', 'QUESTION_TEXT' => $clang->gT('This is a sample question text. The user was asked to pick an entry.'), 'QUESTIONHELP' => $clang->gT('This is some help text for this question.'), 'ANSWER' => $this->getController()->render('/admin/templates/templateeditor_printablesurvey_quesanswer_view', array('templateurl' => $templateurl, 'clang' => $clang), true)), $aData);
}
$groupoutput = array();
$groupoutput[] = templatereplace(file_get_contents("{$templatedir}/print_group.pstpl"), array('QUESTIONS' => implode(' ', $questionoutput)), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/print_survey.pstpl"), array('GROUPS' => implode(' ', $groupoutput), 'FAX_TO' => $clang->gT("Please fax your completed survey to:") . " 000-000-000", 'SUBMIT_TEXT' => $clang->gT("Submit your survey."), 'HEADELEMENTS' => getPrintableHeader(), 'SUBMIT_BY' => sprintf($clang->gT("Please submit by %s"), date('d.m.y')), 'THANKS' => $clang->gT('Thank you for completing this survey.'), 'END' => $clang->gT('This is the survey end message.')), $aData);
break;
case 'printanswers':
unset($files);
foreach ($printtemplate as $qs) {
$files[] = array("name" => $qs);
}
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/startpage.pstpl"), array(), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/printanswers.pstpl"), array('ANSWERTABLE' => $printoutput), $aData);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/endpage.pstpl"), array(), $aData);
$myoutput[] = "\n";
break;
}
$myoutput[] = "</html>";
if (is_array($files)) {
$match = 0;
foreach ($files as $f) {
if ($editfile == $f["name"]) {
$match = 1;
}
}
foreach ($cssfiles as $f) {
if ($editfile == $f["name"]) {
$match = 1;
}
}
if ($match == 0) {
if (count($files) > 0) {
$editfile = $files[0]["name"];
} else {
$editfile = "";
}
}
}
// Get list of 'otherfiles'
$otherfiles = array();
if ($handle = opendir($templatedir)) {
while (false !== ($file = readdir($handle))) {
if (!array_search($file, $normalfiles)) {
if (!is_dir($templatedir . DIRECTORY_SEPARATOR . $file)) {
$otherfiles[] = array("name" => $file);
}
}
}
closedir($handle);
}
$aData['clang'] = $this->getController()->lang;
$aData['codelanguage'] = $codelanguage;
$aData['highlighter'] = $highlighter;
$aData['screens'] = $screens;
$aData['templatename'] = $templatename;
$aData['templates'] = $templates;
$aData['editfile'] = $editfile;
$aData['screenname'] = $screenname;
$aData['tempdir'] = Yii::app()->getConfig('tempdir');
$aData['usertemplaterootdir'] = Yii::app()->getConfig('usertemplaterootdir');
$aViewUrls['templateeditorbar_view'][] = $aData;
if ($showsummary) {
$aViewUrls = array_merge($aViewUrls, $this->_templatesummary($templatename, $screenname, $editfile, $templates, $files, $cssfiles, $otherfiles, $myoutput));
}
App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('adminscripts') . 'admin_core.js');
return $aViewUrls;
}
开发者ID:Narasimman,项目名称:UrbanExpansion,代码行数:101,代码来源:templates.php
示例3: _initialise
//.........这里部分代码省略.........
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/load.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/endpage.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate);
$myoutput[] = "\n";
break;
case 'clearall':
unset($files);
foreach ($Clearall as $qs) {
$files[] = array("name" => $qs);
}
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/startpage.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/clearall.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/endpage.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate);
$myoutput[] = "\n";
break;
case 'completed':
unset($files);
$myoutput[] = "";
foreach ($CompletedTemplate as $qs) {
$files[] = array("name" => $qs);
$myoutput = array_merge($myoutput, doreplacement($oEditedTemplate->viewPath . "/{$qs}", $aData, $oEditedTemplate));
}
break;
case 'printablesurvey':
unset($files);
foreach ($printablesurveytemplate as $qs) {
$files[] = array("name" => $qs);
}
$questionoutput = array();
foreach (file("{$templatedir}/print_question.pstpl") as $op) {
$questionoutput[] = templatereplace($op, array('QUESTION_NUMBER' => '1', 'QUESTION_CODE' => 'Q1', 'QUESTION_MANDATORY' => gT('*'), 'QUESTION_SCENARIO' => 'Only answer this if certain conditions are met.', 'QUESTION_CLASS' => ' mandatory list-radio', 'QUESTION_TYPE_HELP' => gT('Please choose *only one* of the following:'), 'QUESTION_MAN_MESSAGE' => '', 'QUESTION_VALID_MESSAGE' => '', 'QUESTION_FILE_VALID_MESSAGE' => '', 'QUESTION_TEXT' => gT('This is a sample question text. The user was asked to pick an entry.'), 'QUESTIONHELP' => gT('This is some help text for this question.'), 'ANSWER' => $this->getController()->render('/admin/templates/templateeditor_printablesurvey_quesanswer_view', array('templateurl' => $templateurl), true)), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate);
}
$groupoutput = array();
$groupoutput[] = templatereplace(file_get_contents("{$templatedir}/print_group.pstpl"), array('QUESTIONS' => implode(' ', $questionoutput)), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/print_survey.pstpl"), array('GROUPS' => implode(' ', $groupoutput), 'FAX_TO' => gT("Please fax your completed survey to:") . " 000-000-000", 'SUBMIT_TEXT' => gT("Submit your survey."), 'HEADELEMENTS' => getPrintableHeader(), 'SUBMIT_BY' => sprintf(gT("Please submit by %s"), date('d.m.y')), 'THANKS' => gT('Thank you for completing this survey.'), 'END' => gT('This is the survey end message.')), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate);
break;
case 'printanswers':
unset($files);
foreach ($printtemplate as $qs) {
$files[] = array("name" => $qs);
}
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/startpage.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/printanswers.pstpl"), array('ANSWERTABLE' => $printoutput), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate);
$myoutput[] = templatereplace(file_get_contents("{$templatedir}/endpage.pstpl"), array(), $aData, 'Unspecified', false, NULL, array(), false, $oEditedTemplate);
$myoutput[] = "\n";
break;
}
$myoutput[] = "</html>";
$jsfiles = $this->_getEditableJsFiles($oEditedTemplate);
if (is_array($files)) {
$match = 0;
foreach ($files as $f) {
if ($editfile == $f["name"]) {
$match = 1;
}
}
$aCssAndJsfiles = array_merge($cssfiles, $jsfiles);
foreach ($aCssAndJsfiles as $f) {
if ($editfile == $f["name"]) {
$match = 1;
}
}
if ($match == 0) {
if (count($files) > 0) {
$editfile = $files[0]["name"];
} else {
$editfile = "";
开发者ID:kochichi,项目名称:LimeSurvey,代码行数:67,代码来源:templates.php
示例4: index
/**
* Show printable survey
*/
function index($surveyid, $lang = null)
{
$surveyid = sanitize_int($surveyid);
if (!Permission::model()->hasSurveyPermission($surveyid, 'surveycontent', 'read')) {
$aData['surveyid'] = $surveyid;
App()->getClientScript()->registerPackage('jquery-superfish');
$message['title'] = gT('Access denied!');
$message['message'] = gT('You do not have sufficient rights to access this page.');
$message['class'] = "error";
$this->_renderWrappedTemplate('survey', array("message" => $message), $aData);
} else {
$aSurveyInfo = getSurveyInfo($surveyid, $lang);
if (!$aSurveyInfo) {
$this->getController()->error('Invalid survey ID');
}
SetSurveyLanguage($surveyid, $lang);
$sLanguageCode = App()->language;
$templatename = $aSurveyInfo['template'];
$welcome = $aSurveyInfo['surveyls_welcometext'];
$end = $aSurveyInfo['surveyls_endtext'];
$surveyname = $aSurveyInfo['surveyls_title'];
$surveydesc = $aSurveyInfo['surveyls_description'];
$surveyactive = $aSurveyInfo['active'];
$surveytable = "{{survey_" . $aSurveyInfo['sid'] . "}}";
$surveyexpirydate = $aSurveyInfo['expires'];
$surveyfaxto = $aSurveyInfo['faxto'];
$dateformattype = $aSurveyInfo['surveyls_dateformat'];
Yii::app()->loadHelper('surveytranslator');
if (!is_null($surveyexpirydate)) {
$dformat = getDateFormatData($dateformattype);
$dformat = $dformat['phpdate'];
$expirytimestamp = strtotime($surveyexpirydate);
$expirytimeofday_h = date('H', $expirytimestamp);
$expirytimeofday_m = date('i', $expirytimestamp);
$surveyexpirydate = date($dformat, $expirytimestamp);
if (!empty($expirytimeofday_h) || !empty($expirytimeofday_m)) {
$surveyexpirydate .= ' – ' . $expirytimeofday_h . ':' . $expirytimeofday_m;
}
sprintf(gT("Please submit by %s"), $surveyexpirydate);
} else {
$surveyexpirydate = '';
}
//Fix $templatename : control if print_survey.pstpl exist
if (is_file(getTemplatePath($templatename) . DIRECTORY_SEPARATOR . 'print_survey.pstpl')) {
$templatename = $templatename;
// Change nothing
} elseif (is_file(getTemplatePath(Yii::app()->getConfig("defaulttemplate")) . DIRECTORY_SEPARATOR . 'print_survey.pstpl')) {
$templatename = Yii::app()->getConfig("defaulttemplate");
} else {
$templatename = "default";
}
$sFullTemplatePath = getTemplatePath($templatename) . DIRECTORY_SEPARATOR;
$sFullTemplateUrl = getTemplateURL($templatename) . "/";
define('PRINT_TEMPLATE_DIR', $sFullTemplatePath, true);
define('PRINT_TEMPLATE_URL', $sFullTemplateUrl, true);
LimeExpressionManager::StartSurvey($surveyid, 'survey', NULL, false, LEM_PRETTY_PRINT_ALL_SYNTAX);
$moveResult = LimeExpressionManager::NavigateForwards();
$condition = "sid = '{$surveyid}' AND language = '{$sLanguageCode}'";
$degresult = QuestionGroup::model()->getAllGroups($condition, array('group_order'));
//xiao,
if (!isset($surveyfaxto) || !$surveyfaxto and isset($surveyfaxnumber)) {
$surveyfaxto = $surveyfaxnumber;
//Use system fax number if none is set in survey.
}
$headelements = getPrintableHeader();
//if $showsgqacode is enabled at config.php show table name for reference
$showsgqacode = Yii::app()->getConfig("showsgqacode");
if (isset($showsgqacode) && $showsgqacode == true) {
$surveyname = $surveyname . "<br />[" . gT('Database') . " " . gT('table') . ": {$surveytable}]";
} else {
$surveyname = $surveyname;
}
$survey_output = array('SITENAME' => Yii::app()->getConfig("sitename"), 'SURVEYNAME' => $surveyname, 'SURVEYDESCRIPTION' => $surveydesc, 'WELCOME' => $welcome, 'END' => $end, 'THEREAREXQUESTIONS' => 0, 'SUBMIT_TEXT' => gT("Submit Your Survey."), 'SUBMIT_BY' => $surveyexpirydate, 'THANKS' => gT("Thank you for completing this survey."), 'HEADELEMENTS' => $headelements, 'TEMPLATEURL' => PRINT_TEMPLATE_URL, 'FAXTO' => $surveyfaxto, 'PRIVACY' => '', 'GROUPS' => '');
$survey_output['FAX_TO'] = '';
if (!empty($surveyfaxto) && $surveyfaxto != '000-00000000') {
$survey_output['FAX_TO'] = gT("Please fax your completed survey to:") . " {$surveyfaxto}";
}
$total_questions = 0;
$mapquestionsNumbers = array();
$answertext = '';
// otherwise can throw an error on line 1617
$fieldmap = createFieldMap($surveyid, 'full', false, false, $sLanguageCode);
// =========================================================
// START doin the business:
foreach ($degresult->readAll() as $degrow) {
// ---------------------------------------------------
// START doing groups
$deqresult = Question::model()->getQuestions($surveyid, $degrow['gid'], $sLanguageCode, 0, '"I"');
$deqrows = array();
//Create an empty array in case FetchRow does not return any rows
foreach ($deqresult->readAll() as $deqrow) {
$deqrows[] = $deqrow;
}
// Get table output into array
// Perform a case insensitive natural sort on group name then question title of a multidimensional array
usort($deqrows, 'groupOrderThenQuestionOrder');
if ($degrow['description']) {
//.........这里部分代码省略.........
开发者ID:wrenchpilot,项目名称:LimeSurvey,代码行数:101,代码来源:printablesurvey.php
示例5: array
<img src="' . $templateurl . '/print_img_radio.png" alt="First choice" class="input-radio" height="14" width="14">First choice
</li>
<li>
<img src="' . $templateurl . '/print_img_radio.png" alt="Second choice" class="input-radio" height="14" width="14">Second choice
</li>
<li>
<img src="' . $templateurl . '/print_img_radio.png" alt="Third choice" class="input-radio" height="14" width="14">Third choice
</li>
</ul>'));
}
$groupoutput = array();
foreach (file("{$templatedir}/print_group.pstpl") as $op) {
$groupoutput[] = templatereplace($op, array('QUESTIONS' => implode(' ', $questionoutput)));
}
foreach (file("{$templatedir}/print_survey.pstpl") as $op) {
$myoutput[] = templatereplace($op, array('GROUPS' => implode(' ', $groupoutput), 'FAX_TO' => $clang->gT("Please fax your completed survey to:") . " 000-000-000", 'SUBMIT_TEXT' => $clang->gT("Submit your survey."), 'HEADELEMENTS' => getPrintableHeader(), 'SUBMIT_BY' => sprintf($clang->gT("Please submit by %s"), date('d.m.y')), 'THANKS' => $clang->gT('Thank you for completing this survey.'), 'END' => $clang->gT('This is the survey end message.')));
}
break;
case 'printanswers':
unset($files);
foreach ($printtemplate as $qs) {
$files[] = array("name" => $qs);
}
foreach (file("{$templatedir}/startpage.pstpl") as $op) {
$myoutput[] = templatereplace($op);
}
foreach (file("{$templatedir}/printanswers.pstpl") as $op) {
$myoutput[] = templatereplace($op, array('ANSWERTABLE' => $printoutput));
}
foreach (file("{$templatedir}/endpage.pstpl") as $op) {
$myoutput[] = templatereplace($op);
开发者ID:himanshu12k,项目名称:ce-www,代码行数:31,代码来源:templates.php
注:本文中的getPrintableHeader函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论