Odstranjena nastavitev za admine za sistemski jezik, jezik za respondente je pri kreiranju ankete vedno enak jeziku admina
This commit is contained in:
parent
a9fc02b009
commit
6313e93c8b
@ -4361,7 +4361,7 @@ class SurveyAdmin
|
||||
/**
|
||||
* @desc ustvari novo anketo
|
||||
*/
|
||||
function nova_anketa($naslov = null, $intro_opomba = '', $akronim = null, $survey_type = 2, $lang_resp = 1, $skin = '1kaBlue')
|
||||
function nova_anketa($naslov = null, $intro_opomba = '', $akronim = null, $survey_type = 2, $skin = '1kaBlue')
|
||||
{
|
||||
|
||||
global $lang;
|
||||
@ -4396,10 +4396,10 @@ class SurveyAdmin
|
||||
|
||||
$starts = $_POST['starts'] ? "'" . $_POST['starts'] . "'" : "NOW()";
|
||||
$expire = $_POST['expire'] ? "'" . $_POST['expire'] . "'" : "NOW() + INTERVAL 3 MONTH ";
|
||||
#$expire = $_POST['expire'] ? "'" . $_POST['expire'] . "'" : "NOW() + INTERVAL 30 DAY ";
|
||||
|
||||
$lang_resp = ((int)$lang_resp > 0) ? $lang_resp : 1;
|
||||
// Nastavimo jezik - admin in response jezik je vedno enak nastavitvi, ki jo ima uporabnik a default
|
||||
$lang_admin = ((int)$lang_admin > 0) ? $lang_admin : 1;
|
||||
$lang_resp = $lang_admin;
|
||||
|
||||
# ali ima uporabnik nastavljeno da je anketa privzeto aktivna:
|
||||
$autoActiveSurvey = (int)UserSetting::getInstance()->getUserSetting('autoActiveSurvey');
|
||||
|
@ -597,19 +597,8 @@ class SurveyAdminAjax {
|
||||
if (!$sql)
|
||||
echo mysqli_error($GLOBALS['connect_db']);
|
||||
}
|
||||
if (isset ($_POST['SurveyLang_admin'])) {
|
||||
$val = $_POST['SurveyLang_admin'];
|
||||
$sql = sisplet_query("UPDATE misc SET value='$val' WHERE what = 'SurveyLang_admin'");
|
||||
if (!$sql)
|
||||
echo mysqli_error($GLOBALS['connect_db']);
|
||||
}
|
||||
if (isset ($_POST['SurveyLang_resp'])) {
|
||||
$val = $_POST['SurveyLang_resp'];
|
||||
$sql = sisplet_query("UPDATE misc SET value='$val' WHERE what = 'SurveyLang_resp'");
|
||||
if (!$sql)
|
||||
echo mysqli_error($GLOBALS['connect_db']);
|
||||
}
|
||||
} elseif ($_GET['m'] == 'global_user_settings') {
|
||||
}
|
||||
elseif ($_GET['m'] == 'global_user_settings') {
|
||||
if (isset ($_POST['language'])) {
|
||||
$lang = $_POST['language'];
|
||||
|
||||
@ -1755,7 +1744,7 @@ class SurveyAdminAjax {
|
||||
if (trim($_POST['survey_type']) == '') {
|
||||
$_POST['survey_type'] = 2;
|
||||
}
|
||||
$anketa = $this->SurveyAdmin->nova_anketa($naslov, $intro_opomba, $akronim, $_POST['survey_type'], $_POST['lang_resp'], $skin);
|
||||
$anketa = $this->SurveyAdmin->nova_anketa($naslov, $intro_opomba, $akronim, $_POST['survey_type'], $skin);
|
||||
|
||||
// Ce imamo pri ustvarjanju doloceno tudi mapo, anketo vstavimo v njo
|
||||
if(isset($_POST['folder']) && $_POST['folder'] > 0){
|
||||
|
@ -4836,10 +4836,6 @@ class SurveyAdminSettings {
|
||||
list ($SurveyExport) = mysqli_fetch_row($result);
|
||||
$result = sisplet_query("SELECT value FROM misc WHERE what='SurveyForum'");
|
||||
list ($SurveyForum) = mysqli_fetch_row($result);
|
||||
$result = sisplet_query("SELECT value FROM misc WHERE what='SurveyLang_admin'");
|
||||
list ($SurveyLang_admin) = mysqli_fetch_row($result);
|
||||
$result = sisplet_query("SELECT value FROM misc WHERE what='SurveyLang_resp'");
|
||||
list ($SurveyLang_resp) = mysqli_fetch_row($result);
|
||||
|
||||
echo '<span class="nastavitveSpan1" ><label>' . $lang['SurveyDostop'] . ':</label></span>';
|
||||
?>
|
||||
@ -4888,55 +4884,8 @@ class SurveyAdminSettings {
|
||||
?>
|
||||
</select>
|
||||
</fieldset>
|
||||
<fieldset><legend><?=$lang['lang']?></legend>
|
||||
<?php
|
||||
|
||||
$lang_array = array();
|
||||
$lang_orig_id = $lang['id'];
|
||||
// Preberemo razpoložljive jezikovne datoteke
|
||||
if ($dir = opendir('../../lang')) {
|
||||
while (($file = readdir($dir)) !== false) {
|
||||
if ($file != '.' AND $file != '..') {
|
||||
if (is_numeric(substr($file, 0, strpos($file, '.')))) {
|
||||
$i = substr($file, 0, strpos($file, '.'));
|
||||
$file = '../../lang/'.$i.'.php';
|
||||
include($file);
|
||||
$lang_array[$lang['language']] = $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
$file = '../../lang/'.$lang_orig_id.'.php';
|
||||
include($file); // naložimo nazaj trenutni languague file
|
||||
}
|
||||
|
||||
// Sortiramo lang datoteke po abecedi
|
||||
ksort($lang_array);
|
||||
|
||||
?>
|
||||
<span class="nastavitveSpan1" ><label><?=$lang['srv_language_admin']?>:</label></span>
|
||||
<select name="SurveyLang_admin">
|
||||
<?
|
||||
foreach ($lang_array AS $val => $key) {
|
||||
echo '<option value="'.$key.'"'.($SurveyLang_admin==$key?' selected':'').'>'.$val.'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<br />
|
||||
|
||||
<span class="nastavitveSpan1" ><label><?=$lang['srv_language_respons']?>:</label></span>
|
||||
<select name="SurveyLang_resp">
|
||||
<?
|
||||
foreach ($lang_array AS $val => $key) {
|
||||
echo '<option value="'.$key.'"'.($SurveyLang_resp==$key?' selected':'').'>'.$val.'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<br />
|
||||
|
||||
<?php
|
||||
|
||||
echo '</fieldset>';
|
||||
|
||||
<?php
|
||||
echo '<fieldset>';
|
||||
echo '<legend>' . $lang['srv_edithelp'] . '</legend>';
|
||||
|
||||
@ -9247,14 +9196,7 @@ class SurveyAdminSettings {
|
||||
echo '<input name="lockSurvey" type="checkbox" value="1" '.($lockSurvey == 1?' checked="checked"':'').'></label>';
|
||||
|
||||
echo '<br />';
|
||||
|
||||
// Napredni vmesnik (star design za moje ankete) - TEGA NIMAMO VEC (PUSTIMO SAMO KODO V OZADJU, CE BI KDAJ VASJA HOTEL NAZAJ:))
|
||||
/*echo '<label><span class="nastavitveSpan6">'.$lang['srv_settings_advancedMySurveys'].':</span>';
|
||||
echo '<input name="advancedMySurveys" type="hidden" value="0">';
|
||||
echo '<input name="advancedMySurveys" type="checkbox" value="1" '.($advancedMySurveys == 1?' checked="checked"':'').'></label>';
|
||||
|
||||
echo '<br />';*/
|
||||
|
||||
|
||||
// Opcija enklik ustvarjanja ankete (v mojih anketah)
|
||||
echo '<label><span class="nastavitveSpan6">'.$lang['srv_settings_oneClickCreate'].':</span>';
|
||||
echo '<input name="oneclickCreateMySurveys" type="hidden" value="0">';
|
||||
|
@ -33,7 +33,6 @@ if ($anketa > 0) {
|
||||
$lang_admin = $row['lang_admin'];
|
||||
}
|
||||
if ($lang_admin == 0) {
|
||||
//$sql = sisplet_query("SELECT * FROM misc WHERE what = 'SurveyLang_admin'");
|
||||
$sql = sisplet_query("SELECT lang FROM users WHERE id = '$global_user_id'");
|
||||
$row = @mysqli_fetch_array($sql);
|
||||
$lang_admin = $row['lang'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user