• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getLanguageNameFromCode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getLanguageNameFromCode函数的典型用法代码示例。如果您正苦于以下问题:PHP getLanguageNameFromCode函数的具体用法?PHP getLanguageNameFromCode怎么用?PHP getLanguageNameFromCode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: formatLanguageList

 public function formatLanguageList($value)
 {
     $langArr = explode(' ', trim($value));
     $expandedArr = array();
     foreach ($langArr as $lang) {
         array_push($expandedArr, getLanguageNameFromCode($lang, false));
     }
     sort($expandedArr);
     return implode(', ', $expandedArr);
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:10,代码来源:CustomFormatter.php


示例2: array

<div class='header ui-widget-header'>
    <?php $clang->eT("Edit subquestions"); ?>
</div>
<?php echo CHtml::form(array("admin/database"), 'post', array('id'=>'editsubquestionsform', 'name'=>'editsubquestionsform')); ?>

    <input type='hidden' name='sid' value='<?php echo $surveyid; ?>' />
    <input type='hidden' name='gid' value='<?php echo $gid; ?>' />
    <input type='hidden' name='qid' value='<?php echo $qid; ?>' />
    <input type='hidden' id='action' name='action' value='updatesubquestions' />
    <input type='hidden' id='sortorder' name='sortorder' value='' />
    <input type='hidden' id='deletedqids' name='deletedqids' value='' />
    <div id='tabs'>
        <ul>
            <?php foreach ($anslangs as $anslang)
                { ?>
                <li><a href='#tabpage_<?php echo $anslang; ?>'><?php echo getLanguageNameFromCode($anslang, false); ?>
                        <?php if ($anslang==Survey::model()->findByPk($surveyid)->language) { ?> (<?php echo $clang->gT("Base language"); ?>) <?php } ?></a>
                </li>
                <?php } ?>
        </ul>
        <?php
            $first=true;
            $sortorderids='';
            $codeids='';
        ?>

        <?php foreach ($anslangs as $anslang)
            { ?>
            <div id='tabpage_<?php echo $anslang; ?>' class='tab-page'>
                <?php for ($scale_id = 0; $scale_id < $scalecount; $scale_id++)
                    {
开发者ID:Narasimman,项目名称:UrbanExpansion,代码行数:31,代码来源:subQuestion_view.php


示例3: getLanguageNameFromCode

        ?>
                           <option value='<?php 
        echo $lang;
        ?>
' selected='selected'><?php 
        echo getLanguageNameFromCode($lang, false);
        ?>
</option>
                        <?php 
    } else {
        ?>
                            <option value='<?php 
        echo $lang;
        ?>
'><?php 
        echo getLanguageNameFromCode($lang, false);
        ?>
</option>
                            <?php 
    }
}
?>
                    </select>
                </li>
                
                 <li><label for='queXMLStyle'><?php 
eT("Style:");
?>
</label>
            
            <textarea rows="10" cols="80" id='queXMLStyle' name='queXMLStyle'><?php 
开发者ID:wrenchpilot,项目名称:LimeSurvey,代码行数:31,代码来源:queXMLSurvey_view.php


示例4: codeCheck

 // KP
 $labelsoutput.= "\t<div class='header ui-widget-header'>".$clang->gT("Labels")."\t</div>\n";
 $labelsoutput.= "<form method='post' action='admin.php' onsubmit=\"return codeCheck('code_',$maxsortorder,'".$clang->gT("Error: You are trying to use duplicate label codes.",'js')."','".$clang->gT("Error: 'other' is a reserved keyword.",'js')."');\">\n"
 ."<input type='hidden' name='sortorder' value='{$row['sortorder']}' />\n"
 ."<input type='hidden' name='lid' value='$lid' />\n"
 ."<input type='hidden' name='action' value='modlabelsetanswers' />\n";
 $first=true;
 $sortorderids=''; $codeids='';
 $i = 0;
 foreach ($lslanguages as $lslanguage)
 {
     $position=0;
     $query = "SELECT * FROM ".db_table_name('labels')." WHERE lid=$lid and language='$lslanguage' ORDER BY sortorder, code";
     $result = db_execute_assoc($query) or safe_die($connect->ErrorMsg());
     $labelcount = $result->RecordCount();
     $tab_title[$i] = getLanguageNameFromCode($lslanguage,false);
     $tab_content[$i] = "<table class='answertable' align='center'>\n"
     ."<thead align='center'>"
     ."<tr>\n"
     ."\t<th align='right' class='settingcaption'>\n"
     .$clang->gT("Code")
     ."\t</th>\n";
     $tab_content[$i].="<th align='right' class='settingcaption'>".$clang->gT("Assessment value").'</th>';
     $tab_content[$i].="\t<th class='settingcaption'>\n"
     .$clang->gT("Title")
     ."\t</th>\n"
     ."\t<th align='center' class='settingcaption'>\n"
     .$clang->gT("Action")
     ."\t</th>\n"
     ."\t<th align='center' class='settingcaption'>\n"
     .$clang->gT("Order")
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:31,代码来源:labels.php


示例5: languageDropdownClean

/**
 * Creates a <select> HTML element for language selection for this survey
 *
 * @param int $surveyid
 * @param string $selected The selected language
 * @return string
 */
function languageDropdownClean($surveyid, $selected)
{
    $slangs = Survey::model()->findByPk($surveyid)->additionalLanguages;
    $baselang = Survey::model()->findByPk($surveyid)->language;
    array_unshift($slangs, $baselang);
    $html = "<select class='form-control listboxquestions' id='language' name='language'>\n";
    foreach ($slangs as $lang) {
        if ($lang == $selected) {
            $html .= "\t<option value='{$lang}' selected='selected'>" . getLanguageNameFromCode($lang, false) . "</option>\n";
        }
        if ($lang != $selected) {
            $html .= "\t<option value='{$lang}'>" . getLanguageNameFromCode($lang, false) . "</option>\n";
        }
    }
    $html .= "</select>";
    return $html;
}
开发者ID:GuillaumeSmaha,项目名称:LimeSurvey,代码行数:24,代码来源:common_helper.php


示例6: editdata


//.........这里部分代码省略.........
                                $fieldn = substr($fname['fieldname'], 0, strlen($fname['fieldname']));
                                //$aDataentryoutput .= substr($fname['fieldname'], strlen($fname['fieldname'])-5, 5)."<br />\n";
                                if (substr($fname['fieldname'], -5) == "other") {
                                    $aDataentryoutput .= "\t<input type='text' name='{$fname['fieldname']}' value='" . htmlspecialchars($idrow[$fname['fieldname']], ENT_QUOTES) . "' />\n";
                                } else {
                                    $aDataentryoutput .= "<div class='checkbox'>\t<input type='checkbox' class='checkboxbtn' name='{$fname['fieldname']}' id='{$fname['fieldname']}' value='Y'";
                                    if ($idrow[$fname['fieldname']] == "Y") {
                                        $aDataentryoutput .= " checked";
                                    }
                                    $aDataentryoutput .= " /><label for='{$fname['fieldname']}'>{$fname['subquestion']}</label></div>\n";
                                }
                                $fname = next($fnames);
                            }
                            $fname = prev($fnames);
                            break;
                        case "I":
                            //Language Switch
                            $lquery = "SELECT * FROM {{answers}} WHERE qid={$fname['qid']} AND language = '{$sDataEntryLanguage}' ORDER BY sortorder, answer";
                            $lresult = dbExecuteAssoc($lquery);
                            $slangs = Survey::model()->findByPk($surveyid)->additionalLanguages;
                            $baselang = Survey::model()->findByPk($surveyid)->language;
                            array_unshift($slangs, $baselang);
                            $aDataentryoutput .= "<select name='{$fname['fieldname']}' class='form-control'>\n";
                            $aDataentryoutput .= "<option value=''";
                            if ($idrow[$fname['fieldname']] == "") {
                                $aDataentryoutput .= " selected='selected'";
                            }
                            $aDataentryoutput .= ">" . gT("Please choose") . "..</option>\n";
                            foreach ($slangs as $lang) {
                                $aDataentryoutput .= "<option value='{$lang}'";
                                if ($lang == $idrow[$fname['fieldname']]) {
                                    $aDataentryoutput .= " selected='selected'";
                                }
                                $aDataentryoutput .= ">" . getLanguageNameFromCode($lang, false) . "</option>\n";
                            }
                            $aDataentryoutput .= "</select>";
                            break;
                        case "P":
                            //Multiple choice with comments checkbox + text
                            $aDataentryoutput .= "<table>\n";
                            while (isset($fname) && $fname['type'] == "P") {
                                $thefieldname = $fname['fieldname'];
                                if (substr($thefieldname, -7) == "comment") {
                                    $aDataentryoutput .= "<td><input type='text' name='{$fname['fieldname']}' size='50' value='" . htmlspecialchars($idrow[$fname['fieldname']], ENT_QUOTES) . "' /></td>\n" . "\t</tr>\n";
                                } elseif (substr($fname['fieldname'], -5) == "other") {
                                    $aDataentryoutput .= "\t<tr>\n" . "<td>\n" . "\t<input type='text' name='{$fname['fieldname']}' size='30' value='" . htmlspecialchars($idrow[$fname['fieldname']], ENT_QUOTES) . "' />\n" . "</td>\n" . "<td>\n";
                                    $fname = next($fnames);
                                    $aDataentryoutput .= "\t<input type='text' name='{$fname['fieldname']}' size='50' value='" . htmlspecialchars($idrow[$fname['fieldname']], ENT_QUOTES) . "' />\n" . "</td>\n" . "\t</tr>\n";
                                } else {
                                    $aDataentryoutput .= "\t<tr>\n" . "<td><div class='checkbox'><input type='checkbox' class='checkboxbtn' name=\"{$fname['fieldname']}\" id=\"{$fname['fieldname']}\" value='Y'";
                                    if ($idrow[$fname['fieldname']] == "Y") {
                                        $aDataentryoutput .= " checked";
                                    }
                                    $aDataentryoutput .= " /><label for=\"{$fname['fieldname']}\">{$fname['subquestion']}</label></div></td>\n";
                                }
                                $fname = next($fnames);
                            }
                            $aDataentryoutput .= "</table>\n";
                            $fname = prev($fnames);
                            break;
                        case "|":
                            //FILE UPLOAD
                            $aDataentryoutput .= "<table>\n";
                            if ($fname['aid'] !== 'filecount' && isset($idrow[$fname['fieldname'] . '_filecount']) && $idrow[$fname['fieldname'] . '_filecount'] > 0) {
                                //file metadata
                                $metadata = json_decode($idrow[$fname['fieldname']], true);
开发者ID:CrandellWS,项目名称:LimeSurvey,代码行数:67,代码来源:dataentry.php


示例7: foreach

        <a href='<?php 
echo $tmp_url;
?>
' target='_blank'><?php 
echo $tmp_url;
?>
</a>
        </td>
    </tr>
        <?php 
foreach ($aAdditionalLanguages as $langname) {
    ?>
        <tr>
            <td>
                <strong><?php 
    echo getLanguageNameFromCode($langname, false) . ":";
    ?>
</strong>
            </td>
            <td>
            <?php 
    $tmp_url = $this->createAbsoluteUrl("/survey/index/sid/{$surveyinfo['sid']}/lang/{$langname}");
    ?>
            <a href='<?php 
    echo $tmp_url;
    ?>
' target='_blank'><?php 
    echo $tmp_url;
    ?>
</a>
            </td>
开发者ID:josetorerobueno,项目名称:test_repo,代码行数:31,代码来源:surveySummary_view.php


示例8: editlocalsettings

 /**
  * Load editing of local settings of a survey screen.
  *
  * @access public
  * @param int $iSurveyID
  * @return void
  */
 public function editlocalsettings($iSurveyID)
 {
     $aData['surveyid'] = $iSurveyID = sanitize_int($iSurveyID);
     $aViewUrls = array();
     if (Permission::model()->hasSurveyPermission($iSurveyID, 'surveylocale', 'read')) {
         if (Permission::model()->hasSurveyPermission($iSurveyID, 'surveylocale', 'update')) {
             Yii::app()->session['FileManagerContext'] = "edit:survey:{$iSurveyID}";
         }
         $grplangs = Survey::model()->findByPk($iSurveyID)->additionalLanguages;
         $baselang = Survey::model()->findByPk($iSurveyID)->language;
         array_unshift($grplangs, $baselang);
         Yii::app()->loadHelper("admin/htmleditor");
         $aViewUrls['output'] = PrepareEditorScript(false, $this->getController());
         foreach ($grplangs as $sLang) {
             // this one is created to get the right default texts fo each language
             Yii::app()->loadHelper('database');
             Yii::app()->loadHelper('surveytranslator');
             $esrow = SurveyLanguageSetting::model()->findByPk(array('surveyls_survey_id' => $iSurveyID, 'surveyls_language' => $sLang))->getAttributes();
             $aTabTitles[$sLang] = getLanguageNameFromCode($esrow['surveyls_language'], false);
             if ($esrow['surveyls_language'] == Survey::model()->findByPk($iSurveyID)->language) {
                 $aTabTitles[$sLang] .= '(' . gT("Base language") . ')';
             }
             $esrow = array_map('htmlspecialchars', $esrow);
             $aData['esrow'] = $esrow;
             $aData['action'] = "editsurveylocalesettings";
             $aTabContents[$sLang] = $this->getController()->renderPartial('/admin/survey/editLocalSettings_view', $aData, true);
         }
         $aData['has_permissions'] = Permission::model()->hasSurveyPermission($iSurveyID, 'surveylocale', 'update');
         $aData['surveyls_language'] = $esrow["surveyls_language"];
         $aData['aTabContents'] = $aTabContents;
         $aData['aTabTitles'] = $aTabTitles;
         $aViewUrls[] = 'editLocalSettings_main_view';
     } else {
         $this->getController()->error('Access denied');
     }
     $this->_renderWrappedTemplate('survey', $aViewUrls, $aData);
 }
开发者ID:nicbon,项目名称:LimeSurvey,代码行数:44,代码来源:surveyadmin.php


示例9: ajaxlabelsetdetails

 /**
  * This function prepares the data for label set details
  *
  * @access public
  * @return void
  */
 public function ajaxlabelsetdetails()
 {
     $lid = returnglobal('lid');
     Yii::app()->loadHelper('surveytranslator');
     $labelsetdata = Labelsets::model()->find('lid=:lid', array(':lid' => $lid));
     //$connect->GetArray($query);
     $labelsetlanguages = explode(' ', $labelsetdata->languages);
     foreach ($labelsetlanguages as $language) {
         $criteria = new CDbCriteria();
         $criteria->condition = 'lid=:lid and language=:language';
         $criteria->params = array(':lid' => $lid, ':language' => $language);
         $criteria->order = 'sortorder';
         $labelsdata = Label::model()->findAll($criteria);
         $i = 0;
         foreach ($labelsdata as $labeldata) {
             $data[$i]['lid'] = $labeldata->lid;
             $data[$i]['code'] = $labeldata->code;
             $data[$i]['title'] = $labeldata->title;
             $data[$i]['sortorder'] = $labeldata->sortorder;
             $data[$i]['assessment_value'] = $labeldata->assessment_value;
             $data[$i]['language'] = $labeldata->language;
             $i++;
         }
         $labels = $data;
         //$labels=dbExecuteAssoc($query); //Label::model()->find(array('lid' => $lid, 'language' => $language), array('order' => 'sortorder')); //$connect->GetArray($query);
         $resultdata[] = array($language => array($labels, getLanguageNameFromCode($language, false)));
     }
     echo ls_json_encode($resultdata);
 }
开发者ID:ryu1inaba,项目名称:LimeSurvey,代码行数:35,代码来源:question.php


示例10: date_shift

 $dataentryoutput .= "<input type='hidden' name='closedate' value='" . date_shift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", $timeadjust) . "' />\n";
 if ($thissurvey['allowsave'] == "Y") {
     //Show Save Option
     $dataentryoutput .= "\t<tr><td align='left'><input type='checkbox' class='checkboxbtn' name='save' id='save' onclick='saveshow(this.id)' /><label for='save'>" . $clang->gT("Save for further completion by survey user") . "</label>\n";
     $dataentryoutput .= "</td></tr></table>\n";
     $dataentryoutput .= "<div name='saveoptions' id='saveoptions' style='display: none'>\n";
     $dataentryoutput .= "<table align='center' class='outlinetable' cellspacing='0'>\n\t\t\t\t\t  <tr><td align='right'>" . $clang->gT("Identifier:") . "</td>\n\t\t\t\t\t  <td><input type='text' name='save_identifier' /></td></tr>\n\t\t\t\t\t  <tr><td align='right'>" . $clang->gT("Password:") . "</td>\n\t\t\t\t\t  <td><input type='password' name='save_password' /></td></tr>\n\t\t\t\t\t  <tr><td align='right'>" . $clang->gT("Confirm Password:") . "</td>\n\t\t\t\t\t  <td><input type='password' name='save_confirmpassword' /></td></tr>\n\t\t\t\t\t  <tr><td align='right'>" . $clang->gT("Email:") . "</td>\n\t\t\t\t\t  <td><input type='text' name='save_email' /></td></tr>\n\t\t\t\t\t  <tr><td align='right'>" . $clang->gT("Start Language:") . "</td>\n\t\t\t\t\t  <td>";
     $slangs = GetAdditionalLanguagesFromSurveyID($surveyid);
     $sbaselang = GetBaseLanguageFromSurveyID($surveyid);
     array_unshift($slangs, $sbaselang);
     $dataentryoutput .= "<select name='save_language'>\n";
     foreach ($slangs as $lang) {
         if ($lang == $baselang) {
             $dataentryoutput .= "\t<option value='{$lang}' selected='selected'>" . getLanguageNameFromCode($lang, false) . "</option>\n";
         } else {
             $dataentryoutput .= "\t<option value='{$lang}'>" . getLanguageNameFromCode($lang, false) . "</option>\n";
         }
     }
     $dataentryoutput .= "</select>";
     $dataentryoutput .= "</td></tr></table></div>\n";
     $dataentryoutput .= "</td>\n";
     $dataentryoutput .= "\t</tr>\n";
 }
 $dataentryoutput .= "\t<tr>\n";
 $dataentryoutput .= "<td colspan='3' align='center'>\n";
 $dataentryoutput .= "\t<input type='submit' id='submitdata' value='" . $clang->gT("Submit") . "'";
 if (tableExists('tokens_' . $thissurvey['sid'])) {
     $dataentryoutput .= " disabled='disabled'/>\n";
 } else {
     $dataentryoutput .= " />\n";
 }
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:dataentry.php


示例11: foreach

                    break;



                case "I": // Language
                    $survlangs = Survey::model()->findByPk($surveyid)->additionalLanguages;
                    $survlangs[] = Survey::model()->findByPk($surveyid)->language;
                    foreach ($survlangs  as $availlang)
                    {
                        echo "\t<option value='".$availlang."'";

                        //pre-select values which were marked before
                        if (isset($_POST[$myfield]) && is_array($_POST[$myfield]) && in_array($availlang, $_POST[$myfield]))
                        {echo " selected";}

                        echo ">".getLanguageNameFromCode($availlang,false)."</option>\n";
                    }
                    break;



                    //----------------------- ARRAYS --------------------------

                case "A": // ARRAY OF 5 POINT CHOICE QUESTIONS

                    echo "\t</tr>\n\t<tr>\n";

                    //get answers
                    $result[$key1] = Question::model()->getQuestionsForStatistics('title, question', "parent_qid='$flt[0]' AND language = '{$language}'", 'question_order');
                    $counter2=0;
开发者ID:jgianpiere,项目名称:lime-survey,代码行数:30,代码来源:statistics_view.php


示例12: if

 </a>            
  
  <?php if(Permission::model()->hasSurveyPermission($surveyid,'surveycontent','update')): ?>
      <?php if (count($languagelist) > 1): ?>
          
          <!-- Preview multilangue -->
          <div class="btn-group">
            <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <img src="<?php echo $sImageURL; ?>preview.png" />
              <?php eT("Preview this question group"); ?> <span class="caret"></span>
            </button>
            <ul class="dropdown-menu" style="min-width : 252px;">
                <?php foreach ($languagelist as $tmp_lang): ?>
                    <li>
                        <a target="_blank" href="<?php echo $this->createUrl("survey/index/action/previewgroup/sid/{$surveyid}/gid/{$gid}/lang/" . $tmp_lang); ?>" >
                            <?php echo getLanguageNameFromCode($tmp_lang,false); ?>
                        </a>
                    </li>    
                <?php endforeach; ?>
            </ul>
          </div>
      <?php else:?>
          
          <!-- Preview simple langue -->
          <a class="btn btn-default" href="<?php echo $this->createUrl("survey/index/action/previewgroup/sid/$surveyid/gid/$gid/"); ?>" role="button" target="_blank">
              <img src="<?php echo $sImageURL; ?>preview.png" />
              <?php eT("Preview this question group");?>
          </a>
      <?php endif; ?>                    
  <?php endif; ?>        
      
开发者ID:jgianpiere,项目名称:lime-survey,代码行数:30,代码来源:nquestiongroupbar_view.php


示例13: buildOutputList


//.........这里部分代码省略.........
                     $qquery = "SELECT title, question FROM {{questions}} WHERE parent_qid='{$qiqid}' AND title='{$qanswer}' AND language='{$language}' ORDER BY question_order";
                     $qresult = Yii::app()->db->createCommand($qquery)->query();
                     //loop through answers
                     foreach ($qresult->readAll() as $qrow) {
                         $qrow = array_values($qrow);
                         //this question type uses its own labels
                         $fquery = "SELECT * FROM {{answers}} WHERE qid='{$qiqid}' AND scale_id=0 AND language='{$language}'ORDER BY sortorder, code";
                         $fresult = Yii::app()->db->createCommand($fquery)->query();
                         //add code and title to results for outputting them later
                         foreach ($fresult->readAll() as $frow) {
                             $alist[] = array($frow['code'], flattenText($frow['answer']));
                         }
                         //counter
                         $atext = flattenText($qrow[1]);
                     }
                     //output
                     $qquestion .= $linefeed . "[" . $atext . "]";
                     $qtitle .= "({$qanswer})";
                     break;
                 case "G":
                     //Gender
                     $alist[] = array("F", gT("Female"));
                     $alist[] = array("M", gT("Male"));
                     break;
                 case "Y":
                     //Yes\No
                     $alist[] = array("Y", gT("Yes"));
                     $alist[] = array("N", gT("No"));
                     break;
                 case "I":
                     //Language
                     // Using previously defined $surveylanguagecodes array of language codes
                     foreach ($surveylanguagecodes as $availlang) {
                         $alist[] = array($availlang, getLanguageNameFromCode($availlang, false));
                     }
                     break;
                 case "5":
                     //5 Point (just 1 item to rank!)
                     for ($i = 1; $i <= 5; $i++) {
                         $alist[] = array("{$i}", "{$i}");
                     }
                     break;
                 case "1":
                     //array (dual scale)
                     $sSubquestionQuery = "SELECT  question FROM {{questions}} WHERE parent_qid='{$qiqid}' AND title='{$qanswer}' AND language='{$language}' ORDER BY question_order";
                     $questionDesc = Yii::app()->db->createCommand($sSubquestionQuery)->query()->read();
                     $sSubquestion = flattenText($questionDesc['question']);
                     //get question attributes
                     $aQuestionAttributes = getQuestionAttributeValues($qqid);
                     //check last character -> label 1
                     if (substr($rt, -1, 1) == 0) {
                         //get label 1
                         $fquery = "SELECT * FROM {{answers}} WHERE qid='{$qqid}' AND scale_id=0 AND language='{$language}' ORDER BY sortorder, code";
                         //header available?
                         if (trim($aQuestionAttributes['dualscale_headerA'][$language]) != '') {
                             //output
                             $labelheader = "[" . $aQuestionAttributes['dualscale_headerA'][$language] . "]";
                         } else {
                             $labelheader = '';
                         }
                         //output
                         $labelno = sprintf(gT('Label %s'), '1');
                     } else {
                         //get label 2
                         $fquery = "SELECT * FROM {{answers}} WHERE qid='{$qqid}' AND scale_id=1 AND language='{$language}' ORDER BY sortorder, code";
                         //header available?
开发者ID:krsandesh,项目名称:LimeSurvey,代码行数:67,代码来源:statistics_helper.php


示例14: foreach

    ?>
</h3>

    <div class="row">
        <div class="col-lg-12 content-right">
            <?php 
    echo CHtml::form(array("admin/tokens/sa/updatetokenattributedescriptions/surveyid/{$surveyid}"), 'post');
    ?>
            <div>
                <ul class="nav nav-tabs">
                    <?php 
    $c = true;
    ?>
                    <?php 
    foreach ($languages as $sLanguage) {
        $sTabTitle = getLanguageNameFromCode($sLanguage, false);
        if ($sLanguage == Survey::model()->findByPk($iSurveyID)->language) {
            $sTabTitle .= '(' . gT("Base language") . ')';
        }
        ?>
                        <li <?php 
        if ($c) {
            $c = false;
            echo 'class="active"';
        }
        ?>
 >
                            <a data-toggle="tab" href="#language_<?php 
        echo $sLanguage;
        ?>
"><?php 
开发者ID:GuillaumeSmaha,项目名称:LimeSurvey,代码行数:31,代码来源:managetokenattributes.php


示例15: _surveysummary

 /**
  * Show survey summary
  * @param int Survey id
  * @param string Action to be performed
  */
 function _surveysummary($iSurveyID, $action = null, $gid = null)
 {
     $clang = $this->getController()->lang;
     $baselang = Survey::model()->findByPk($iSurveyID)->language;
     $condition = array('sid' => $iSurveyID, 'language' => $baselang);
     $sumresult1 = Survey::model()->with(array('languagesettings' => array('condition' => 'surveyls_language=language')))->findByPk($iSurveyID);
     //$sumquery1, 1) ; //Checked
     if (is_null($sumresult1)) {
         Yii::app()->session['flashmessage'] = $clang->gT("Invalid survey ID");
         $this->getController()->redirect($this->getController()->createUrl("admin/index"));
     }
     //  if surveyid is invalid then die to prevent errors at a later time
     $surveyinfo = $sumresult1->attributes;
     $surveyinfo = array_merge($surveyinfo, $sumresult1->languagesettings[0]->attributes);
     $surveyinfo = array_map('flattenText', $surveyinfo);
     //$surveyinfo = array_map('htmlspecialchars', $surveyinfo);
     $activated = $surveyinfo['active'];
     $condition = array('sid' => $iSurveyID, 'parent_qid' => 0, 'language' => $baselang);
     $sumresult3 = Questions::model()->findAllByAttributes($condition);
     //Checked
     $sumcount3 = count($sumresult3);
     $condition = array('sid' => $iSurveyID, 'language' => $baselang);
     //$sumquery2 = "SELECT * FROM ".db_table_name('groups')." WHERE sid={$iSurveyID} AND language='".$baselang."'"; //Getting a count of groups for this survey
     $sumresult2 = Groups::model()->findAllByAttributes($condition);
     //Checked
     $sumcount2 = count($sumresult2);
     //SURVEY SUMMARY
     $aAdditionalLanguages = Survey::model()->findByPk($iSurveyID)->additionalLanguages;
     $surveysummary2 = "";
     if ($surveyinfo['anonymized'] != "N") {
         $surveysummary2 .= $clang->gT("Responses to this survey are anonymized.") . "<br />";
     } else {
         $surveysummary2 .= $clang->gT("Responses to this survey are NOT anonymized.") . "<br />";
     }
     if ($surveyinfo['format'] == "S") {
         $surveysummary2 .= $clang->gT("It is presented question by question.") . "<br />";
     } elseif ($surveyinfo['format'] == "G") {
         $surveysummary2 .= $clang->gT("It is presented group by group.") . "<br />";
     } else {
         $surveysummary2 .= $clang->gT("It is presented on one single page.") . "<br />";
     }
     if ($surveyinfo['allowjumps'] == "Y") {
         if ($surveyinfo['format'] == 'A') {
             $surveysummary2 .= $clang->gT("No question index will be shown with this format.") . "<br />";
         } else {
             $surveysummary2 .= $clang->gT("A question index will be shown; participants will be able to jump between viewed questions.") . "<br />";
         }
     }
     if ($surveyinfo['datestamp'] == "Y") {
         $surveysummary2 .= $clang->gT("Responses will be date stamped.") . "<br />";
     }
     if ($surveyinfo['ipaddr'] == "Y") {
         $surveysummary2 .= $clang->gT("IP Addresses will be logged") . "<br />";
     }
     if ($surveyinfo['refurl'] == "Y") {
         $surveysummary2 .= $clang->gT("Referrer URL will be saved.") . "<br />";
     }
     if ($surveyinfo['usecookie'] == "Y") {
         $surveysummary2 .= $clang->gT("It uses cookies for access control.") . "<br />";
     }
     if ($surveyinfo['allowregister'] == "Y") {
         $surveysummary2 .= $clang->gT("If tokens are used, the public may register for this survey") . "<br />";
     }
     if ($surveyinfo['allowsave'] == "Y" && $surveyinfo['tokenanswerspersistence'] == 'N') {
         $surveysummary2 .= $clang->gT("Participants can save partially finished surveys") . "<br />\n";
     }
     if ($surveyinfo['emailnotificationto'] != '') {
         $surveysummary2 .= $clang->gT("Basic email notification is sent to:") . " {$surveyinfo['emailnotificationto']}<br />\n";
     }
     if ($surveyinfo['emailresponseto'] != '') {
         $surveysummary2 .= $clang->gT("Detailed email notification with response data is sent to:") . " {$surveyinfo['emailresponseto']}<br />\n";
     }
     $dateformatdetails = getDateFormatData(Yii::app()->session['dateformat']);
     if (trim($surveyinfo['startdate']) != '') {
         Yii::import('application.libraries.Date_Time_Converter');
         $datetimeobj = new Date_Time_Converter($surveyinfo['startdate'], 'Y-m-d H:i:s');
         $aData['startdate'] = $datetimeobj->convert($dateformatdetails['phpdate'] . ' H:i');
     } else {
         $aData['startdate'] = "-";
     }
     if (trim($surveyinfo['expires']) != '') {
         //$constructoritems = array($surveyinfo['expires'] , "Y-m-d H:i:s");
         Yii::import('application.libraries.Date_Time_Converter');
         $datetimeobj = new Date_Time_Converter($surveyinfo['expires'], 'Y-m-d H:i:s');
         //$datetimeobj = new Date_Time_Converter($surveyinfo['expires'] , "Y-m-d H:i:s");
         $aData['expdate'] = $datetimeobj->convert($dateformatdetails['phpdate'] . ' H:i');
     } else {
         $aData['expdate'] = "-";
     }
     if (!$surveyinfo['language']) {
         $aData['language'] = getLanguageNameFromCode($currentadminlang, false);
     } else {
         $aData['language'] = getLanguageNameFromCode($surveyinfo['language'], false);
     }
     // get the rowspan of the Additionnal languages row
//.........这里部分代码省略.........
开发者ID:ryu1inaba,项目名称:LimeSurvey,代码行数:101,代码来源:Survey_Common_Action.php


示例16: generate_statistics


//.........这里部分代码省略.........
                            {
                                $alist[]=array($frow['code'], FlattenText($frow['answer']));
                            }

                            //counter
                            $atext=FlattenText($qrow[1]);
                        }

                        //output
                        $qquestion .= $linefeed."[".$atext."]";
                        $qtitle .= "($qanswer)";
                        break;



                    case "G": //Gender
                        $alist[]=array("F", $statlang->gT("Female"));
                        $alist[]=array("M", $statlang->gT("Male"));
                        break;



                    case "Y": //Yes\No
                        $alist[]=array("Y", $statlang->gT("Yes"));
                        $alist[]=array("N", $statlang->gT("No"));
                        break;



                    case "I": //Language
                        // Using previously defined $surveylanguagecodes array of language codes
                        foreach ($surveylanguagecodes as $availlang)
                        {
                            $alist[]=array($availlang, getLanguageNameFromCode($availlang,false));
                        }
                        break;


                    case "5": //5 Point (just 1 item to rank!)
                        for ($i=1; $i<=5; $i++)
                        {
                            $alist[]=array("$i", "$i");
                        }
                        break;


                    case "1":	//array (dual scale)

                        $sSubquestionQuery = "SELECT  question FROM ".db_table_name("questions")." WHERE parent_qid='$qiqid' AND title='$qanswer' AND language='{$language}' ORDER BY question_order";
                        $sSubquestion=FlattenText($connect->GetOne($sSubquestionQuery));

                        //get question attributes
                        $qidattributes=getQuestionAttributes($qqid);

                        //check last character -> label 1
                        if (substr($rt,-1,1) == 0)
                        {
                            //get label 1
                            $fquery = "SELECT * FROM ".db_table_name("answers")." WHERE qid='{$qqid}' AND scale_id=0 AND language='{$language}' ORDER BY sortorder, code";

                            //header available?
                            if (trim($qidattributes['dualscale_headerA'])!='') {
                                //output
                                $labelheader= "[".$qidattributes['dualscale_headerA']."]";
                            }
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:66,代码来源:statistics_function.php


示例17: edit

 /**
  * questiongroup::edit()
  * Load editing of a question group screen.
  *
  * @access public
  * @param int $surveyid
  * @param int $gid
  * @return void
  */
 public function edit($surveyid, $gid)
 {
     $surveyid = sanitize_int($surveyid);
     $gid = sanitize_int($gid);
     $aViewUrls = $aData = array();
     if (Permission::model()->hasSurveyPermission($surveyid, 'surveycontent', 'read')) {
         Yii::app()->session['FileManagerContext'] = "edit:group:{$surveyid}";
         Yii::app()->loadHelper('admin/htmleditor');
         Yii::app()->loadHelper('surveytranslator');
         $aAdditionalLanguages = Survey::model()->findByPk($surveyid)->additionalLanguages;
         $aBaseLanguage = Survey::model()->findByPk($surveyid)->language;
         $aLanguages = array_merge(array($aBaseLanguage), $aAdditionalLanguages);
         $grplangs = array_flip($aLanguages);
         // Check out the intgrity of the language versions of this group
         $egresult = QuestionGroup::model()->findAllByAttributes(array('sid' => $surveyid, 'gid' => $gid));
         foreach ($egresult as $esrow) {
             $esrow = $esrow->attributes;
             // Language Exists, BUT ITS NOT ON THE SURVEY ANYMORE
             if (!in_array($esrow['language'], $aLanguages)) {
                 QuestionGroup::model()->deleteAllByAttributes(array('sid' => $surveyid, 'gid' => $gid, 'language' => $esrow['language']));
             } else {
                 $grplangs[$esrow['language']] = 'exists';
             }
             if ($esrow['language'] == $aBaseLanguage) {
                 $basesettings = $esrow;
             }
         }
         // Create groups in missing languages
         while (list($key, $value) = each($grplangs)) {
             if ($value != 'exists') {
                 $basesettings['language'] = $key;
                 $group = new QuestionGroup();
                 foreach ($basesettings as $k => $v) {
                     $group->{$k} = $v;
                 }
                 switchMSSQLIdentityInsert('groups', true);
                 $group->save();
                 switchMSSQLIdentityInsert('groups', false);
             }
         }
         $first = true;
         foreach ($aLanguages as $sLanguage) {
             $oResult = QuestionGroup::model()->findByAttributes(array('sid' => $surveyid, 'gid' => $gid, 'language' => $sLanguage));
             $aData['aGroupData'][$sLanguage] = $oResult->attributes;
             $aTabTitles[$sLanguage] = getLanguageNameFromCode($sLanguage, false);
             if ($first) {
                 $aTabTitles[$sLanguage] .= ' (' . gT("Base language") . ')';
                 $first = false;
             }
         }
         $aData['action'] = $aData['display']['menu_bars']['gid_action'] = 'editgroup';
         $aData['sur 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getLanguagePackName函数代码示例发布时间:2022-05-15
下一篇:
PHP getLanguageName函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap