Slider z nastavitvami za odklepanje in aktivacijo ankete - v1

This commit is contained in:
tejagerjovic 2021-09-07 13:32:19 +02:00
parent 4358f1053a
commit a34145414f
4 changed files with 209 additions and 1 deletions

View File

@ -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 '<script> mobile_init(); </script>';
// inicializira meni nastavitev v urejanju ankete
echo '<script> mobile_settings_init(); </script>';
echo '</div>';
}
@ -89,6 +95,17 @@ class MobileSurveyAdmin{
echo '</div>';
}
private function displaySurveySettingsIcon(){
echo '<div class="mobile_settings_icon mobile_settings_open">';
echo ' <span class="faicon wheel_32"></span>';
echo '</div>';
echo '<div class="mobile_settings_icon mobile_settings_close">';
echo ' <span>✕</span>';
echo '</div>';
}
// Izris menija
private function displayMenu(){
@ -116,6 +133,88 @@ class MobileSurveyAdmin{
}
// Izris menija za nastavitve v urejanju ankete
private function displayMenuSurveySettings(){
global $lang;
echo '<div class="mobile_settings">';
echo '<div class="mobile_settings_content">';
// prikaz gumbov za vklop in odklepanje ankete - v delu
$d = new Dostop();
if ($d->checkDostopAktiven()) {
echo '<span class="borderLeft">';
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 '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&amp;m=' . M_ADMIN_AKTIVACIJA . '" class="srv_ico" title="' . $lang['srv_anketa_noactive'] . '">';
} else{
echo '<a href="#" class="srv_ico" title="' . $lang['srv_anketa_active'] . '" style="cursor:text !important;">';
}
}else {
echo '<a href="#" class="srv_ico" onclick="anketa_active(\'' . $this->anketa . '\',\'' . $row['active'] . '\'); return false;" title="' . $lang['srv_anketa_active'] . '">';
}
echo '<div id="srv_active" class="switch_anketa anketa_on"><span class="switch_anketa_content">ON</span></div>';
echo '</a>';
} 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 '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&amp;m=' . M_ADMIN_AKTIVACIJA . '" class="srv_ico" title="' . $lang['srv_anketa_noactive'] . '">';
} else{
echo '<a href="#" class="srv_ico" title="' . $lang['srv_anketa_noactive'] . '">';
}
}else {
echo '<a href="#" class="srv_ico" onclick="' . $anketa_active . ' return false;" title="' . $lang['srv_anketa_noactive'] . '">';
}
if ((int)$_last_active > 0) {
# anketa je zaključena
echo '<div id="srv_inactive" class="switch_anketa anketa_off"><span class="switch_anketa_content">OFF</span></div>';
} else {
# anketa je neaktivna
echo '<div id="srv_inactive" class="switch_anketa anketa_off"><span class="switch_anketa_content">OFF</span></div>';
}
echo '</a>';
}
// 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 '<input type="hidden" name="prevent_unlock" id="prevent_unlock" value="1">';
echo '<a class="anketa_img_nav" title="' . $lang['srv_anketa_locked_close'] . '">';
echo '<span class="faicon lock_close"></span>';
echo '</a>';
} else {
# zaklepanje
//echo '<a class="anketa_img_nav" href="javascript:anketa_lock(\''.$this->anketa.'\', \''.($row['locked']==0?'1':'0').'\');" title="'.$lang['srv_anketa_locked_'.$row['locked']].'"><img style="margin-left: 5px;" src="img_0/lock'.($row['locked']==0?'_open':'').'.png" /></a>';
if ($hierarhija_type == 10) {
echo '<a href="#" class="anketa_img_nav" title="' . $lang['srv_anketa_locked_' . $row['locked']] . '" style="cursor:text !important;">';
} else {
echo '<a class="anketa_img_nav" href="javascript:anketa_lock(\'' . $this->anketa . '\', \'' . ($row['locked'] == 0 ? '1' : '0') . '\', \''.$row['mobile_created'].'\');" title="' . $lang['srv_anketa_locked_' . $row['locked']] . '">';
}
echo '<span class="faicon lock' . ($row['locked'] == 0 ? '_open' : '_close') . '"></span>';
echo '</a>';
}
echo '</span>';
}
echo '</div></div>';
}
// Izris uporabniških podatkov v dropdownu
private function displayMenuUser(){
global $lang, $global_user_id, $site_url;

View File

@ -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();

View File

@ -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;

View File

@ -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;
}