Example #1
0
 /**
  * This function prepares the data for labelset
  *
  * @access public
  * @return void
  */
 public function ajaxlabelsetpicker()
 {
     $match = (int) returnglobal('match');
     $surveyid = returnglobal('sid');
     if ($match == 1) {
         $language = GetBaseLanguageFromSurveyID($surveyid);
     } else {
         $language = null;
     }
     $resultdata = getlabelsets($language);
     echo ls_json_encode($resultdata);
 }
 /**
  * This function prepares the data for labelset
  *
  * @access public
  * @return void
  */
 public function ajaxlabelsetpicker()
 {
     $match = (int) returnglobal('match');
     $surveyid = returnglobal('sid');
     if ($match == 1) {
         $language = GetBaseLanguageFromSurveyID($surveyid);
     } else {
         $language = null;
     }
     $resultdata = getlabelsets($language);
     // Label set title really don't need HTML
     foreach ($resultdata as &$aResult) {
         $aResult = array_map('flattenText', $aResult);
     }
     header('Content-type: application/json');
     echo ls_json_encode($resultdata);
 }
Example #3
0
    
    if ($subaction == "exportmulti")    
    {
            
           $labelsoutput.="<script type='text/javascript'>\n"
            ."<!--\n"
            ."var strSelectLabelset='".$clang->gT('You have to select at least one label set.','js')."';\n"
            ."//-->\n"
            ."</script>\n";
        
        $labelsoutput .="<div class='header ui-widget-header'>".$clang->gT('Export multiple label sets')."</div>"
        ."<form method='post' id='exportlabelset' class='form30' action='admin.php'><ul>"
        ."<li><label for='labelsets'>".$clang->gT('Please choose the label sets you want to export:')."<br />".$clang->gT('(Select multiple label sets by using the Ctrl key)')."</label>"
        ."<select id='labelsets' multiple='multiple' name='lids[]' size='20'>\n";
        $labelsets=getlabelsets();
        if (count($labelsets)>0)
        {
            foreach ($labelsets as $lb)
            {
                $labelsoutput.="<option value='{$lb[0]}'>{$lb[0]}: {$lb[1]}</option>\n";
            }
        }

        $labelsoutput.= "\t</select></li>\n"
        ."</ul><p><input type='submit' id='btnDumpLabelSets' value='".$clang->gT('Export selected label sets')."' />"
        ."<input type='hidden' name='action' value='dumplabel' />"
        ."</form>";
        

    }
    foreach ($labelsetlanguages as $language) {
        $query = 'select * from ' . db_table_name('labels') . ' where lid=' . $lid . " and language='{$language}' order by sortorder";
        $labels = $connect->GetArray($query);
        $resultdata[] = array($language => array($labels, getLanguageNameFromCode($language, false)));
    }
    echo json_encode($resultdata);
}
if ($action == "ajaxlabelsetpicker") {
    $match = (int) returnglobal('match');
    $surveyid = returnglobal('sid');
    if ($match == 1) {
        $language = GetBaseLanguageFromSurveyID($surveyid);
    } else {
        $language = null;
    }
    $resultdata = getlabelsets($language);
    echo json_encode($resultdata);
}
if ($action == "ajaxquestionattributes") {
    $thissurvey = getSurveyInfo($surveyid);
    $type = returnglobal('question_type');
    if (isset($qid)) {
        $attributesettings = getQuestionAttributes($qid);
    }
    $availableattributes = questionAttributes();
    if (isset($availableattributes[$type])) {
        uasort($availableattributes[$type], 'CategorySort');
        $ajaxoutput = '';
        $currentfieldset = '';
        foreach ($availableattributes[$type] as $qa) {
            if (isset($attributesettings[$qa['name']])) {