当前位置: 首页>>代码示例>>PHP>>正文


PHP viewHelper::disableHtmlLogging方法代码示例

本文整理汇总了PHP中viewHelper::disableHtmlLogging方法的典型用法代码示例。如果您正苦于以下问题:PHP viewHelper::disableHtmlLogging方法的具体用法?PHP viewHelper::disableHtmlLogging怎么用?PHP viewHelper::disableHtmlLogging使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在viewHelper的用法示例。


在下文中一共展示了viewHelper::disableHtmlLogging方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getTokens_json


//.........这里部分代码省略.........
     $aData->records = Token::model($iSurveyId)->count($condition);
     if ($limit > $aData->records) {
         $limit = $aData->records;
     }
     if ($limit != 0) {
         $aData->total = ceil($aData->records / $limit);
     } else {
         $aData->total = 0;
     }
     Yii::app()->loadHelper("surveytranslator");
     $format = getDateFormatData(Yii::app()->session['dateformat']);
     $aSurveyInfo = Survey::model()->findByPk($iSurveyId)->getAttributes();
     //Get survey settings
     $attributes = getAttributeFieldNames($iSurveyId);
     // Now find all responses for the visible tokens
     $visibleTokens = array();
     $answeredTokens = array();
     if ($aSurveyInfo['anonymized'] == "N" && $aSurveyInfo['active'] == "Y") {
         foreach ($tokens as $token) {
             if (isset($token['token']) && $token['token']) {
                 $visibleTokens[] = $token['token'];
             }
         }
         $answers = SurveyDynamic::model($iSurveyId)->findAllByAttributes(array('token' => $visibleTokens));
         foreach ($answers as $answer) {
             $answeredTokens[$answer['token']] = $answer['token'];
         }
     }
     $bReadPermission = Permission::model()->hasSurveyPermission($iSurveyId, 'responses', 'read');
     $bCreatePermission = Permission::model()->hasSurveyPermission($iSurveyId, 'responses', 'create');
     $bTokenUpdatePermission = Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'update');
     $bTokenDeletePermission = Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'delete');
     $bGlobalPanelReadPermission = Permission::model()->hasGlobalPermission('participantpanel', 'read');
     foreach ($tokens as $token) {
         $aRowToAdd = array();
         if ((int) $token['validfrom']) {
             $token['validfrom'] = date($format['phpdate'] . ' H:i', strtotime(trim($token['validfrom'])));
         } else {
             $token['validfrom'] = '';
         }
         if ((int) $token['validuntil']) {
             $token['validuntil'] = date($format['phpdate'] . ' H:i', strtotime(trim($token['validuntil'])));
         } else {
             $token['validuntil'] = '';
         }
         $aRowToAdd['id'] = $token['tid'];
         $action = "";
         $action .= "<div class='inputbuttons'>";
         // so we can hide this when edit is clicked
         // Check is we have an answer
         if (in_array($token['token'], $answeredTokens) && $bReadPermission) {
             // @@TODO change link
             $url = $this->getController()->createUrl("admin/responses/sa/browse/surveyid/{$iSurveyId}", array('token' => $token['token']));
             $title = $clang->gT("View response details");
             $action .= CHtml::link(CHtml::image(Yii::app()->getConfig('adminimageurl') . 'token_viewanswer.png', $title, array('title' => $title)), $url, array('class' => 'imagelink'));
         } else {
             $action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
         }
         // Check if the token can be taken
         if ($token['token'] != "" && ($token['completed'] == "N" || $token['completed'] == "" || $aSurveyInfo['alloweditaftercompletion'] == "Y") && $bCreatePermission) {
             $action .= viewHelper::getImageLink('do_16.png', "survey/index/sid/{$iSurveyId}/token/{$token['token']}/lang/{$token['language']}/newtest/Y", $clang->gT("Do survey"), '_blank');
         } else {
             $action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
         }
         if ($bTokenDeletePermission) {
             $attribs = array('onclick' => 'if (confirm("' . $clang->gT("Are you sure you want to delete this entry?") . ' (' . $token['tid'] . ')")) {$("#displaytokens").delRowData(' . $token['tid'] . ');$.post(delUrl,{tid:' . $token['tid'] . '});}');
             $action .= viewHelper::getImageLink('token_delete.png', null, $clang->gT("Delete token entry"), null, 'imagelink btnDelete', $attribs);
         }
         if (strtolower($token['emailstatus']) == 'ok' && $token['email'] && $bTokenUpdatePermission) {
             if ($token['completed'] == 'N' && $token['usesleft'] > 0) {
                 if ($token['sent'] == 'N') {
                     $action .= viewHelper::getImageLink('token_invite.png', "admin/tokens/sa/email/surveyid/{$iSurveyId}/tokenids/" . $token['tid'], $clang->gT("Send invitation email to this person (if they have not yet been sent an invitation email)"), "_blank");
                 } else {
                     $action .= viewHelper::getImageLink('token_remind.png', "admin/tokens/sa/email/action/remind/surveyid/{$iSurveyId}/tokenids/" . $token['tid'], $clang->gT("Send reminder email to this person (if they have already received the invitation email)"), "_blank");
                 }
             } else {
                 $action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
             }
         } else {
             $action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
         }
         if ($bTokenUpdatePermission) {
             $action .= viewHelper::getImageLink('edit_16.png', null, $clang->gT("Edit token entry"), null, 'imagelink token_edit');
         }
         if (!empty($token['participant_id']) && $token['participant_id'] != "" && $bGlobalPanelReadPermission) {
             $action .= viewHelper::getImageLink('cpdb_16.png', null, $clang->gT("View this person in the central participants database"), null, 'imagelink cpdb', array('onclick' => "sendPost('" . $this->getController()->createUrl('admin/participants/sa/displayParticipants') . "','',['searchcondition'],['participant_id||equal||{$token['participant_id']}']);"));
         } else {
             $action .= '<div style="width: 20px; height: 16px; float: left;"></div>';
         }
         $action .= '</div>';
         $aRowToAdd['cell'] = array($token['tid'], $action, $token['firstname'], $token['lastname'], $token['email'], $token['emailstatus'], $token['token'], $token['language'], $token['sent'], $token['remindersent'], $token['remindercount'], $token['completed'], $token['usesleft'], $token['validfrom'], $token['validuntil']);
         foreach ($attributes as $attribute) {
             $aRowToAdd['cell'][] = $token[$attribute];
         }
         $aData->rows[] = $aRowToAdd;
     }
     viewHelper::disableHtmlLogging();
     header("Content-type: application/json");
     echo ls_json_encode($aData);
 }
