'Palatino Linotype, Book Antiqua, Palatino, serif', 2 => 'Times New Roman, Times, serif', 3 => 'Arial, Helvetica, sans-serif', 4 => 'Arial Black, Gadget, sans-serif', 5 => 'Comic Sans MS, cursive, sans-serif', 6 => 'Impact, Charcoal, sans-serif', 7 => 'Lucida Sans Unicode, Lucida Grande, sans-serif', 8 => 'Tahoma, Geneva, sans-serif', 9 => 'Trebuchet MS, Helvetica, sans-serif', 10 => 'Verdana, Geneva, sans-serif', 11 => 'Courier New, Courier, monospace', 12 => 'Lucida Console, Monaco, monospace', 13 => 'Georgia, serif', ); function __construct ($anketa, $ajax=false) { global $site_path, $global_user_id; $this->anketa = $anketa; SurveyInfo::getInstance()->SurveyInit($anketa); $row = SurveyInfo::getSurveyRow(); $this->profile = (int)$_GET['profile']; $this->mobile = (isset($_GET['mobile']) && $_GET['mobile'] == '1') ? '_mobile' : ''; if ($ajax) return; if ( ! $this->profile > 0 ) die(); } function display () { global $lang; global $global_user_id; SurveyInfo::getInstance()->SurveyInit($this->anketa); $row = SurveyInfo::getInstance()->getSurveyRow(); $sqla = sisplet_query("SELECT id, name, logo FROM srv_theme_profiles".$this->mobile." WHERE id='$this->profile'"); $rowa = mysqli_fetch_array($sqla); $skin_name = SurveyTheme::strip_name($rowa['name']); self::new_theme_alert($skin_name); echo '
'; echo '
'; echo '

'.$lang['srv_themes_mod2'].': '.$skin_name.'

'; echo ''; $mobile = (isset($_GET['mobile']) && $_GET['mobile'] == '1') ? 1 : 0; echo ''; echo '
'; echo '

'.$lang['srv_skinname'].'

'; echo ''; // Mobilni skin nima logotipa if($mobile != 1){ echo '

'.$lang['srv_upload_logo'].'

'; echo '
'; echo ''; if ($rowa['logo'] != '') { echo '

'.$rowa['logo']; echo ' '; echo '

'; } echo '

'; } // Mobilni skin nima progressbara if($mobile != 1){ $sqlg = sisplet_query("SELECT id FROM srv_grupa WHERE ank_id = '$this->anketa'"); if (mysqli_num_rows($sqlg) > 1) { $sqlAnketa = sisplet_query("SELECT progressbar FROM srv_anketa WHERE id='$this->anketa'"); $rowAnketa = mysqli_fetch_array($sqlAnketa); echo '

'.$lang['srv_te_progressbar'].'

'; echo '
'; echo '' . $lang['srv_te_progressbar_show'] . ''; echo '
'; echo ''; echo ' '; echo '
'; echo '
'; echo ''; echo ' '; echo '
'; echo '
'; } } echo '

'.$lang['srv_te_survey_h_text'].'

'; echo '
'; $this->displayOption(1, 1); $this->displayOption(1, 4); $this->displayOption(1, 2); $this->displayOption(1, 3); echo '
'; echo '

'.$lang['srv_te_background_color'].'

'; echo '
'; $this->displayOption(6, 3); echo '
'; echo '

'.$lang['srv_te_question_text'].'

'; echo '
'; $this->displayOption(2, 1); $this->displayOption(2, 4); $this->displayOption(2, 2); echo '
'; echo '
'; $this->displayOption(5, 3); $this->displayOption(5, 5); echo '
'; echo '

'.$lang['srv_te_answers_text'].'

'; echo '
'; $this->displayOption(3, 1); $this->displayOption(3, 4); echo '
'; echo '
';$this->displayOption(3, 2); $this->displayOption(4, 3); echo '
'; // Custom checkbox/radio (stars, smilies, thumbs) // Radio/checkboxi za pc if($mobile != 1){ echo '

'.$lang['srv_te_custom_checkbox_radio'].'

'; echo '
'; $this->displayOption(7, 7); $this->displayOption(7, 15); echo '
'; //$this->displayOption(10, 17); } // Radio/checkboxi za mobitel else{ echo '

'.$lang['srv_te_custom_mobile_checkbox_radio'].'

'; echo '
'; $this->displayOption(7, 8); $this->displayOption(7, 16); echo '
'; // Za mobitel ne rabimo accessibility ikon //$this->displayOption(10, 17); } // Tooltipster/slovar/glossary echo '

'.$lang['srv_te_custom_glossary_popup'].Help::display('srv_oblika_slovarSlovar').'

'; echo '
'; $this->displayOption(8, 9); $this->displayOption(8, 11); $this->displayOption(8, 10); $this->displayOption(8, 12); echo '
'; echo '

'.$lang['srv_te_custom_glossary_keywords'].Help::display('srv_oblika_slovarIKljucna').'

'; echo '
'; $this->displayOption(9, 9); $this->displayOption(9, 13); $this->displayOption(9, 14); echo '
'; echo '
'; echo ''; echo ''; echo '
'; echo '
'; $this->preview(); echo '
'; ?> '; echo '

'; printf($lang['srv_new_theme_alert'.($css?'_css':'')], $name); echo '

'; echo ''; ?> mobile." WHERE profile_id='$this->profile' AND id='$id' AND type='$type'"); $row = mysqli_fetch_array($sql); $row['value'] = isset($row['value']) ? $row['value'] : ''; // pisava if ($type == 1) { echo '
'; echo ''.$lang['srv_te_font_family'].': '; if ($row['value'] != '') echo ''; echo '
'; // barva pisave, barva ozadja } elseif (($type == 3 && $id != 1) || in_array($type, [2, 9, 10, 13, 15, 16])) { if ($row['value'] == '') $value = '#000000'; else $value = $row['value']; echo '
'; if ($type == 2 || $type == 9) echo ''.$lang['srv_te_font_color'].': '; elseif($type == 3) echo ''.$lang['srv_te_background_color'].': '; elseif($type == 10) echo ''.$lang['srv_te_custom_border_color'].': '; elseif($type == 13) echo ''.$lang['srv_te_custom_background_keywords'].': '; elseif($type == 15) echo ''.$lang['srv_te_custom_icon_pc_color'].': '; elseif($type == 16) echo ''.$lang['srv_te_custom_icon_mobile_color'].': '; if ($row['value'] == '') echo '
'.$lang['srv_te_default'].'
'; echo '
'; echo ' '; echo '
'; if ($row['value'] != '') echo ''; echo '
'; // velikost pisave } elseif ($type == 4) { echo '
'; echo ''.$lang['srv_te_font_size'].': '; if ($row['value'] != '') echo ''; echo '
'; // border vprasanja } elseif ($type == 5) { if ($row['value'] == '') $value = '1'; else $value = $row['value']; echo '
'; echo $lang['srv_te_question_border'].': '; echo '
'; // izbira custom checkbox/radio gumbov } elseif($type == 7 ) { echo '
'; echo $lang['srv_te_custom_icon_pc'] . ': '; echo '
'; } elseif($type == 8) { echo '
'; echo $lang['srv_te_custom_icon_mobile'] . ': '; echo '
'; // Izpišemo border opcije } elseif($type == 11) { echo '
'; echo $lang['srv_te_custom_border_size'].': '; echo ' '; echo '
'; } elseif($type == 12) { echo '
'; echo $lang['srv_te_custom_border_radius'].': '; echo ' '; echo '
'; // Stil pisave bold, italic, underline } elseif($type == 14) { echo '
'; echo $lang['srv_te_custom_font_style_keywords'].': '; echo ' '; echo '
'; // Accessibility checkbox (radio/checkboxi niso obarvani) } elseif($type == 17) { echo '
'; echo ''; echo '
'; } } function preview () { $sql = sisplet_query("SELECT id FROM srv_grupa WHERE ank_id='$this->anketa' ORDER BY vrstni_red ASC LIMIT 1"); $row = mysqli_fetch_array($sql); $grupa = $row['id']; $mobile = (isset($_GET['mobile']) && $_GET['mobile'] == '1') ? '&mobile=1' : ''; echo '
'; } static function getFont ($font) { return self::$fonts[$font]; } function ajax() { if ($_GET['a'] == 'auto_save') { $this->ajax_auto_save(); } elseif ($_GET['a'] == 'change_profile') { $this->ajax_change_profile(); } elseif ($_GET['a'] == 'change_profile_oldskin') { $this->ajax_change_profile_oldskin(); } elseif ($_GET['a'] == 'delete_profile') { $this->ajax_delete_profile(); } elseif ($_GET['a'] == 'add_theme') { $this->ajax_add_theme(); } elseif ($_GET['a'] == 'change_name') { $this->ajax_change_name(); } } function ajax_auto_save() { $id = $_POST['id']; $type = $_POST['type']; $value = $_POST['value']; if ($value == '') { $s = sisplet_query("DELETE FROM srv_theme_editor".$this->mobile." WHERE profile_id='$this->profile' AND id='$id' AND type='$type'"); if (!$s) echo mysqli_error($GLOBALS['connect_db']); } else { $s = sisplet_query("REPLACE INTO srv_theme_editor".$this->mobile." (profile_id, id, type, value) VALUES ('$this->profile', '$id', '$type', '$value')"); if (!$s) echo mysqli_error($GLOBALS['connect_db']); } } function ajax_change_profile () { $sql = sisplet_query("SELECT skin FROM srv_theme_profiles".$this->mobile." WHERE id = '$this->profile'"); $row = mysqli_fetch_array($sql); if($this->mobile == '_mobile') $s = sisplet_query("UPDATE srv_anketa SET mobile_skin='".$row['skin']."', skin_profile_mobile='".$this->profile."' WHERE id = '".$this->anketa."'"); else $s = sisplet_query("UPDATE srv_anketa SET skin='".$row['skin']."', skin_profile='".$this->profile."' WHERE id = '".$this->anketa."'"); if (!$s) echo mysqli_error($GLOBALS['connect_db']); } function ajax_change_profile_oldskin () { global $global_user_id; $skin = $_POST['skin'].''; $name = str_replace($global_user_id.'_', '', $skin); $sql = sisplet_query("INSERT INTO srv_theme_profiles".$this->mobile." (id, usr_id, skin, name) VALUES ('', '$global_user_id', '$skin', '$name')"); $profile = mysqli_insert_id($GLOBALS['connect_db']); $s = sisplet_query("UPDATE srv_anketa SET skin='".$skin."', skin_profile='".$profile."' WHERE id = '".$this->anketa."'"); if (!$s) echo mysqli_error($GLOBALS['connect_db']); echo 'index.php?anketa='.$this->anketa.'&a=theme-editor&profile='.$profile.'&newalert=1'; } function ajax_delete_profile () { global $site_path; global $global_user_id; $row = SurveyInfo::getSurveyRow(); if($this->mobile == '_mobile'){ if ($row['skin_profile_mobile'] == $this->profile) { $s = sisplet_query("UPDATE srv_anketa SET skin_profile_mobile='0', mobile_skin='MobileBlue' WHERE id = '".$this->anketa."'"); if (!$s) echo mysqli_error($GLOBALS['connect_db']); } $sql = sisplet_query("SELECT skin FROM srv_theme_profiles_mobile WHERE id = '$this->profile'"); $row = mysqli_fetch_array($sql); // ce ima svojo temo, jo zbrisemo if ( strpos($row['skin'], $global_user_id.'_') !== false ) { $dir = $site_path . 'main/survey/skins/'; unlink($dir.$row['skin'].'.css'); } $s = sisplet_query("DELETE FROM srv_theme_profiles_mobile WHERE id = '$this->profile'"); if (!$s) echo mysqli_error($GLOBALS['connect_db']); } else{ if ($row['skin_profile'] == $this->profile) { $s = sisplet_query("UPDATE srv_anketa SET skin_profile='0', skin='1kaBlue' WHERE id = '".$this->anketa."'"); if (!$s) echo mysqli_error($GLOBALS['connect_db']); } $sql = sisplet_query("SELECT skin FROM srv_theme_profiles WHERE id = '$this->profile'"); $row = mysqli_fetch_array($sql); // ce ima svojo temo, jo zbrisemo if ( strpos($row['skin'], $global_user_id.'_') !== false ) { $dir = $site_path . 'main/survey/skins/'; unlink($dir.$row['skin'].'.css'); } $s = sisplet_query("DELETE FROM srv_theme_profiles WHERE id = '$this->profile'"); if (!$s) echo mysqli_error($GLOBALS['connect_db']); } } function ajax_add_theme() { global $lang; global $site_url; ob_clean(); $row = SurveyInfo::getSurveyRow(); $st = new SurveyTheme($this->anketa, true); $groups = $st->getGroups(); $default = 'Default'; echo '

'.$lang['srv_add_theme'].'

'; echo '

'.$lang['srv_select_base_theme'].': '.$lang['srv_select_base_theme_2'].'

'; echo '

'.$lang['srv_skinname'].':

'; echo '

'; echo ''.$lang['srv_zapri'].''; } function ajax_change_name() { $s = sisplet_query("UPDATE srv_theme_profiles".$this->mobile." SET name='".$_POST['name']."' WHERE id = '".$_GET['profile']."'"); } } ?>