diff --git a/admin/survey/classes/mobile/class.MobileSurveyAdmin.php b/admin/survey/classes/mobile/class.MobileSurveyAdmin.php index bb74bc1a9..c6e2246ae 100644 --- a/admin/survey/classes/mobile/class.MobileSurveyAdmin.php +++ b/admin/survey/classes/mobile/class.MobileSurveyAdmin.php @@ -39,9 +39,13 @@ class MobileSurveyAdmin{ // Meni $this->displayMenu(); - // Naslov ankete + // Naslov ankete + slider za nastavitve if($this->surveyAdminClass->anketa > 0){ $this->displaySurveyTitle(); + if ($_GET['a'] == 'branching') { + $this->displaySurveySettingsIcon(); + $this->displayMenuSurveySettings(); + } } // Logo - enak kot na desktopu else{ @@ -50,6 +54,8 @@ class MobileSurveyAdmin{ // Se inicializiramo zeynep jquery mobile menu echo ''; + // inicializira meni nastavitev v urejanju ankete + echo ''; echo ''; } @@ -89,6 +95,17 @@ class MobileSurveyAdmin{ echo ''; } + private function displaySurveySettingsIcon(){ + + echo '
'; + echo ' '; + echo '
'; + + echo '
'; + echo ' '; + echo '
'; + } + // Izris menija private function displayMenu(){ @@ -116,6 +133,88 @@ class MobileSurveyAdmin{ } + +// Izris menija za nastavitve v urejanju ankete +private function displayMenuSurveySettings(){ + global $lang; + + echo '
'; + echo '
'; + + // prikaz gumbov za vklop in odklepanje ankete - v delu + $d = new Dostop(); + if ($d->checkDostopAktiven()) { + + echo ''; + + if (SurveyInfo::getSurveyColumn('active') == 1) { + # anketa je aktivna + # V kolikor gre za hierarhijo in uporabnik ni administrator hierarhije + if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){ + if ($hierarhija_type == 1) { + echo ''; + } else{ + echo ''; + } + }else { + echo ''; + } + + echo '
ON
'; + + echo '
'; + } else { + $anketa_active = "anketa_active('" . $this->anketa . "','" . $row['active'] . "'); "; + + //Preden anketo aktiviramo preverimo, če gre tudi za izgradnjo hierarhije in če anketa še ni bila aktivirana + if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){ + if ($hierarhija_type == 1) { + echo ''; + } else{ + echo ''; + } + }else { + echo ''; + } + + if ((int)$_last_active > 0) { + # anketa je zaključena + echo '
OFF
'; + } else { + # anketa je neaktivna + echo '
OFF
'; + } + + echo '
'; + } + + // Ce ima uporabnik prepreceno moznost odklepanja ankete, anketo ima vedno zaklenjeno če je vklopljena hierarhija + $prevent_unlock = (SurveyInfo::getSurveyModules('hierarhija') == 2 || $d->checkDostopSub('lock') && $row['locked'] == 1 && ($admin_type != 0 && $admin_type != 1)) ? 1 : 0; + if ($prevent_unlock == 1) { + echo ''; + echo ''; + echo ''; + echo ''; + } else { + # zaklepanje + //echo ''; + if ($hierarhija_type == 10) { + echo ''; + } else { + echo ''; + } + echo ''; + echo ''; + } + + echo '
'; + } + + + echo '
'; + +} + // Izris uporabniških podatkov v dropdownu private function displayMenuUser(){ global $lang, $global_user_id, $site_url; diff --git a/admin/survey/script/mobile.js b/admin/survey/script/mobile.js index 432fd9e2d..b1a326516 100644 --- a/admin/survey/script/mobile.js +++ b/admin/survey/script/mobile.js @@ -36,6 +36,30 @@ function mobile_init(){ }) } +function mobile_settings_init() { + + // handle settings overlay click + $('.mobile_settings_close').on('click', function () { + $('.mobile_settings').animate({"margin-right": '-=85vw'},200,'linear'); + $('#fade').fadeOut(); + + $('.mobile_settings_close').fadeOut('fast', function(){ + $('.mobile_settings_open').fadeIn('fast'); + }); + }) + + // open settings side menu + $('.mobile_settings_open').on('click', function () { + $('.mobile_settings').animate({"margin-right": '+=85vw'},200,'linear'); + $('#fade').fadeIn(); + + $('.mobile_settings_open').fadeOut('fast', function(){ + $('.mobile_settings_close').fadeIn('fast'); + }); + }) +} + + // Popup za dodajanje vprasanja na mobile function mobile_add_question_popup(){ $('.mobile_add_question_popup').fadeIn(); diff --git a/public/css/admin.css b/public/css/admin.css index 37cb1289a..dfb4b62df 100644 --- a/public/css/admin.css +++ b/public/css/admin.css @@ -28685,6 +28685,21 @@ fieldset textarea { .mobile_header .mobile_menu_icon span { cursor: pointer; } + .mobile_header .mobile_settings_icon { + width: 60px; + text-align: center; + } + .mobile_header .mobile_settings_icon.mobile_settings_close { + display: none; + } + .mobile_header .mobile_settings_icon.mobile_settings_close span { + font-size: 30px; + font-weight: 600; + line-height: 25px; + } + .mobile_header .mobile_settings_icon span { + cursor: pointer; + } .mobile_header .mobile_survey_title { width: calc(100% - 120px); text-align: center; @@ -28847,6 +28862,29 @@ fieldset textarea { font-size: 20px; } + /* Mobile meni - NASTAVITVE V UREJANJU ANKETE*/ + .mobile_settings { + position: fixed; + right: 0; + z-index: 9994; + display: flex; + flex-direction: column; + top: 71px; + bottom: 0; + width: 85vw; + color: #333; + background-color: #ffffff; + overflow: hidden; + -webkit-overflow-scrolling: touch; + overflow-y: auto; + pointer-events: none; + margin-right: -85vw; + } + + .mobile_settings_content { + padding: 20px; + } + #srv_footer { display: flex; flex-direction: column; diff --git a/resources/sass/admin/mobile/header.scss b/resources/sass/admin/mobile/header.scss index 8153d7222..2046bd4d1 100644 --- a/resources/sass/admin/mobile/header.scss +++ b/resources/sass/admin/mobile/header.scss @@ -46,6 +46,25 @@ } } + .mobile_settings_icon{ + width: 60px; + text-align: center; + + &.mobile_settings_close{ + display: none; + + span{ + font-size: 30px; + font-weight: 600; + line-height: 25px; + } + } + + span{ + cursor: pointer; + } + } + .mobile_survey_title{ width: calc(100% - 120px); @@ -262,3 +281,31 @@ } } } + +/* Mobile meni - NASTAVITVE V UREJANJU ANKETE*/ +.mobile_settings{ + position: fixed; + right: 0; + z-index: 9994; + + display: flex; + flex-direction: column; + + top: 71px; + bottom: 0; + width: 85vw; + + color: $main_text; + + background-color: #ffffff; + + overflow: hidden; + -webkit-overflow-scrolling: touch; + overflow-y: auto; + pointer-events: none; + margin-right: -85vw; +} + +.mobile_settings_content { + padding: 20px; +}