summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.SurveyTheme.php
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
commit75160b12821f7f4299cce7f0b69c83c1502ae071 (patch)
tree27e25e4ccaef45f0c58b22831164050d1af1d4db /admin/survey/classes/class.SurveyTheme.php
parentprvi-commit (diff)
download1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip
Diffstat (limited to 'admin/survey/classes/class.SurveyTheme.php')
-rw-r--r--admin/survey/classes/class.SurveyTheme.php519
1 files changed, 360 insertions, 159 deletions
diff --git a/admin/survey/classes/class.SurveyTheme.php b/admin/survey/classes/class.SurveyTheme.php
index 9793b76..978d6be 100644
--- a/admin/survey/classes/class.SurveyTheme.php
+++ b/admin/survey/classes/class.SurveyTheme.php
@@ -15,7 +15,6 @@ class SurveyTheme {
global $site_domain;
global $global_user_id;
global $admin_type;
- global $debug;
$this->sid = $sid;
@@ -65,14 +64,13 @@ class SurveyTheme {
10 => 'Otroci4.css',
11 => 'Embed.css',
12 => 'Embed2.css',
- 13 => 'Slideshow.css'
+ //13 => 'Slideshow.css'
);
- //if((($admin_type == '0' || $admin_type == '1') && (strpos($site_url, 'www.1ka.si') || strpos($site_url, 'test.1ka.si'))) || $debug == '1'){
- $standard_skins[14] = 'Uni.css';
- $standard_skins[15] = 'Fdv.css';
- $standard_skins[16] = 'Cdi.css';
- $standard_skins[17] = 'WebSM.css';
- //}
+
+ $standard_skins[14] = 'Uni.css';
+ $standard_skins[15] = 'Fdv.css';
+ $standard_skins[16] = 'Cdi.css';
+ $standard_skins[17] = 'WebSM.css';
// Novi safe skini so v loceni skupini
$safe_skins = array(
@@ -96,11 +94,10 @@ class SurveyTheme {
5 => 'MobilePurple.css',
6 => 'MobileBlack.css'
);
- //if((($admin_type == '0' || $admin_type == '1') && (strpos($site_url, 'www.1ka.si') || strpos($site_url, 'test.1ka.si'))) || $debug == '1'){
- $mobile_skins[7] = 'MobileUni.css';
- $mobile_skins[8] = 'MobileFdv.css';
- $mobile_skins[9] = 'MobileCdi.css';
- //}
+
+ $mobile_skins[7] = 'MobileUni.css';
+ $mobile_skins[8] = 'MobileFdv.css';
+ $mobile_skins[9] = 'MobileCdi.css';
// Safe skini
if(in_array($file, $safe_skins)){
@@ -164,7 +161,7 @@ class SurveyTheme {
break;
case 'checboxThemeSave':
$this->ajaxSaveChecboxTheme($_POST['anketa'],$_POST['checkbox']);
- breake;
+ break;
default:
print_r("<pre>");
@@ -182,6 +179,7 @@ class SurveyTheme {
$groupId = 0;
echo '<div class="themes-content">';
+
echo '<div id="div_theme_groups">';
$this->displayGroupSelector($groupId);
@@ -222,7 +220,7 @@ class SurveyTheme {
// preusmeritev, ko kliknemo na prilagodi pri sistemski MOBILNI temi in naredimo nov profil
if ( isset($_GET['profile_new_mobile']) ) {
- if ($_GET['name'] != '')
+ if (isset($_GET['name']) && $_GET['name'] != '')
$name = $_GET['name'];
else
$name = $_GET['profile_new_mobile'].'';
@@ -240,10 +238,10 @@ class SurveyTheme {
$row = SurveyInfo::getInstance()->getSurveyRow();
// urejanje CSSa
- if ( $_GET['t'] == 'css' ) {
+ if (isset($_GET['t']) && $_GET['t'] == 'css') {
// CSS za mobilen skin
- if($_GET['mobile'] == '1'){
+ if(isset($_GET['mobile']) && $_GET['mobile'] == '1'){
$sqlp = sisplet_query("SELECT usr_id, skin FROM srv_theme_profiles_mobile WHERE id = '".$_GET['profile']."'");
$rowp = mysqli_fetch_array($sqlp);
@@ -316,12 +314,6 @@ class SurveyTheme {
echo '<div class="themes-content">';
- $sql = sisplet_query("SELECT name FROM srv_theme_profiles".$mobile." WHERE id = '".$_GET['profile']."'");
- $row = mysqli_fetch_array($sql);
-
- echo '<h2>'.$lang['srv_themes_mod'].': <span class="red">'.$row['name'].'</span></h2>';
- //self::displayTabs();
-
if ( !isset($_GET['t']) ) {
$ste = new SurveyThemeEditor($this->sid);
@@ -350,22 +342,114 @@ class SurveyTheme {
$simple_name = $this->current_skin;
if ($row['skin_profile'] == 0) {
- $skin_name = $this->strip_name($simple_name);
- } else {
+ $skin_name = self::strip_name($simple_name);
+ }
+ else {
$sqla = sisplet_query("SELECT name FROM srv_theme_profiles WHERE id = '".$row['skin_profile']."'");
$rowa = mysqli_fetch_array($sqla);
$skin_name = $rowa['name'];
}
+ echo '<h2 class="first">'.$lang['srv_current_theme'].'</h2>';
+
+ //AKTIVNA SPLOŠNA TEMA
+ echo '<div class="theme_list active_theme">';
+
+ echo '<div class="theme">';
+ echo '<span class="name">'.$skin_name.'</span>';
+ echo '<span class="desc">('.$lang['srv_current_theme_general'].')</span>';
+ echo '</div>';
+
+ if($row['skin_profile'] == 0){
+ $preview_link = SurveyInfo::getSurveyLink().'&no_preview=1&preview=on&theme='.$simple_name.'';
+ $modify_link = '\'index.php?anketa=' . $this->sid . '&a=theme-editor&profile_new=' . $simple_name . '\'';
+ }
+ else {
+ $preview_link = SurveyInfo::getSurveyLink().'&no_preview=1&preview=on&theme_profile='.$row['skin_profile'];
+ $modify_link = '\'index.php?anketa=' . $this->sid . '&a=theme-editor&profile=' . $row['skin_profile'] . '\'';
+ }
+
+ //Gumbi
+ echo '<div class="options option1" >';
+
+ echo '<span class="faicon dots" onclick="$(\'#buttons-window1\').toggleClass(\'displayNone\');"> </span>';
+
+ // echo '<img src="\public\img\icons\dots.svg">';
+ echo '<i class="fa-solid fa-ellipsis"></i>';
+ echo ' </button>';
+
+ echo '<div class= "buttons-window displayNone buttons-window1" id="buttons-window1">';
+
+ //Predogled
+ echo '<div class="button theme_links_preview" src="'.$preview_link.'" title="'.$lang['srv_poglejanketo2'].'">';
+ echo '<span class="faicon fa-desktop"></span>';
+ echo $lang['srv_poglejanketo2'];
+ echo '</div>';
+
+ //Prilagodi
+ echo '<div class="button palette" onclick="window.location.href='.$modify_link.'" title="'.$lang['srv_te_theme_edit'].'">';
+ echo '<span class="faicon palette"></span>';
+ echo $lang['srv_te_theme_edit'];
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</div>';
+
+
+ //AKTIVNA MOBILNA TEMA
+ $simple_name = $this->current_mobile_skin;
+
+ if ($row['skin_profile_mobile'] == 0) {
+ $skin_name = self::strip_name($simple_name);
+ } else {
+ $sqla = sisplet_query("SELECT name FROM srv_theme_profiles_mobile WHERE id = '".$row['skin_profile_mobile']."'");
+ $rowa = mysqli_fetch_array($sqla);
+ $skin_name = $rowa['name'];
+ }
+
+ echo '<div class="theme_list active_theme">';
+ echo '<div class="theme">';
+ echo '<span class="name">'.$skin_name.'</span>';
+ echo '<span class="desc">('.$lang['srv_current_theme_mobile'].')</span>';
+ echo '</div>';
- echo '<span class="theme_header">'.$lang['srv_current_theme'].': ';
- if($row['skin_profile'] == 0){
- echo '<a href="index.php?anketa=' . $this->sid . '&a=theme-editor&profile_new=' . $simple_name . '"><span class="bold" style="font-size:16px;">' . $skin_name . '</span>' . '</a>';
- }else {
- echo '<a href="index.php?anketa=' . $this->sid . '&a=theme-editor&profile=' . $row['skin_profile'] . '"><span class="bold" style="font-size:16px;">' . $skin_name . '</span>' . '</a>';
+ if($row['skin_profile_mobile'] == 0){
+ $preview_link_mobile = SurveyInfo::getSurveyLink().'&no_preview=1&preview=on&theme='.$simple_name.'&mobile=1';
+ $modify_link_mobile = '\'index.php?anketa=' . $this->sid . '&a=theme-editor&mobile=1&profile_new_mobile=' . $simple_name . '\'';
+ }
+ else {
+ $preview_link_mobile = SurveyInfo::getSurveyLink().'&no_preview=1&preview=on&theme_profile='.$row['skin_profile_mobile'].'&mobile=1';
+ $modify_link_mobile = '\'index.php?anketa=' . $this->sid . '&a=theme-editor&mobile=1&profile=' . $row['skin_profile_mobile'] . '\'';
}
+
+ //Gumbi
+ echo '<div class="options">';
+
+ echo '<span class="faicon dots" onclick="$(\'#buttons-window2\').toggleClass(\'displayNone\');"> </span>';
+
+ echo '<div class="buttons-window displayNone" id="buttons-window2">';
+
+ //Predogled
+ echo '<div class="button theme_links_preview" src="'.$preview_link_mobile.'" title="'.$lang['srv_poglejanketo2'].'">';
+ echo '<span class="faicon fa-desktop"></span>';
+ echo $lang['srv_poglejanketo2'];
+ echo '</div>';
+
+ //Prilagodi
+ echo '<div class="button palette" onclick="window.location.href='.$modify_link_mobile.'" title="'.$lang['srv_te_theme_edit'].'">';
+ echo '<span class="faicon palette"></span>';
+ echo $lang['srv_te_theme_edit'];
+ echo '</div>';
+
+ echo '</div>';
- echo '</span><br /><br />';
+ echo '</div>';
+
+ echo '</div>';
+
}
function displayAdvancedSettings ($groupId) {
@@ -448,8 +532,6 @@ class SurveyTheme {
global $lang, $site_url;
global $global_user_id;
- //if (count($this->groups[$groupId]['skins'])>0 || $groupId == -1) {
-
$rowa = SurveyInfo::getSurveyRow();
if($groupId == -2)
@@ -459,12 +541,15 @@ class SurveyTheme {
elseif ($groupId != -1)
echo '<h2>'.$lang['srv_system_themes'].'</h2>';
else{
- echo '<h2>'.$lang['srv_user_themes'].' ';
- echo '<span class="user_themes_button faicon plus icon-blue pointer" style="margin-bottom:6px;" onClick="toggle_custom_themes(); return false;"> </span>';
+ echo '<h2 class="pointer" onClick="toggle_custom_themes(); return false;"><span class="user_themes_button faicon fa-angle-down"> </span>'.$lang['srv_user_themes'].' ';
echo '</h2>';
}
- echo '<div id="div_theme_group" '.($groupId==-1 ? ' class="custom" style="display:none;"' : '').'>';
+ if ( isset($this->groups[$groupId]['skins']) && count($this->groups[$groupId]['skins']) > 0 ) {
+ echo '<div id="theme_grid_holder">';
+ }
+
+ echo '<div class="div_theme_group '.($groupId==-1 ? ' custom' : '').'">';
$sqlg = sisplet_query("SELECT id FROM srv_grupa WHERE ank_id='$this->sid' ORDER BY vrstni_red ASC LIMIT 1");
$rowg = mysqli_fetch_array($sqlg);
@@ -501,24 +586,56 @@ class SurveyTheme {
$skin = $row['skin'];
$src = ''.SurveyInfo::getSurveyLink().'&grupa='.$grupa.'&no_preview=1&preview=on&theme_profile='.$row['id'].'';
$is_current_skin = ($rowa['skin_profile'] == $row['id']) ? true : false;
-
- echo '<div class="custom_theme_holder '.($is_current_skin ? ' active' : '').'">';
-
- // Title
- echo '<span class="custom_theme_title" gid="'.$groupId.'" css="'.urlencode($skin).'" alt="'.$row['name'].'" title="'.$lang['srv_changetheme'].'" onclick="te_change_profile(\''.$row['id'].'\', true); return false;" alt="'.$row['name'].'">'.substr($row['name'], 0, 30).(strlen($row['name']) > 30 ? '...' : '').'</span>';
-
- // Preview theme
- echo ' <a href="#" class="theme_links_preview" src="'.$src.'"><span class="custom_theme_preview"><span class="faicon preview"></span>'.$lang['srv_poglejanketo2'].'</span></a>';
- // Delete theme
- if ($groupId == -1)
- echo ' <a href="#" onclick="if (confirm(\''.$lang['srv_ask_delete'].'\')) te_delete_profile(\''.$row['id'].'\', false); return false;" class="theme_delete" css="'.urlencode($skin).'"><span class="custom_theme_delete"><span class="faicon delete_circle icon-orange"></span> '.$lang['srv_anketadelete_txt'].'</span></a>';
-
- // Edit theme
- echo ' <a href="index.php?anketa='.$this->sid.'&a=theme-editor&profile='.$row['id'].'"><span class="custom_theme_edit"><span class="faicon palette"></span> '.$lang['edit3'].'</span></a>';
-
+ echo '<div class="theme_list" onclick="te_change_profile(\''.$row['id'].'\', true);">';
+
+ echo '<div class="theme">';
+ echo ' <span class="name">'.$skin_name.'</span>';
+ echo ' <span class="name">'.substr($row['name'], 0, 30).(strlen($row['name']) > 30 ? '...' : '').'</span>';
+ echo ' <span class="desc">('.$lang['srv_current_theme_general'].')</span>';
echo '</div>';
+
+
+ echo '<div class="options options'.$row['id'].'" id="options'.$row['id'].'">';
+
+ echo '<span class="faicon dots" onclick="show_settings(\''.$row['id'].'\'); event.stopPropagation();"> </span>';
+
+ echo '<div class="buttons-window displayNone" id="additional_settings_'.$row['id'].'">';
+
+ //Aktiviraj
+ echo '<div class="button" onclick="te_change_profile(\''.$row['id'].'\', true); event.stopPropagation();" title="'.$lang['srv_te_theme_activate2'].'">';
+ echo '<span class="faicon fa-hand-pointer"></span>';
+ echo '<div class="aktiviraj">';
+ echo $lang['srv_te_theme_activate'] ;
+ echo '</div>';
+ echo '</div>';
+
+ //Predogled
+ echo '<div class="button theme_links_preview" src="'.$src.'" title="'.$lang['srv_poglejanketo2'].'">';
+ echo '<span class="faicon fa-desktop"></span>';
+ echo $lang['srv_poglejanketo2'];
+ echo '</div>';
+
+ //Prilagodi
+ echo '<div class="button palette" onclick="window.location.href=\'index.php?anketa='.$this->sid.'&a=theme-editor&profile='.$row['id'].'\'; event.stopPropagation();" title="'.$lang['srv_te_theme_edit'].'">';
+ echo '<span class="faicon palette"></span>';
+ echo $lang['srv_te_theme_edit'];
+ echo '</div>';
+
+ //Izbriši
+ if ($groupId == -1) {
+ echo '<div class="button theme_delete" onclick="if (confirm(\''.$lang['srv_ask_delete'].'\')) te_delete_profile(\''.$row['id'].'\', false); event.stopPropagation();" title="'.$lang['srv_te_theme_delete2'].'">';
+ echo '<span class="faicon trash empty"></span>';
+ echo $lang['srv_anketadelete_txt'];
+ echo '</div>';
+ }
+
+ echo '</div>'; // additional_settings
+ echo '</div>'; //div.options
+
+ echo '</div>'; //div.theme_list
+
$profiles++;
}
@@ -529,31 +646,72 @@ class SurveyTheme {
$skin = $row['skin'];
$src = ''.SurveyInfo::getSurveyLink().'&grupa='.$grupa.'&no_preview=1&preview=on&theme_profile='.$row['id'].'&mobile=1';
$is_current_skin = ($rowa['skin_profile_mobile'] == $row['id']) ? true : false;
-
- echo '<div class="custom_theme_holder '.($is_current_skin ? ' active' : '').'">';
-
- // Title
- echo '<span class="custom_theme_title" gid="'.$groupId.'" css="'.urlencode($skin).'" alt="'.$row['name'].'" title="'.$lang['srv_changetheme'].'" onclick="te_change_profile(\''.$row['id'].'\', true, true); return false;" alt="'.$row['name'].'">'.substr($row['name'], 0, 30).(strlen($row['name']) > 30 ? '...' : '').' <span class="italic">('.$lang['srv_mobile_theme'].')</span></span>';
-
- // Preview theme
- echo ' <a href="#" class="theme_links_preview" src="'.$src.'"><span class="custom_theme_preview"><span class="faicon preview"></span>'.$lang['srv_poglejanketo2'].'</span></a>';
- // Delete theme
- if ($groupId == -1)
- echo ' <a href="#" onclick="if (confirm(\''.$lang['srv_ask_delete'].'\')) te_delete_profile(\''.$row['id'].'\', true); return false;" class="theme_delete" css="'.urlencode($skin).'"><span class="custom_theme_delete"><span class="faicon delete_circle icon-orange"></span> '.$lang['srv_anketadelete_txt'].'</span></a>';
-
- // Edit theme
- echo ' <a href="index.php?anketa='.$this->sid.'&a=theme-editor&profile='.$row['id'].'&mobile=1"><span class="custom_theme_edit"><span class="faicon palette"></span> '.$lang['edit3'].'</span></a>';
-
+ echo '<div class="theme_list" onclick="te_change_profile(\''.$row['id'].'\', true, true); return false;">';
+
+ echo '<div class="theme">';
+ echo '<span class="name">'.$skin_name.'</span>';
+ echo '<span class="name">'.substr($row['name'], 0, 30).(strlen($row['name']) > 30 ? '...' : '').'</span>';
+ echo '<span class="desc">('.$lang['srv_mobile_theme'].')</span>';
echo '</div>';
+
+ //Gumbi
+ echo '<div class="options options_mobile'.$row['id'].'" id="options'.$row['id'].'">';
+
+ echo '<span class="faicon dots" onclick="show_settings_mobile(\''.$row['id'].'\'); event.stopPropagation();"></span>';
+
+ echo '<div class="buttons-window" id="additional_settings_mobile_'.$row['id'].'">';
+ //Aktiviraj
+ echo '<div class="button" onclick="te_change_profile(\''.$row['id'].'\', true, true); event.stopPropagation();" title="'.$lang['srv_te_theme_activate2'].'">';
+ echo '<span class="faicon fa-hand-pointer"></span>';
+ echo '<div class="aktiviraj">';
+ echo $lang['srv_te_theme_activate'];
+ echo '</div>';
+ echo '</div>';
+
+ //Predogled
+ echo '<div class="button theme_links_preview" src="'.$src.'" title="'.$lang['srv_poglejanketo2'].'">';
+ echo '<span class="faicon fa-desktop"></span>';
+ echo $lang['srv_poglejanketo2'];
+ echo '</div>';
+
+ //Prilagodi
+ echo '<div class="button palette" onclick="window.location.href=\'index.php?anketa='.$this->sid.'&a=theme-editor&profile='.$row['id'].'&mobile=1\'; event.stopPropagation();" title="'.$lang['srv_te_theme_edit'].'">';
+ echo '<span class="faicon palette"></span>';
+ echo $lang['srv_te_theme_edit'];
+ echo '</div>';
+
+ //Izbriši
+ if ($groupId == -1) {
+ echo '<div class="button theme_delete" onclick="if (confirm(\''.$lang['srv_ask_delete'].'\')) te_delete_profile(\''.$row['id'].'\', true); event.stopPropagation();" title="'.$lang['srv_te_theme_delete2'].'">';
+ echo '<span class="faicon trash empty"></span>';
+ echo $lang['srv_anketadelete_txt'];
+ echo '</div>';
+ }
+
+ echo '</div>'; //additional settings
+ echo '</div>'; //div.options
+
+ echo '</div>'; //div.theme_list
+
$profiles++;
}
-
- if(mysqli_num_rows($sql) > 0)
- echo '<br />';
}
+
+ // Klik izven - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $(".buttons-window, .options");
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".buttons-window").addClass("displayNone");
+ }
+ });
+ </script>';
+
+
+ // Splošne teme - GRID
if ( isset($this->groups[$groupId]['skins']) && count($this->groups[$groupId]['skins']) > 0 ) {
foreach ($this->groups[$groupId]['skins'] AS $skinid => $skin) {
@@ -565,39 +723,67 @@ class SurveyTheme {
if(substr($skin, 0, 6) == 'Mobile')
$src .= '&mobile=1';
- echo '<div class="theme_label '.($is_current_skin || $is_current_mobile_skin ? 'span_theme_current' : '').'">';
+ // Preview slika
+ $css = urlencode($skin);
+ $gid = $groupId;
+
+
+ echo '<div class="theme_label '.($is_current_skin || $is_current_mobile_skin ? 'span_theme_current' : '').'" onclick="changeTheme(\''.$gid.'\', \''.$css.'\');" title="'.$lang['srv_te_theme_activate2'].'">';
echo '<div class="theme_label_content">';
- // Preview slika
- if ($groupId == -1) echo '<a href="#" class="theme_delete theme" gid="'.$groupId.'" css="'.urlencode($skin).'">'.$lang['srv_anketadelete_txt'].'</a>';
- //echo '<span class="theme_links_rename as_link" theme="'.urlencode($skin).'">Preimenuj</span>';
- if ($groupId == -1)
- echo '<img src="'.$site_url.'public/img/skins_previews/'.($groupId==-1?'usertheme':urlencode($simple_name)).'.png" onclick="te_change_profile_oldskin(\''.$simple_name.'\', true); return false;" gid="'.$groupId.'" css="'.urlencode($skin).'" alt="'.$simple_name.'" title="'.$lang['srv_changetheme'].'">';
+ if ($groupId == -1)
+ echo '<a href="#" class="theme_delete theme" gid="'.$groupId.'" css="'.urlencode($skin).'">'.$lang['srv_anketadelete_txt'].'</a>';
+
+ if ($groupId == -1) {
+ echo '<img src="'.$site_url.'public/img/skins_previews/'.($groupId==-1?'usertheme':urlencode($simple_name)).'.png" gid="'.$groupId.'" css="'.urlencode($skin).'" alt="'.$simple_name.'" title="'.$lang['srv_changetheme'].'">';
+ }
else
echo '<img src="'.$site_url.'public/img/skins_previews/'.urlencode($simple_name).'.png" class="theme" gid="'.$groupId.'" css="'.urlencode($skin).'" alt="'.$simple_name.'" title="'.$lang['srv_changetheme'].'">';
-
+
+ echo '</div>';
+
+ //Gumbi
+ echo '<div class="theme_label_options">';
+
// Ime teme
+ echo "<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>";
echo '<span class="theme_name">';
- echo $this->strip_name($simple_name.($simple_name=='1kaBlue' || $simple_name=='MobileBlue' ? ' ('.$lang['default'].')' : ''));
+ echo self::strip_name($simple_name.($simple_name=='1kaBlue' || $simple_name=='MobileBlue' ? '<div class="privzeto"> ('.$lang['default'].') </div>' : ''));
+
// Vprasajcki
- if($simple_name == 'Embed' || $simple_name == 'Embed2' || $simple_name == 'Fdv' || $simple_name == 'Uni' || $simple_name == 'Slideshow')
- echo ' '.Help :: display('srv_skins_'.$simple_name);
+ if( in_array($simple_name, array('Fdv', 'Cdi', 'Uni', 'MobileFdv', 'MobileCdi', 'MobileUni')) ){
+ echo ' '.Help::display('srv_skins_Fdv');
+ }
+ elseif($simple_name == 'Embed' || $simple_name == 'Embed2' || $simple_name == 'Slideshow'){
+ echo ' '.Help::display('srv_skins_'.$simple_name);
+ }
+
if($groupId == -1)
echo ' (CSS)';
echo '</span>';
+
+ echo '<div class="buttons_flex">';
+
+ // Prilagodi - samo ce je tema aktivna
+ if($is_current_skin || $is_current_mobile_skin){
+
+ if ($groupId == -3)
+ $link = 'index.php?anketa='.$this->sid.'&a=theme-editor&profile_new_mobile='.$rowa['mobile_skin'];
+ else
+ $link = 'index.php?anketa='.$this->sid.'&a=theme-editor&profile_new='.$rowa['skin'];
+
+ echo ' <span class="faicon palette" onclick="window.location.href=\''.$link.'\'; event.stopPropagation();" title="'.$lang['srv_te_theme_edit'].'"></span>';
+ }
+
+ // Predogled
+ echo ' <span class="faicon fa-desktop" onclick="window.location.href=\''.$src.'\'; event.stopPropagation();" title="'.$lang['srv_poglejanketo2'].'"></span>';
+
+ echo '</div>'; // div.buttons_flex
echo '</div>';
-
- if($is_current_skin)
- echo ' <a href="index.php?anketa='.$this->sid.'&a=theme-editor&profile_new='.$rowa['skin'].'"><span class="faicon palette"></span> '.$lang['srv_te_theme_edit'].'</a>';
-
- if($is_current_mobile_skin)
- echo ' <a href="index.php?anketa='.$this->sid.'&a=theme-editor&profile_new_mobile='.$rowa['mobile_skin'].'"><span class="faicon palette"></span> '.$lang['srv_te_theme_edit'].'</a>';
-
- echo '<a href="#" class="theme_links_preview" src="'.$src.'"><span class="faicon preview"></span> '.$lang['srv_poglejanketo2'].'</a>';
- echo '</div>';
+ echo '</div>'; //div.theme_label
}
}
elseif ($profiles == 0) {
@@ -606,6 +792,10 @@ class SurveyTheme {
}
echo '</div>';
+
+ if ( isset($this->groups[$groupId]['skins']) && count($this->groups[$groupId]['skins']) > 0 ) { // div#theme_grid_holder
+ echo '</div>';
+ }
}
function changeTheme($css, $gid) {
@@ -666,9 +856,10 @@ class SurveyTheme {
function changeProgressbar() {
$progressbar = $_POST['progressbar'];
- $strUpdate = "UPDATE srv_anketa SET progressbar = '$progressbar' WHERE id=".$this->sid;
- $updated = sisplet_query($strUpdate);
+
+ $updated = sisplet_query("UPDATE srv_anketa SET progressbar = '$progressbar' WHERE id=".$this->sid);
sisplet_query("COMMIT");
+
SurveyInfo :: getInstance()->resetSurveyData();
}
@@ -799,16 +990,24 @@ class SurveyTheme {
}
// iz imena skina odstrani uid stevilko userja in _
- function strip_name ($simple_name) {
-
+ static function strip_name ($simple_name) {
+ global $lang;
+
// Popravimo se default skine - vstavimo presledek da lepse izgleda
$skins = array(
- '1kaBlue (Privzeto)', '1kaRed', '1kaOrange', '1kaGreen', '1kaPurple', '1kaBlack', '1kaOffice', '1kaNature',
- 'MobileBlue (Privzeto)', 'MobileRed', 'MobileOrange', 'MobileGreen', 'MobilePurple', 'MobileBlack',
+ '1kaBlue ('.$lang['default'].')', '1kaBlue', '1kaRed', '1kaOrange', '1kaGreen', '1kaPurple', '1kaBlack', '1kaOffice', '1kaNature',
+ 'MobileBlue ('.$lang['default'].')', 'MobileBlue', 'MobileRed', 'MobileOrange', 'MobileGreen', 'MobilePurple', 'MobileBlack',
'MobileUni', 'MobileFdv', 'MobileCdi'
);
if(in_array($simple_name, $skins)){
- $simple_name = preg_replace('/(?<!\ )[A-Z]/', ' $0', $simple_name);
+
+ $name_array = explode(' ', $simple_name);
+ $name_array[0] = preg_replace('/(?<!\ )[A-Z]/', ' $0', $name_array[0]);
+
+ $simple_name = $name_array[0];
+
+ if(isset($name_array[1]))
+ $simple_name .= ' '.$name_array[1];
}
if ( is_numeric( substr($simple_name, 0, strpos($simple_name, '_')) ) )
@@ -826,17 +1025,30 @@ class SurveyTheme {
$default = 'Default';
$skin = ($row['skin'] == '') ? $default : $row['skin'];
- echo '<br /><span class="bold">'.$lang['srv_add_theme_upload'].'</span>';
- echo '<form name="upload" enctype="multipart/form-data" action="upload.php?anketa=' . $this->sid . '&profile='.$_GET['profile'].'" method="post">';
- echo '<p><label for="skin">' . $lang['srv_uploadtheme'] . ':</label> ';
+ $profile = isset($_GET['profile']) ? $_GET['profile'] : '';
+ $mobile = (isset($_GET['mobile']) && $_GET['mobile'] == '1') ? true : false;
+
+ echo '<fieldset id="theme-upload"><legend>'.$lang['srv_themes_upload_css'].'</legend>';
+
+ $sql = sisplet_query("SELECT name FROM srv_theme_profiles".$mobile." WHERE id = '".$profile."'");
+ $row = mysqli_fetch_array($sql);
+
+ echo '<h2>'.$lang['srv_themes_mod2'].': <span class="name">'.$row['name'].'</span></h2>';
+
+ echo '<p class="bottom16">'.$lang['srv_add_theme_upload'].':</p>';
+ echo '<form name="upload" enctype="multipart/form-data" action="upload.php?anketa=' . $this->sid . '&profile='.$profile.'" method="post">';
echo '<input type="file" name="fajl" onchange="submit();">';
- echo ' (' . $lang['srv_skintmpl1'] . ' <a href="' . $site_url . 'main/survey/skins/'.$skin.'.css" target="_blank">' . $lang['srv_skintmpl'] . '</a>)';
- echo '</p></form>';
+ echo '</form>';
+ echo '<p class="top16">'.$lang['srv_skintmpl1'] . ' <a href="' . $site_url . 'main/survey/skins/'.$skin.'.css" target="_blank">' . $lang['srv_skintmpl'] . '</a>.</p>';
- echo '<p style="font-size:90%; color: gray">'.$lang['srv_skin_disclamer'].'</p>';
+ echo '<p class="top16">'.$lang['srv_skin_disclamer'].'</p>';
+
+ echo '<p class="top16">'.$lang['srv_skin_warning'].'</p>';
echo '<a href="#" onclick="$(\'#vrednost_edit\').hide().html(\'\'); return false;" style="position:absolute; right:10px; bottom:10px">'.$lang['srv_zapri'].'</a>';
+
+ echo '</fieldset>';
}
@@ -849,16 +1061,20 @@ class SurveyTheme {
$row = SurveyInfo::getInstance()->getSurveyRow();
- $skin = $_GET['skin'];
+ $skin = isset($_GET['skin']) ? $_GET['skin'] : '';
+ $profile = isset($_GET['profile']) ? $_GET['profile'] : '';
+ $mobile = (isset($_GET['mobile']) && $_GET['mobile'] == '1') ? true : false;
+
+ echo '<div id="theme-edit-wrap">';
echo '<div id="theme-editor">';
+
+ $sql = sisplet_query("SELECT name FROM srv_theme_profiles".$mobile." WHERE id = '".$profile."'");
+ $row = mysqli_fetch_array($sql);
- echo '<div id="theme-editor-warning">'.$lang['srv_themes_edit_warning'].'</div>';
-
- echo '<form name="editcss" action="ajax.php?anketa='.$this->sid.'&a=save_editcss" method="post" onsubmit="return false;">';
-
- $profile = $_GET['profile'];
- $mobile = (isset($_GET['mobile']) && $_GET['mobile'] == '1') ? true : false;
+ echo '<h2>'.$lang['srv_themes_mod2'].': <span class="name">'.$row['name'].'</span></h2>';
+
+ echo '<form name="editcss" action="ajax.php?anketa='.$this->sid.'&a=save_editcss" method="post" onsubmit="return false;">';
$sqlp = sisplet_query("SELECT usr_id FROM srv_theme_profiles".($mobile ? '_mobile' : '')." WHERE id = '$profile'");
$rowp = mysqli_fetch_array($sqlp);
@@ -869,54 +1085,17 @@ class SurveyTheme {
echo '<input type="hidden" name="skin_name" value="'.$skin_name.'">';
echo '<input type="hidden" name="profile" value="'.$_GET['profile'].'">';
echo '<input type="hidden" name="mobile" value="'.($mobile ? '1' : '0').'">';
-
- echo '<br />';
-
- echo '<span class="bold">'.$lang['srv_themes_edit'].'</span>';
- echo '<p><textarea name="css_content" style="width:100%; height: 400px">';
-
- readfile('../../main/survey/skins/'.$skin.'.css');
-
- echo '</textarea></p>';
-
- echo '<p>';
-
- echo '<p><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings floatLeft spaceRight" href="#" onclick="';
- ?>$.post('ajax.php?anketa=<?=$this->sid?>&a=save_editcss', $('form[name=editcss]').serialize(), function (data) {
- //if ( $('input[name=skin_name]').val() != $('input[name=old_name]').val() ) {
- // window.location.href = 'index.php?anketa=<?=$this->sid?>&a=edit_css&skin='+data;
- //} else {
- var iframe = document.getElementById('theme-preview-iframe');
- iframe.src = iframe.src;
- if ( $('input[name=current_skin]').is(':checked') ) $('input[name=current_skin]').attr('disabled', true);
- //}
- }); return false;<?php
- echo '"><span>'. $lang['edit1337'] . '</span></a>';
-
- //echo '<a class="ovalbutton ovalbutton_gray spaceRight floatLeft" href="index.php?anketa='.$this->sid.'&a=tema"><span>'.$lang['srv_theme_save_as_new'].'</span></a>';
-
- echo '<a class="ovalbutton ovalbutton_gray floatLeft" href="index.php?anketa='.$this->sid.'&a=tema"><span>'.$lang['back'].'</span></a></p>';
- echo '<div class="clr"></div>';
- echo '</div></p>';
- echo '</form>';
-
- echo '<br /><p><a href="#" onclick="javascript:$(\'#show_more\').slideToggle(); return false;">'.$lang['srv_upload_pic'].'</a></p>';
+
+ //Upload slike / Logo
+ /*echo '<p class="top16"><a href="#" onclick="javascript:$(\'#show_more\').slideToggle(); return false;">'.$lang['srv_upload_pic'].'</a></p>';
echo '<fieldset id="show_more" style="'.($_GET['pic']=='open'?'':'display:none;').' margin-bottom:40px">';
-
- echo '<br /><span class="bold">'.$lang['srv_upload_pic'].':</span>';
- /*echo '<form name="upload" enctype="multipart/form-data" action="upload.php?anketa=' . $this->sid . '&logo=1" method="post" />';
- echo '<p><label for="skin">' . $lang['srv_upload_logo'] . ':</label> ';
- echo '<input type="file" name="fajl" onchange="submit();" onmouseout="survey_upload();" />';
- echo '</p></form>'; */
-
+ echo '<p class="bottom16">'.$lang['srv_upload_pic'].':</p>';
echo '<form name="upload" enctype="multipart/form-data" action="upload.php?anketa=' . $this->sid . '&skin='.$skin.'&profile='.$_GET['profile'].'" method="post" />';
- echo '<p><label for="skin">' . $lang['srv_upload_pic2'] . ':</label> ';
echo '<input type="file" name="fajl" onchange="submit();" onmouseout="survey_upload();" />';
echo '</p></form>';
- echo '<p style="font-size:90%; color: gray">'.$lang['srv_upload_pic_disclaimer'].'</p><br />';
-
+
// prikazemo uploadane slike
$dir = opendir($site_path . 'main/survey/uploads/');
$skinsArray = array();
@@ -937,9 +1116,36 @@ class SurveyTheme {
}
}
}
- echo '</fieldset>';
- echo '<div id="success_save"></div>';
+ echo '</fieldset>';*/
+
+ echo '<p class="top16 bottom16">'.$lang['srv_skin_warning_edit'].'</p>';
+
+ echo '<p><textarea id="css_content" name="css_content">';
+
+ readfile('../../main/survey/skins/'.$skin.'.css');
+
+ echo '</textarea></p>';
+
+ echo '<p>';
+
+ echo '<div class="button_holder css_edit">';
+ echo '<button class="medium white-blue" onClick="window.location.href=\'index.php?anketa='.$this->sid.'&a=tema\';return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="';
+ ?>$.post('ajax.php?anketa=<?=$this->sid?>&a=save_editcss', $('form[name=editcss]').serialize(), function (data) {
+ //if ( $('input[name=skin_name]').val() != $('input[name=old_name]').val() ) {
+ // window.location.href = 'index.php?anketa=<?=$this->sid?>&a=edit_css&skin='+data;
+ //} else {
+ var iframe = document.getElementById('theme-preview-iframe');
+ iframe.src = iframe.src;
+ if ( $('input[name=current_skin]').is(':checked') ) $('input[name=current_skin]').attr('disabled', true);
+ //}
+ }); return false;<?php
+ echo '"><span>'. $lang['edit1337'].'</button>';
+ echo '</div>';
+
+
+ echo '</form>';
echo '</div>';
@@ -947,16 +1153,11 @@ class SurveyTheme {
$row = mysqli_fetch_array($sql);
$grupa = $row['id'];
- //echo '<div id="theme-preview"><iframe id="theme-preview-iframe" src="'.SurveyInfo::getSurveyLink().'&grupa='.$grupa.'&no_preview=1&preview=on&theme='.$skin.'"></iframe></div>';
echo '<div id="theme-preview"><iframe id="theme-preview-iframe" src="'.SurveyInfo::getSurveyLink().'&grupa='.$grupa.'&no_preview=1&preview=on&theme_profile='.$_GET['profile'].'&theme-preview=1'.($mobile ? '&mobile=1' : '').'"></iframe><div class="theme-overflow"></div></div>';
-
- //echo '</div>';
-
- //echo '<div class="clr"></div>';
-
- //echo '</div>';
SurveyThemeEditor::new_theme_alert($skin_name, true);
+ echo '</div>';
+
}
function ajax_add_theme () {