diff options
Diffstat (limited to 'main/survey/app/Controllers/HeaderController.php')
-rw-r--r-- | main/survey/app/Controllers/HeaderController.php | 126 |
1 files changed, 93 insertions, 33 deletions
diff --git a/main/survey/app/Controllers/HeaderController.php b/main/survey/app/Controllers/HeaderController.php index 1a7df13..ad77435 100644 --- a/main/survey/app/Controllers/HeaderController.php +++ b/main/survey/app/Controllers/HeaderController.php @@ -15,6 +15,7 @@ use SurveyAdvancedParadataLog; use SurveyInfo;
use SurveyThemeEditor;
use SurveyPanel;
+use AppSettings;
class HeaderController extends Controller
{
@@ -55,7 +56,6 @@ class HeaderController extends Controller 'urejanje',
'quick_view',
'disableif',
- 'disablealert',
'disablecode',
'displayifs',
'displayvariables',
@@ -116,9 +116,11 @@ class HeaderController extends Controller return header('Location: ' . self::$site_url);
die("Missing anketa id!");
}
- $anketa = (($get->anketa) ? $get->anketa : $_POST['anketa']);
+ $anketa_hash = (($get->anketa) ? $get->anketa : $_POST['anketa']);
+ $anketa = getSurveyIdFromHash($anketa_hash);
// Shranimo vse spremenljivke iz get parametrov v classu VariableClass
+ save('anketa_hash', $anketa_hash);
save('anketa', $anketa);
save('get', $get);
@@ -149,8 +151,6 @@ class HeaderController extends Controller * @desc zgenereira header
*/
public function header(){
- global $app_settings;
-
// preprecimo caching - tudi s klikom na gumb nazaj!
header("Last-Modified: " . gmdate("D, j M Y H:i:s") . " GMT");
@@ -168,8 +168,8 @@ class HeaderController extends Controller $rowv = mysqli_fetch_array($sqlv);
// Custom header title
- if(isset($app_settings['head_title_custom']) && $app_settings['head_title_custom'] == 1){
- echo '<title>'.strip_tags(Helper::getInstance()->displayAkronim(0)).' - '.$app_settings['head_title_text'].'</title>' . "\n";
+ if(AppSettings::getInstance()->getSetting('app_settings-head_title_custom')){
+ echo '<title>'.strip_tags(Helper::getInstance()->displayAkronim(0)).' - '.AppSettings::getInstance()->getSetting('app_settings-head_title_text').'</title>' . "\n";
}
// Default header title
else{
@@ -181,6 +181,9 @@ class HeaderController extends Controller // Preprecimo vklop compatibility moda v IE
echo ' <meta http-equiv="X-UA-Compatible" content="IE=edge" />' . "\n";
+ // Preprecimo indexiranje botov (google...)
+ echo ' <meta name="robots" content="noindex">' . "\n";
+
// nova verzija UI 1.8.10 - includamo minificirano skupaj z script.js (uporabimo iste jQuery fajle kot v adminu)
echo ' <script src="' . self::$site_url . 'admin/survey/minify/g=jsfrontend?v=' . $rowv['value'] . '"></script>' . "\n";
echo '<script src="https://www.google.com/recaptcha/api.js" async defer></script>' . "\n";
@@ -188,13 +191,14 @@ class HeaderController extends Controller // tukaj nalozimo CSS za jquery in template temo
echo ' <link href="' . self::$site_url . 'admin/survey/minify/g=cssfrontend?v=' . $rowv['value'] . '" rel="stylesheet">' . "\n";
- //nalozimo stringe iz langa za JS
+ // nalozimo stringe iz langa za JS
echo '<script type="text/javascript" src="' . self::$site_url . 'admin/survey/script/js-lang.php?lang=' . ($row['lang_admin'] == 1 ? 'si' : 'en') . '&v=' . $rowv['value'] . '"></script>' . "\n";
- // nalozimo open sans fonte za nov design
- echo '<link type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,700italic,400,600,700&subset=latin,latin-ext" rel="stylesheet" />';
- /*echo '<link type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700&subset=latin,latin-ext" rel="stylesheet">';*/
- echo '<link type="text/css" href="https://fonts.googleapis.com/css?family=Montserrat:400,400i,500,500i,600,600i,700,700i&subset=latin-ext" rel="stylesheet" />';
+ // nalozimo source sans pro fonte za nov design
+ echo '<link type="text/css" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,500,500i,600,600i,700,700i&subset=latin-ext" rel="stylesheet">';
+ // Zaenkrat se obdrzimo montserratt zaradi kompatibilnosti za nazaj
+ echo '<link type="text/css" href="https://fonts.googleapis.com/css?family=Montserrat:400,400i,500,500i,600,600i,700,700i&subset=latin-ext" rel="stylesheet" />';
+
// CSS mobile skin za telefone in tablice
@@ -205,7 +209,15 @@ class HeaderController extends Controller // za MJU anketo nalozimo posebej custom skin
if(SurveyInfo::getInstance()->checkSurveyModule('mju_theme') == '1'){
$this->loadCustomMadeSkin($custom_skin='MJU');
- }
+ }
+ // Custom skin za IAS (Spanci)
+ elseif($row['skin'] == 'IAS'){
+ $this->loadCustomMadeSkin($custom_skin='IAS');
+ }
+ // Custom skin za IAS (Spanci)
+ elseif($row['skin'] == 'Automaticservis'){
+ $this->loadCustomMadeSkin($custom_skin='Automaticservis');
+ }
// CSS samo za mobilne telefone
else{
$this->themeEditorMobileCustom();
@@ -220,6 +232,14 @@ class HeaderController extends Controller if(SurveyInfo::getInstance()->checkSurveyModule('mju_theme') == '1'){
$this->loadCustomMadeSkin($custom_skin='MJU');
}
+ // Custom skin za IAS (Spanci)
+ elseif($row['skin'] == 'IAS'){
+ $this->loadCustomMadeSkin($custom_skin='IAS');
+ }
+ // Custom skin za IAS (Spanci)
+ elseif($row['skin'] == 'Automaticservis'){
+ $this->loadCustomMadeSkin($custom_skin='Automaticservis');
+ }
// profili tem - skinov
else{
$this->themeEditor();
@@ -236,6 +256,14 @@ class HeaderController extends Controller elseif(SurveyInfo::getInstance()->checkSurveyModule('mju_theme') == '1'){
$this->loadCustomMadeSkin($custom_skin='MJU');
}
+ // Custom skin za IAS (Spanci)
+ elseif($row['skin'] == 'IAS'){
+ $this->loadCustomMadeSkin($custom_skin='IAS');
+ }
+ // Custom skin za Automaticservis
+ elseif($row['skin'] == 'Automaticservis'){
+ $this->loadCustomMadeSkin($custom_skin='Automaticservis');
+ }
// profili tem - skinov
else{
$this->themeEditor();
@@ -293,7 +321,7 @@ class HeaderController extends Controller $preview = ' class="preview"';
echo '<body ' . $preview . ' ' . $evoli_copy_disable . '>' . "\n";
- // Zamenjamo class no_js z js -> test javacsripta za userje (javascript_warning)
+
echo "<script>" . "\n";
$tooltips_maxwitdh = "maxWidth: '880'";
if ($row['skin'] == 'Embed2')
@@ -302,7 +330,6 @@ class HeaderController extends Controller $tooltips_maxwitdh = "maxWidth: '680'";
echo "$(document).ready(function(){
- $('html').removeClass('no_js').addClass('js');
$('.tooltip.mouseover').tooltipster({
theme: 'tooltipster-shadow',";
echo $tooltips_maxwitdh;
@@ -314,8 +341,6 @@ class HeaderController extends Controller echo $tooltips_maxwitdh;
echo " });";
- // Tega ne rabimo vec, ker urejamo okvir slik direktno s css-jem (na parenta (.variabla) damo class checked)
- //echo "$('div.variabla input:checkbox, div.variabla input:radio').on('change', function() { activateCehckboxImages($(this)); });"."\n";
# če smo v quick_view disejblamo vse elemente frme
if (get('quick_view') == true) {
@@ -402,7 +427,6 @@ class HeaderController extends Controller public function themeEditor($themePreview = false){
- if (isset($_GET['theme'])) $themePreview = true; // to ne bo vec
if (isset($_GET['theme-preview']) && $_GET['theme-preview'] == '1') $themePreview = true; // to je pri urejanju CSSa da se refresha mimo cachea
$row = SurveyInfo::getSurveyRow();
@@ -410,7 +434,8 @@ class HeaderController extends Controller if (isset($_GET['theme_profile'])) {
$row['skin_profile'] = (int)$_GET['theme_profile'];
}
- if (isset($_GET['theme'])) {//to ne bo vec
+ if (isset($_GET['theme'])) {
+ $themePreview = true;
$row['skin'] = str_replace('.css', '', $_GET['theme']);
$row['skin_profile'] = 0;
}
@@ -456,15 +481,15 @@ class HeaderController extends Controller break;
case '2':
- echo '.spremenljivka';
+ echo '.spremenljivka .naslov';
break;
case '3':
- echo '.variable_holder';
+ echo '.variable_holder .variabla, td.question, td.category';
break;
case '4':
- echo 'table.grid_table tbody tr:nth-child(2n+1)';
+ echo 'table.grid_table tbody tr:nth-child(2n+1), .variable_holder .variabla';
break;
case '5':
@@ -511,7 +536,7 @@ class HeaderController extends Controller break;
case '4':
- echo 'font-size: ' . $rowt['value'] . '%;';
+ echo 'font-size: ' . $rowt['value'] . '% !important;';
break;
case '5':
@@ -600,13 +625,15 @@ class HeaderController extends Controller // Najprej nalozimo mobile template skin
echo ' <link rel="stylesheet" href="' . self::$site_url . 'public/css/main_mobile.css" media="all">' . "\n";
-
+
+ $themePreview = false;
if (isset($_GET['theme_profile'])) {
$row['skin_profile_mobile'] = (int)$_GET['theme_profile'];
}
if (isset($_GET['theme'])) {
$themePreview = true;
$row['mobile_skin'] = str_replace('.css', '', $_GET['theme']);
+ $row['skin_profile_mobile'] = 0;
}
@@ -655,15 +682,15 @@ class HeaderController extends Controller break;
case '3':
- echo '.variable_holder, .variable_holder .variabla label';
+ echo '.variable_holder .variabla label, .grid_mobile_title_text, .grid_mobile_variable_title';
break;
case '4':
- echo 'table.grid_table tbody tr:nth-child(2n+1)';
+ echo 'table.grid_table tbody tr:nth-child(2n+1), .grid_mobile_variable, .variable_holder .variabla';
break;
case '5':
- echo '.spremenljivka';
+ echo 'div.spremenljivka';
break;
case '7':
@@ -708,12 +735,12 @@ class HeaderController extends Controller case '5':
if ($rowt['value'] == '0') {
- echo 'border: 0;';
+ echo 'border: 0 !important;';
} elseif ($rowt['value'] == '2') {
- echo 'border: 1px #B9C5D9 solid;';
+ echo 'border: 1px #B9C5D9 solid !important;';
} else {
echo 'border: 0;';
- echo 'border-top: 1px #B9C5D9 solid;';
+ echo 'border-top: 1px #B9C5D9 solid !important;';
}
break;
@@ -779,7 +806,7 @@ class HeaderController extends Controller $sqla = sisplet_query("SELECT logo FROM srv_theme_profiles WHERE id = '$row[skin_profile]'");
$rowa = mysqli_fetch_array($sqla);
- if ($rowa['logo'] != '') {
+ if (isset($rowa['logo']) && $rowa['logo'] != '') {
$this->customLogoCSS($rowa['logo']);
}
}
@@ -846,6 +873,39 @@ class HeaderController extends Controller echo ' <link rel="stylesheet" href="' . self::$site_url . 'main/survey/skins/___po_narocilu/MJU.css' . ($themePreview ? '?foo=' . mt_rand() : '') . '">' . "\n";
}
}
+ // Custom skin za IAS anketo - spanci
+ elseif($custom_skin == 'IAS'){
+
+ // Font PT sans
+ //echo '<link type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,700&subset=latin,latin-ext" rel="stylesheet">';
+ echo '<link type="text/css" href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&display=swap" rel="stylesheet"> ';
+
+ // mobitel
+ if (get('mobile') == 1) {
+ echo ' <link rel="stylesheet" href="' . self::$site_url . 'public/css/main_mobile.css" media="all">' . "\n";
+ echo ' <link rel="stylesheet" href="' . self::$site_url . 'main/survey/skins/___po_narocilu/IAS_mobile.css' . ($themePreview ? '?foo=' . mt_rand() : '') . '">' . "\n";
+ }
+ // navaden racunalnik
+ else{
+ echo ' <link rel="stylesheet" href="' . self::$site_url . 'main/survey/skins/___po_narocilu/IAS.css' . ($themePreview ? '?foo=' . mt_rand() : '') . '">' . "\n";
+ }
+ }
+ // Custom skin za automaticservis
+ elseif($custom_skin == 'Automaticservis'){
+
+ // Font PT sans
+ echo '<link type="text/css" href="https://fonts.googleapis.com/css?family=PT+Sans:400,700&subset=latin,latin-ext" rel="stylesheet">';
+
+ // mobitel
+ if (get('mobile') == 1) {
+ echo ' <link rel="stylesheet" href="' . self::$site_url . 'public/css/main_mobile.css" media="all">' . "\n";
+ echo ' <link rel="stylesheet" href="' . self::$site_url . 'main/survey/skins/___po_narocilu/Automaticservis_mobile.css' . ($themePreview ? '?foo=' . mt_rand() : '') . '">' . "\n";
+ }
+ // navaden racunalnik
+ else{
+ echo ' <link rel="stylesheet" href="' . self::$site_url . 'main/survey/skins/___po_narocilu/Automaticservis.css' . ($themePreview ? '?foo=' . mt_rand() : '') . '">' . "\n";
+ }
+ }
}
@@ -875,7 +935,7 @@ class HeaderController extends Controller // Ce je original visji kot 160 ga avtomatsko pomanjsamo
elseif($size_orig[1] > 160) {
- $image = self::$site_url . 'function/thumb.php?src=' . self::$site_url . 'main/survey/uploads/' . $logo . '&h=100';
+ $image = self::$site_url . 'utils/thumb.php?src=' . self::$site_url . 'main/survey/uploads/' . $logo . '&h=100';
$size = @getimagesize($image);
if($size){
@@ -894,9 +954,9 @@ class HeaderController extends Controller // CSS za custom logo
echo '<style type="text/css">';
- echo '#logo, #logo.english, #footer_survey #logo, #footer_survey #logo.english {';
+ echo '#logo, #logo.english, #logo.namestitev, #logo.arnes, #footer_survey #logo, #footer_survey #logo.english, #footer_survey #logo.namestitev, #footer_survey #logo.arnes {';
- echo ' background-image: url('.$css_bg_image.'); ';
+ echo ' background-image: url('.$css_bg_image.') !important; ';
if($css_width != '')
echo ' width: '.$css_width.'; ';
|