开发者ID:josetorerobueno,项目名称:test_repo,代码行数:101,代码来源:tokens.php

示例2: getResponses_json


//.........这里部分代码省略.........
                     $sFiltering = 'tokens.token';
                 }
                 $oCriteria->compare(Yii::app()->db->quoteColumnName($sFiltering), $value, true);
             }
         }
         if ($sFilters = Yii::app()->request->getParam('filters')) {
             $aFilters = json_decode($sFilters);
             // TODO : groupOp and rules
         }
     }
     // Elements for nav bar of jquery
     $iCount = SurveyDynamic::model($iSurveyID)->count($oCriteria);
     // or die("Couldn't get response data<br />");
     $iLimit = (int) $iLimit > 0 ? (int) $iLimit : 50;
     if (!$iLimit || $iLimit > $iCount) {
         $iLimit = $iCount;
     }
     $iStart = (int) $iPage > 0 ? (int) $iPage * $iLimit - $iLimit : 0;
     $aSurveyEntries = new stdClass();
     $aSurveyEntries->page = $iPage;
     // Did we need to fix page ?
     $aSurveyEntries->total = $iCount > 0 ? ceil($iCount / $iLimit) : 0;
     $aSurveyEntries->records = $iCount;
     // Last criteria update
     $oCriteria->offset = $iStart;
     $oCriteria->limit = $iLimit;
     // Get the rows
     $dtresult = SurveyDynamic::model($iSurveyID)->findAllAsArray($oCriteria);
     $all_rows = array();
     foreach ($dtresult as $row) {
         // View detail icon
         $action_html = '<a href="' . Yii::app()->createUrl("admin/responses/view/surveyid/{$surveyid}/id/{$row['id']}") . '"><span class="glyphicon glyphicon-list-alt text-success" title="' . gT('View response details') . '"></span></a>';
         // Edit icon
         if (Permission::model()->hasSurveyPermission($iSurveyID, 'responses', 'update')) {
             $action_html .= "<a href='" . Yii::app()->createUrl("admin/dataentry/editdata/subaction/edit/surveyid/{$surveyid}/id/{$row['id']}") . "'>\n                <span class='glyphicon glyphicon-pencil text-success' title='" . gT('Edit this response') . "'></span></a>";
         }
         // Download icon
         if (hasFileUploadQuestion($surveyid)) {
             if (Response::model($surveyid)->findByPk($row['id'])->getFiles()) {
                 $action_url = Yii::app()->createUrl("admin/responses", array("sa" => "actionDownloadfiles", "surveyid" => $surveyid, "sResponseId" => $row['id']));
                 $action_html .= '<a title="' . gT('Download all files in this response as a zip file') . '" href="' . $action_url . '"><span class="glyphicon glyphicon-download-alt downloadfile"></span></a>';
             }
         }
         // Delete icon
         if (Permission::model()->hasSurveyPermission($iSurveyID, 'responses', 'delete')) {
             $action_html .= "<a href='" . Yii::app()->createUrl("admin/responses", array("sa" => "actionDelete", "surveyid" => $surveyid, "sResponseId" => $row['id'])) . "' data-delete='" . $row['id'] . "'>\n                <span title='" . sprintf(gT('Delete response %s'), $row['id']) . "' class='deleteresponse glyphicon glyphicon-trash text-warning'></span></a>";
         }
         $aSurveyEntry = array();
         $aSurveyEntry[] = $action_html;
         $aSurveyEntry[] = $row['id'];
         $aSurveyEntry[] = $row['lastpage'];
         // completed
         $aSurveyEntry[] = empty($row['submitdate']) ? 'N' : 'Y';
         if ($bHaveToken) {
             if (is_null($row['tid'])) {
                 $aSurveyEntry[] = strip_tags($row['token']);
             } else {
                 $aSurveyEntry[] = "<a href='" . Yii::app()->createUrl("admin/tokens", array("sa" => "edit", "surveyid" => $surveyid, "tokenid" => $row['tid'])) . "'>" . strip_tags($row['token']) . "</a>";
             }
             $aSurveyEntry[] = strip_tags($row['firstname']);
             $aSurveyEntry[] = strip_tags($row['lastname']);
             $aSurveyEntry[] = strip_tags($row['email']);
         }
         // startlanguage
         //$aSurveyEntry[] = $row['startlanguage'];
         foreach ($row as $aFieldName => $mFieldValue) {
             if (in_array($aFieldName, $aSpecificColumns)) {
                 continue;
             }
             $sSurveyEntry = strip_tags(getExtendedAnswer($iSurveyID, $aFieldName, $mFieldValue, $sBrowseLanguage));
             // This fix XSS and get the value
             if ($aFieldmap[$aFieldName]['type'] == '|' && strpos($aFieldName, 'filecount') === false) {
                 $aQuestionAttributes = getQuestionAttributeValues($aFieldmap[$aFieldName]['qid']);
                 $aFilesInfo = json_decode_ls($mFieldValue);
                 for ($iFileIndex = 0; $iFileIndex < $aQuestionAttributes['max_num_of_files']; $iFileIndex++) {
                     if (isset($aFilesInfo[$iFileIndex])) {
                         $aSurveyEntry[] = htmlspecialchars($aFilesInfo[$iFileIndex]['title'], ENT_QUOTES, 'UTF-8');
                         $aSurveyEntry[] = htmlspecialchars($aFilesInfo[$iFileIndex]['comment'], ENT_QUOTES, 'UTF-8');
                         $aSurveyEntry[] = CHtml::link(rawurldecode($aFilesInfo[$iFileIndex]['name']), $this->getController()->createUrl("/admin/responses", array("sa" => "actionDownloadfile", "surveyid" => $surveyid, "iResponseId" => $row['id'], "sFileName" => $aFilesInfo[$iFileIndex]['name'])));
                         $aSurveyEntry[] = sprintf('%s Mb', round($aFilesInfo[$iFileIndex]['size'] / 1000, 2));
                     } else {
                         $aSurveyEntry[] = "";
                         $aSurveyEntry[] = "";
                         $aSurveyEntry[] = "";
                         $aSurveyEntry[] = "";
                     }
                 }
             } else {
                 $aSurveyEntry[] = $sSurveyEntry;
             }
         }
         $all_rows[] = array('id' => $row['id'], 'cell' => $aSurveyEntry);
     }
     $aSurveyEntries->rows = $all_rows;
     viewHelper::disableHtmlLogging();
     // It's better with but we need to fix error actually
     header('Content-type: application/json');
     echo json_encode($aSurveyEntries);
     Yii::app()->end();
 }
