Exemplo n.º 1
0
    // echo $query;
    $result = db_execute_assoc($query);
    // Checked
    $gv = $result->FetchRow();
    return $gv['maxorder'];
}
$databaseoutput = '';
if (isset($surveyid)) {
    if ($action == "insertquestiongroup" && bHasSurveyPermission($surveyid, 'surveycontent', 'create')) {
        $grplangs = GetAdditionalLanguagesFromSurveyID($postsid);
        $baselang = GetBaseLanguageFromSurveyID($postsid);
        $grplangs[] = $baselang;
        $errorstring = '';
        foreach ($grplangs as $grouplang) {
            if (!$_POST['group_name_' . $grouplang]) {
                $errorstring .= GetLanguageNameFromCode($grouplang, false) . "\\n";
            }
        }
        if ($errorstring != '') {
            $databaseoutput .= "<script type=\"text/javascript\">\n<!--\n alert(\"" . $clang->gT("Group could not be added.\\n\\nIt is missing the group name for the following languages", "js") . ":\\n" . $errorstring . "\")\n //-->\n</script>\n";
        } else {
            $first = true;
            require_once "../classes/inputfilter/class.inputfilter_clean.php";
            $myFilter = new InputFilter('', '', 1, 1, 1);
            foreach ($grplangs as $grouplang) {
                //Clean XSS
                if ($filterxsshtml) {
                    $_POST['group_name_' . $grouplang] = $myFilter->process(html_entity_decode($_POST['group_name_' . $grouplang], ENT_QUOTES, "UTF-8"));
                    $_POST['description_' . $grouplang] = $myFilter->process(html_entity_decode($_POST['description_' . $grouplang], ENT_QUOTES, "UTF-8"));
                } else {
                    $_POST['group_name_' . $grouplang] = html_entity_decode($_POST['group_name_' . $grouplang], ENT_QUOTES, "UTF-8");
Exemplo n.º 2
0
     <input id="quota_limit" name="quota_limit" type="text" size="12" maxlength="8" />
     </li>
     </ul>
     ';
 $langs = GetAdditionalLanguagesFromSurveyID($surveyid);
 $baselang = GetBaseLanguageFromSurveyID($surveyid);
 array_push($langs, $baselang);
 require_once "../classes/inputfilter/class.inputfilter_clean.php";
 $myFilter = new InputFilter('', '', 1, 1, 1);
 $thissurvey = getSurveyInfo($surveyid);
 $quotasoutput .= '
     <div class="tab-pane" id="tab-pane-quota-' . $surveyid . '">' . "\n\n";
 foreach ($langs as $lang) {
     $quotasoutput .= '
         <div class="tab-page">
         <h2 class="tab">' . GetLanguageNameFromCode($lang, false);
     if ($lang == $baselang) {
         $quotasoutput .= '(' . $clang->gT("Base language") . ')';
     }
     $quotasoutput .= "</h2>";
     $quotasoutput .= '
         <ul>
         <li>
         <label for="quotals_message_' . $lang . '">' . $clang->gT("Quota message") . ':</label>
         <textarea id="quotals_message_' . $lang . '" name="quotals_message_' . $lang . '" cols="60" rows="6">' . $clang->gT("Sorry your responses have exceeded a quota on this survey.") . '</textarea>
         </li>
         </ul>
         </div>';
 }
 $quotasoutput .= '
     <input type="hidden" name="sid" value="' . $surveyid . '" />
Exemplo n.º 3
0
if ($action == "addgroup") {
    $grplangs = GetAdditionalLanguagesFromSurveyID($surveyid);
    $baselang = GetBaseLanguageFromSurveyID($surveyid);
    $grplangs[] = $baselang;
    $grplangs = array_reverse($grplangs);
    $newgroupoutput = PrepareEditorScript();
    $newgroupoutput .= "<div class='header'>" . $clang->gT("Add question group") . "</div>\n";
    //    $newgroupoutput .="<table width='100%' border='0'  class='tab-page'>\n\t<tr><td>\n"
    $newgroupoutput .= "\n" . '<div class="tab-pane" id="tab-pane-newgroup">';
    $newgroupoutput .= "<form action='{$scriptname}' class='form30' id='newquestiongroup' name='newquestiongroup' method='post' onsubmit=\"if (1==0 ";
    foreach ($grplangs as $grouplang) {
        $newgroupoutput .= "|| document.getElementById('group_name_{$grouplang}').value.length==0 ";
    }
    $newgroupoutput .= " ) {alert ('" . $clang->gT("Error: You have to enter a group title for each language.", 'js') . "'); return false;}\" >";
    foreach ($grplangs as $grouplang) {
        $newgroupoutput .= '<div class="tab-page"> <h2 class="tab">' . GetLanguageNameFromCode($grouplang, false);
        if ($grouplang == $baselang) {
            $newgroupoutput .= '(' . $clang->gT("Base Language") . ')';
        }
        $newgroupoutput .= "</h2><ul>" . "<li>" . "<label for='group_name_{$grouplang}'>" . $clang->gT("Title") . ":</label>\n" . "<input type='text' size='80' maxlength='100' name='group_name_{$grouplang}' id='group_name_{$grouplang}' /><font color='red' face='verdana' size='1'> " . $clang->gT("Required") . "</font></li>\n" . "\t<li><label for='description_{$grouplang}'>" . $clang->gT("Description:") . "</label>\n" . "<textarea cols='80' rows='8' id='description_{$grouplang}' name='description_{$grouplang}'></textarea>" . getEditor("group-desc", "description_" . $grouplang, "[" . $clang->gT("Description:", "js") . "](" . $grouplang . ")", $surveyid, '', '', $action) . "</li>\n" . "</ul>" . "\t<p><input type='submit' value='" . $clang->gT("Save question group") . "' />\n" . "</div>\n";
    }
    $newgroupoutput .= "<input type='hidden' name='action' value='insertnewgroup' />\n" . "<input type='hidden' name='sid' value='{$surveyid}' />\n" . "</form>\n";
    // Import TAB
    $newgroupoutput .= '<div class="tab-page"> <h2 class="tab">' . $clang->gT("Import question group") . "</h2>\n";
    $newgroupoutput .= "" . "<form enctype='multipart/form-data' class='form30' id='importgroup' name='importgroup' action='{$scriptname}' method='post' onsubmit='return validatefilename(this,\"" . $clang->gT('Please select a file to import!', 'js') . "\");'>\n" . "<ul>\n" . "<li>\n" . "<label for='the_file'>" . $clang->gT("Select question group file (*.lsg/*.csv):") . "</label>\n" . "<input id='the_file' name=\"the_file\" type=\"file\" size=\"35\" /></li>\n" . "<li><label for='translinksfields'>" . $clang->gT("Convert resources links?") . "</label>\n" . "<input id='translinksfields' name=\"translinksfields\" type=\"checkbox\" checked=\"checked\"/></li></ul>\n" . "\t<p><input type='submit' value='" . $clang->gT("Import question group") . "' />\n" . "\t<input type='hidden' name='action' value='importgroup' />\n" . "\t<input type='hidden' name='sid' value='{$surveyid}' />\n" . "\t</form>\n";
    // End Import TABS
    $newgroupoutput .= "</div>";
    // End of TABS
    $newgroupoutput .= "</div>";
    $newgroupoutput .= "" . "<script type='text/javascript'>\n" . "<!--\n" . "document.getElementById('group_name_{$grouplang}').focus();\n" . "//-->\n" . "</script>\n";
}
Exemplo n.º 4
0
     $editsurvey .= "' /></li>\n" . "<li><label for='dateformat'>" . $clang->gT("Date format:") . "</label>\n" . "<select size='1' id='dateformat' name='dateformat'>\n";
     foreach (getDateFormatData() as $index => $dateformatdata) {
         $editsurvey .= "<option value='{$index}'";
         $editsurvey .= ">" . $dateformatdata['dateformat'] . '</option>';
     }
     $editsurvey .= "</select></li>" . "<li><label for='admin'>" . $clang->gT("Administrator:") . "</label>\n" . "<input type='text' size='50' id='admin' name='admin' value='" . $owner['full_name'] . "' /></li>\n" . "<li><label for='adminemail'>" . $clang->gT("Admin Email:") . "</label>\n" . "<input type='text' size='50' id='adminemail' name='adminemail' value='" . $owner['email'] . "' /></li>\n" . "<li><label for='bounce_email'>" . $clang->gT("Bounce Email:") . "</label>\n" . "<input type='text' size='50' id='bounce_email' name='bounce_email' value='" . $owner['bounce_email'] . "' /></li>\n" . "<li><label for='faxto'>" . $clang->gT("Fax to:") . "</label>\n" . "<input type='text' size='50' id='faxto' name='faxto' /></li>\n";
     $editsurvey .= "</ul>";
     // End General TAB
     $editsurvey .= "</div>\n";
 } elseif ($action == "editsurveysettings") {
     $editsurvey .= "<div id='tabs'><ul>\n            <li><a href='#general'>" . $clang->gT("General") . "</a></li>\n            <li><a href='#presentation'>" . $clang->gT("Presentation & navigation") . "</a></li>\n            <li><a href='#publication'>" . $clang->gT("Publication & access control") . "</a></li>\n            <li><a href='#notification'>" . $clang->gT("Notification & data management") . "</a></li>\n            <li><a href='#tokens'>" . $clang->gT("Tokens") . "</a></li>\n            <li><a href='#resources'>" . $clang->gT("Resources") . "</a></li>\n            </ul>\n            \n";
     $editsurvey .= "<form class='form30' name='addnewsurvey' id='addnewsurvey' action='{$scriptname}' method='post' >\n";
     // General & Contact TAB
     $editsurvey .= "<div id='general'>\n";
     // Base language
     $editsurvey .= "<ul><li><label>" . $clang->gT("Base language:") . "</label>\n" . GetLanguageNameFromCode($esrow['language']) . "</li>\n" . "<li><label for='additional_languages'>" . $clang->gT("Additional Languages") . ":</label>\n" . "<table><tr><td align='left'><select style='min-width:220px;' size='5' id='additional_languages' name='additional_languages'>";
     $jsX = 0;
     $jsRemLang = "<script type=\"text/javascript\">\n            var mylangs = new Array();\n            standardtemplaterooturl='{$standardtemplaterooturl}';\n            templaterooturl='{$usertemplaterooturl}'; \n";
     foreach (GetAdditionalLanguagesFromSurveyID($surveyid) as $langname) {
         if ($langname && $langname != $esrow['language']) {
             // base languag must not be shown here
             $jsRemLang .= "mylangs[{$jsX}] = \"{$langname}\"\n";
             $editsurvey .= "<option id='" . $langname . "' value='" . $langname . "'";
             $editsurvey .= ">" . getLanguageNameFromCode($langname, false) . "</option>\n";
             $jsX++;
         }
     }
     $jsRemLang .= "</script>\n";
     $editsurvey .= $jsRemLang;
     //  Add/Remove Buttons
     $editsurvey .= "</select></td>" . "<td align='left'><input type=\"button\" value=\"<< " . $clang->gT("Add") . "\" onclick=\"DoAdd()\" id=\"AddBtn\" /><br /> <input type=\"button\" value=\"" . $clang->gT("Remove") . " >>\" onclick=\"DoRemove(0,'')\" id=\"RemoveBtn\"  /></td>\n" . "<td align='left'><select size='5' style='min-width:220px;' id='available_languages' name='available_languages'>";
Exemplo n.º 5
0
 * See COPYRIGHT.php for copyright notices and details.
 *
 * $Id: questiongrouphandling.php 11664 2011-12-16 05:19:42Z tmswhite $
 */
//Ensure script is not run directly, avoid path disclosure
include_once "login_check.php";
if ($action == "addgroup") {
    $grplangs = GetAdditionalLanguagesFromSurveyID($surveyid);
    $baselang = GetBaseLanguageFromSurveyID($surveyid);
    $grplangs[] = $baselang;
    $grplangs = array_reverse($grplangs);
    $newgroupoutput = PrepareEditorScript();
    $newgroupoutput .= "<div class='header ui-widget-header'>" . $clang->gT("Add question group") . "</div>\n";
    $newgroupoutput .= "<div id='tabs'>\n<ul>\n";
    foreach ($grplangs as $grouplang) {
        $newgroupoutput .= '<li><a href="#' . $grouplang . '">' . GetLanguageNameFromCode($grouplang, false);
        if ($grouplang == $baselang) {
            $newgroupoutput .= '(' . $clang->gT("Base language") . ')';
        }
        $newgroupoutput .= "</a></li>\n";
    }
    if (bHasSurveyPermission($surveyid, 'surveycontent', 'import')) {
        $newgroupoutput .= '<li><a href="#import">' . $clang->gT("Import question group") . "</a></li>\n";
    }
    $newgroupoutput .= "</ul>";
    //    $newgroupoutput .="<table width='100%' border='0'  class='tab-page'>\n\t<tr><td>\n"
    $newgroupoutput .= "\n";
    $newgroupoutput .= "<form action='{$scriptname}' class='form30' id='newquestiongroup' name='newquestiongroup' method='post' onsubmit=\"if (1==0 ";
    foreach ($grplangs as $grouplang) {
        $newgroupoutput .= "|| document.getElementById('group_name_{$grouplang}').value.length==0 ";
    }