开发者ID:BertHankes,项目名称:LimeSurvey,代码行数:101,代码来源:responses.php

示例3: group_export

function group_export($action, $iSurveyID, $gid)
{
    $fn = "limesurvey_group_{$gid}.lsg";
    $xml = getXMLWriter();
    viewHelper::disableHtmlLogging();
    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', 'Group');
    $xml->writeElement('DBVersion', getGlobalSetting("DBVersion"));
    $xml->startElement('languages');
    $lresult = QuestionGroup::model()->findAllByAttributes(array('gid' => $gid), array('select' => 'language', 'group' => 'language'));
    foreach ($lresult as $row) {
        $xml->writeElement('language', $row->language);
    }
    $xml->endElement();
    groupGetXMLStructure($xml, $gid);
    $xml->endElement();
    // close columns
    $xml->endDocument();
}
开发者ID:wrenchpilot,项目名称:LimeSurvey,代码行数:30,代码来源:export_helper.php

示例4: _surveyexport

 private function _surveyexport($action, $iSurveyID)
 {
     viewHelper::disableHtmlLogging();
     if ($action == "exportstructurexml") {
         $fn = "limesurvey_survey_{$iSurveyID}.lss";
         $this->_addHeaders($fn, "text/xml", "Mon, 26 Jul 1997 05:00:00 GMT");
         echo surveyGetXMLData($iSurveyID);
         exit;
     } elseif ($action == "exportstructurejson") {
         $fn = "limesurvey_survey_{$iSurveyID}.json";
         $this->_addHeaders($fn, "application/json", "Mon, 26 Jul 1997 05:00:00 GMT");
         $surveyInXmlFormat = surveyGetXMLData($iSurveyID);
         // now convert this xml into json format and then return
         echo _xmlToJson($surveyInXmlFormat);
         exit;
     } elseif ($action == "exportstructurequexml") {
         if (isset($surveyprintlang) && !empty($surveyprintlang)) {
             $quexmllang = $surveyprintlang;
         } else {
             $quexmllang = Survey::model()->findByPk($iSurveyID)->language;
         }
         if (!(isset($noheader) && $noheader == TRUE)) {
             $fn = "survey_{$iSurveyID}_{$quexmllang}.xml";
             $this->_addHeaders($fn, "text/xml", "Mon, 26 Jul 1997 05:00:00 GMT");
             echo quexml_export($iSurveyID, $quexmllang);
             exit;
         }
     } elseif ($action == 'exportstructuretsv') {
         $this->_exporttsv($iSurveyID);
     } elseif ($action == "exportarchive") {
         $this->_exportarchive($iSurveyID);
     }
 }
开发者ID:ambientelivre,项目名称:LimeSurvey,代码行数:33,代码来源:export.php


注:本文中的viewHelper::disableHtmlLogging方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。