diff options
Diffstat (limited to 'admin/survey/classes/class.SurveyThemeEditor.php')
-rw-r--r-- | admin/survey/classes/class.SurveyThemeEditor.php | 227 |
1 files changed, 133 insertions, 94 deletions
diff --git a/admin/survey/classes/class.SurveyThemeEditor.php b/admin/survey/classes/class.SurveyThemeEditor.php index ef85967..527f285 100644 --- a/admin/survey/classes/class.SurveyThemeEditor.php +++ b/admin/survey/classes/class.SurveyThemeEditor.php @@ -48,12 +48,20 @@ class SurveyThemeEditor { 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'");
+ $sqla = sisplet_query("SELECT id, name, logo FROM srv_theme_profiles".$this->mobile." WHERE id='$this->profile'");
$rowa = mysqli_fetch_array($sqla);
- self::new_theme_alert($rowa['name']);
+ $skin_name = SurveyTheme::strip_name($rowa['name']);
+
+
+ self::new_theme_alert($skin_name);
+
+ echo '<div id="theme-edit-wrap">';
echo '<div id="theme-editor">';
+
+ echo '<h2>'.$lang['srv_themes_mod2'].': <span class="name">'.$skin_name.'</span></h2>';
+
echo '<input type="hidden" name="profile" id="profile" value="'.$this->profile.'">';
$mobile = (isset($_GET['mobile']) && $_GET['mobile'] == '1') ? 1 : 0;
@@ -61,131 +69,129 @@ class SurveyThemeEditor { echo '<div id="picker"></div>';
- echo '<fieldset><legend>'.$lang['srv_skinname'].'</legend>';
- echo '<p>'.$lang['srv_skinname'].': <input type="text" name="skin-name" value="'.$rowa['name'].'" onblur="te_change_name(this);"></p>';
- echo '</fieldset>';
-
- echo '<br />';
+ echo '<h3>'.$lang['srv_skinname'].'</h3>';
+ echo '<input type="text" class="text medium" id="skin-name" name="skin-name" value="'.$skin_name.'" onblur="te_change_name(this);">';
// Mobilni skin nima logotipa
if($mobile != 1){
- echo '<fieldset><legend>'.$lang['srv_upload_logo'].'</legend>';
+ echo '<h3>'.$lang['srv_upload_logo'].'</h3>';
echo '<form name="upload" enctype="multipart/form-data" action="upload.php?anketa=' . $this->anketa . '&logo=1&te=1&profile='.$this->profile.'" method="post" />';
- echo '<p>' . $lang['srv_upload_logo'] . ': ';
echo '<input type="file" name="fajl" onchange="submit();" onmouseout="survey_upload();" />';
if ($rowa['logo'] != '') {
echo '<p>'.$rowa['logo'];
- echo ' <a href="#" onclick="survey_remove_logo(\''.$this->profile.'\'); return false" title="'.$lang['srv_te_remove_setting'].'"><span class="faicon delete_circle icon-orange_link"></span></a>';
+ echo ' <a href="#" onclick="survey_remove_logo(\''.$this->profile.'\'); return false" title="'.$lang['srv_te_remove_setting'].'"><span class="faicon trash"></span></a>';
echo '</p>';
}
echo '</p></form>';
- echo '</fieldset>';
- echo '<br />';
}
// 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) {
- echo '<fieldset><legend>'.$lang['srv_te_progressbar'].'</legend>';
- echo '<div id="theme_progressbar">';
- echo '<p><label>' . $lang['srv_te_progressbar_show'] . ':</label> ';
- echo '<label for="theme_progressbar_1"><input type="radio" id="theme_progressbar_1" name="progressbar" value="1"' . ($row['progressbar'] == 1 ? ' checked="checked"' : '') . ' autocomplete="off"/>' . $lang['yes'] . '</label> ';
- echo '<label for="theme_progressbar_0"><input type="radio" id="theme_progressbar_0" name="progressbar" value="0"' . ($row['progressbar'] == 0 ? ' checked="checked"' : '') . ' autocomplete="off"/>' . $lang['no1'] . '</label> ';
- echo '</p></div>'; # id="theme_progressbar"
- echo '</fieldset>';
-
- echo '<br />';
+
+ $sqlAnketa = sisplet_query("SELECT progressbar FROM srv_anketa WHERE id='$this->anketa'");
+ $rowAnketa = mysqli_fetch_array($sqlAnketa);
+
+ echo '<h3>'.$lang['srv_te_progressbar'].'</h3>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">' . $lang['srv_te_progressbar_show'] . '</span>';
+
+ echo '<div class="setting_item" id="theme_progressbar">';
+ echo '<input type="radio" id="theme_progressbar_1" name="progressbar" value="1"' . ($rowAnketa['progressbar'] == 1 ? ' checked="checked"' : '') . ' autocomplete="off"/>';
+ echo '<label for="theme_progressbar_1">' . $lang['yes'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item" id="theme_progressbar">';
+ echo '<input type="radio" id="theme_progressbar_0" name="progressbar" value="0"' . ($rowAnketa['progressbar'] == 0 ? ' checked="checked"' : '') . ' autocomplete="off"/>';
+ echo '<label for="theme_progressbar_0">' . $lang['no1'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
}
}
- echo '<fieldset><legend>'.$lang['srv_te_survey_h_text'].'</legend>';
+ echo '<h3>'.$lang['srv_te_survey_h_text'].'</h3>';
+ echo '<div class="columns">';
$this->displayOption(1, 1);
$this->displayOption(1, 4);
$this->displayOption(1, 2);
$this->displayOption(1, 3);
- echo '</fieldset>';
-
- echo '<br />';
+ echo '</div>';
- echo '<fieldset><legend>'.$lang['srv_te_outer_frame'].'</legend>';
+ echo '<h3>'.$lang['srv_te_background_color'].'</h3>';
+ echo '<div class="columns">';
$this->displayOption(6, 3);
- echo '</fieldset>';
-
- echo '<br />';
-
- echo '<fieldset><legend>'.$lang['srv_te_question_border'].'</legend>';
- $this->displayOption(5, 5);
- echo '</fieldset>';
-
- echo '<br />';
+ echo '</div>';
- echo '<fieldset><legend>'.$lang['srv_te_question_text'].'</legend>';
+ echo '<h3>'.$lang['srv_te_question_text'].'</h3>';
+ echo '<div class="columns">';
$this->displayOption(2, 1);
$this->displayOption(2, 4);
$this->displayOption(2, 2);
+ echo '</div>';
+ echo '<div class="columns top16">';
$this->displayOption(5, 3);
- echo '</fieldset>';
-
- echo '<br />';
+ $this->displayOption(5, 5);
+ echo '</div>';
- echo '<fieldset><legend>'.$lang['srv_te_answers_text'].'</legend>';
+ echo '<h3>'.$lang['srv_te_answers_text'].'</h3>';
+ echo '<div class="columns">';
$this->displayOption(3, 1);
$this->displayOption(3, 4);
- $this->displayOption(3, 2);
+ echo '</div>';
+ echo '<div class="columns top16">';$this->displayOption(3, 2);
$this->displayOption(4, 3);
- echo '</fieldset>';
-
- echo '<br />';
+ echo '</div>';
// Custom checkbox/radio (stars, smilies, thumbs)
- echo '<fieldset>';
// Radio/checkboxi za pc
if($mobile != 1){
- echo '<legend>'.$lang['srv_te_custom_checkbox_radio'].'</legend>';
+ echo '<h3>'.$lang['srv_te_custom_checkbox_radio'].'</h3>';
+ echo '<div class="columns">';
$this->displayOption(7, 7);
$this->displayOption(7, 15);
+ echo '</div>';
//$this->displayOption(10, 17);
}
// Radio/checkboxi za mobitel
else{
- echo '<legend>'.$lang['srv_te_custom_mobile_checkbox_radio'].'</legend>';
+ echo '<h3>'.$lang['srv_te_custom_mobile_checkbox_radio'].'</h3>';
+ echo '<div class="columns">';
$this->displayOption(7, 8);
$this->displayOption(7, 16);
+ echo '</div>';
// Za mobitel ne rabimo accessibility ikon
//$this->displayOption(10, 17);
}
- echo '</fieldset>';
-
- echo '<br />';
// Tooltipster/slovar/glossary
- echo '<fieldset><legend>'.$lang['srv_te_custom_glossary_popup'].'</legend>';
+ echo '<h3>'.$lang['srv_te_custom_glossary_popup'].Help::display('srv_oblika_slovarSlovar').'</h3>';
+ echo '<div class="columns">';
$this->displayOption(8, 9);
$this->displayOption(8, 11);
$this->displayOption(8, 10);
$this->displayOption(8, 12);
- echo '</fieldset>';
-
- echo '<br />';
+ echo '</div>';
- echo '<fieldset><legend>'.$lang['srv_te_custom_glossary_keywords'].'</legend>';
+ echo '<h3>'.$lang['srv_te_custom_glossary_keywords'].Help::display('srv_oblika_slovarIKljucna').'</h3>';
+ echo '<div class="columns">';
$this->displayOption(9, 9);
$this->displayOption(9, 13);
$this->displayOption(9, 14);
- echo '</fieldset>';
-
-
- echo '<p><label><input type="checkbox" name="current_skin" value="1" '.($row['skin_profile'] == $rowa['id']?'checked disabled':'').' onchange="$(this).attr(\'disabled\', true); te_change_profile(\''.$this->profile.'\'); return false;"> '.$lang['srv_save_set_theme'].'</label></p>';
-
- echo '<p>';
- echo '<div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange floatLeft" href="index.php?anketa='.$this->anketa.'&a=tema"><span>'.$lang['edit1337'].'</span></a></div>';
- echo '</p>';
-
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onClick="window.location.href=\'index.php?anketa='.$this->anketa.'&a=tema\';return false;">'.$lang['edit1337'].'</button>';
echo '</div>';
+ echo '</div>';
+
$this->preview();
+
+ echo '</div>';
?>
<script>
@@ -195,8 +201,6 @@ class SurveyThemeEditor { </script>
<?
- //echo '</div>';
-
}
static function new_theme_alert ($name, $css=false) {
@@ -233,29 +237,38 @@ class SurveyThemeEditor { $sql = sisplet_query("SELECT value FROM srv_theme_editor".$this->mobile." WHERE profile_id='$this->profile' AND id='$id' AND type='$type'");
$row = mysqli_fetch_array($sql);
- echo '<p>';
-
+ $row['value'] = isset($row['value']) ? $row['value'] : '';
+
// pisava
if ($type == 1) {
+
+ echo '<div class="setting_box">';
- echo ''.$lang['srv_te_font_family'].': <select name="font'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">';
- echo '<option value=""'.(''==$row['value']?' selected':'').' style="font-size:13px">'.$lang['srv_te_default'].'</option>';
+ echo ''.$lang['srv_te_font_family'].': <select class="dropdown large auto-save" name="font'.$id.'" data-id="'.$id.'" data-type="'.$type.'">';
+ echo '<option value=""'.(''==$row['value']?' selected':'').'">'.$lang['srv_te_default'].'</option>';
foreach (self::$fonts AS $key => $val) {
echo '<option value="'.$key.'"'.($key==$row['value']?' selected':'').' style="font-family: '.$val.'; font-size:13px">'.substr($val, 0, strpos($val, ',')).'</option>';
}
echo '</select> ';
-
+
if ($row['value'] != '')
- echo '<a href="#" onclick="te_remove_setting(\''.$id.'\', \''.$type.'\'); return false;" title="'.$lang['srv_te_remove_setting'].'"><span class="sprites arrow_undo"></span></a>';
+ echo '<a href="#" onclick="te_remove_setting(\''.$id.'\', \''.$type.'\'); return false;" title="'.$lang['srv_te_remove_setting'].'"><span class="faicon trash"></span></a>';
+
+ echo '</div> ';
// 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'];
+ if ($row['value'] == '')
+ $value = '#000000';
+ else
+ $value = $row['value'];
+
+ echo '<div class="setting_box">';
if ($type == 2 || $type == 9)
echo ''.$lang['srv_te_font_color'].': ';
- elseif ($type == 3)
+ elseif($type == 3)
echo ''.$lang['srv_te_background_color'].': ';
elseif($type == 10)
echo ''.$lang['srv_te_custom_border_color'].': ';
@@ -266,17 +279,23 @@ class SurveyThemeEditor { elseif($type == 16)
echo ''.$lang['srv_te_custom_icon_mobile_color'].': ';
- if ($row['value'] == '') echo '<span><a href="#" onclick="$(\'#color-'.$id.'-'.$type.'\').show(); $(this).parent().hide(); return false;" title="'.$lang['edit4'].'">'.$lang['srv_te_default'].' <span class="faicon edit"></span></a></span>';
+ if ($row['value'] == '') echo '<div class="input_box"><a href="#" onclick="$(\'#color-'.$id.'-'.$type.'\').show(); $(this).parent().hide(); return false;" title="'.$lang['edit4'].'">'.$lang['srv_te_default'].' <span class="faicon edit"></span></a></div>';
- echo '<span id="color-'.$id.'-'.$type.'" '.($row['value']==''?'style="display:none;"':'').'>';
- echo '<input type="text" id="color'.$id.'-'.$type.'" class="colorwell auto-save" name="color'.$id.'-'.$type.'" value="'.$value.'" data-id="'.$id.'" data-type="'.$type.'"> ';
- echo '<a href="#" onclick="te_remove_setting(\''.$id.'\', \''.$type.'\'); return false;" title="'.$lang['srv_te_remove_setting'].'"><span class="sprites arrow_undo"></span></a>';
- echo '</span>';
+ echo '<div id="color-'.$id.'-'.$type.'" '.($row['value']==''?'style="display:none;"':'').'>';
+ echo '<input type="text" class="text large colorwell auto-save" id="color'.$id.'-'.$type.'" name="color'.$id.'-'.$type.'" value="'.$value.'" data-id="'.$id.'" data-type="'.$type.'"> ';
+ echo '</div>';
+
+ if ($row['value'] != '')
+ echo '<a href="#" onclick="te_remove_setting(\''.$id.'\', \''.$type.'\'); return false;" title="'.$lang['srv_te_remove_setting'].'"><span class="faicon trash"></span></a>';
+
+ echo '</div>';
// velikost pisave
} elseif ($type == 4) {
+
+ echo '<div class="setting_box">';
- echo ''.$lang['srv_te_font_size'].': <select name="fontsize'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">';
+ echo ''.$lang['srv_te_font_size'].': <select class="dropdown large auto-save" name="fontsize'.$id.'" data-id="'.$id.'" data-type="'.$type.'">';
echo '<option value=""'.(''==$row['value']?' selected':'').'>'.$lang['srv_te_default'].'</option>';
for ($i=50; $i<=200; $i+=10) {
echo '<option value="'.$i.'"'.($i==$row['value']?' selected':'').' style="font-size: '.$i.'%;">'.$i.'%</option>';
@@ -284,25 +303,33 @@ class SurveyThemeEditor { echo '</select> ';
if ($row['value'] != '')
- echo '<a href="#" onclick="te_remove_setting(\''.$id.'\', \''.$type.'\'); return false;" title="'.$lang['srv_te_remove_setting'].'"><span class="sprites arrow_undo"></span></a>';
-
+ echo '<a href="#" onclick="te_remove_setting(\''.$id.'\', \''.$type.'\'); return false;" title="'.$lang['srv_te_remove_setting'].'"><span class="faicon trash"></span></a>';
+
+ echo '</div> ';
+
// border vprasanja
} elseif ($type == 5) {
if ($row['value'] == '') $value = '1'; else $value = $row['value'];
- echo $lang['srv_te_question_border'].': <select name="question_border'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">';
- echo '<option value="" '.(''==$row['value']?' selected':'').'>'.$lang['default'].'</option>';
+ echo '<div class="setting_box">';
+
+ echo $lang['srv_te_question_border'].':<select class="dropdown large auto-save" name="question_border'.$id.'" data-id="'.$id.'" data-type="'.$type.'">';
+ echo '<option value="" '.(''==$row['value']?' selected':'').'>'.$lang['srv_te_default'].'</option>';
echo '<option value="0" '.($row['value']=='0'?' selected':'').'>'.$lang['srv_te_question_border_0'].'</option>';
echo '<option value="1" '.($row['value']=='1'?' selected':'').'>'.$lang['srv_te_question_border_1'].'</option>';
echo '<option value="2" '.($row['value']=='2'?' selected':'').'>'.$lang['srv_te_question_border_2'].'</option>';
echo '</select> ';
+ echo '</div> ';
// izbira custom checkbox/radio gumbov
} elseif($type == 7 ) {
+
+ echo '<div class="setting_box">';
+
echo $lang['srv_te_custom_icon_pc'] . ': ';
- echo '<select id="izbira-checkbox-gumbov" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">
- <option value="0" '.(($row['value'] == 0 || is_null($row['value'])) ? " selected":"").'>'.$lang['default'].'</option>
+ echo '<select class="dropdown large auto-save" id="izbira-checkbox-gumbov" data-id="'.$id.'" data-type="'.$type.'">
+ <option value="0" '.(($row['value'] == 0 || is_null($row['value'])) ? " selected":"").'>'.$lang['srv_te_default'].'</option>
<option value="18" '.($row['value'] == 18 ? " selected":"").'>18 px</option>
<option value="21" '.($row['value'] == 21 ? " selected":"").'>21 px</option>
<option value="25" '.($row['value'] == 25 ? " selected":"").'>25 px</option>
@@ -312,13 +339,14 @@ class SurveyThemeEditor { <option value="45" '.($row['value'] == 45 ? " selected":"").'>45 px</option>
<option value="50" '.($row['value'] == 50 ? " selected":"").'>50 px</option>
<option value="55" '.($row['value'] == 55 ? " selected":"").'>55 px</option>
- </select>';
+ </select></div>';
} elseif($type == 8) {
+ echo '<div class="setting_box">';
echo $lang['srv_te_custom_icon_mobile'] . ': ';
- echo '<select id="izbira-checkbox-gumbov" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">
- <option value="0" '.(($row['value'] == 0 || is_null($row['value'])) ? " selected":"").'>'.$lang['default'].'</option>
+ echo '<select class="dropdown large auto-save" id="izbira-checkbox-gumbov" data-id="'.$id.'" data-type="'.$type.'">
+ <option value="0" '.(($row['value'] == 0 || is_null($row['value'])) ? " selected":"").'>'.$lang['srv_te_default'].'</option>
<option value="21" '.($row['value'] == 20 ? " selected":"").'>20 px</option>
<option value="25" '.($row['value'] == 25 ? " selected":"").'>25 px</option>
<option value="30" '.($row['value'] == 30 ? " selected":"").'>30 px</option>
@@ -327,44 +355,55 @@ class SurveyThemeEditor { <option value="45" '.($row['value'] == 45 ? " selected":"").'>45 px</option>
<option value="50" '.($row['value'] == 50 ? " selected":"").'>50 px</option>
<option value="55" '.($row['value'] == 55 ? " selected":"").'>55 px</option>
- </select>';
+ </select></div>';
// Izpišemo border opcije
} elseif($type == 11) {
+ echo '<div class="setting_box">';
+
echo $lang['srv_te_custom_border_size'].': ';
- echo '<select name="bordersize'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">';
+ echo '<select class="dropdown large auto-save" name="bordersize'.$id.'" data-id="'.$id.'" data-type="'.$type.'">';
echo '<option value=""'.(''==$row['value']?' selected':'').'>'.$lang['srv_te_default'].'</option>';
for ($i=1; $i<=6; $i++) {
echo '<option value="'.$i.'"'.($i==$row['value']?' selected':'').'>'.$i.'px</option>';
}
echo '</select> ';
+ echo '</div> ';
} elseif($type == 12) {
+ echo '<div class="setting_box">';
+
echo $lang['srv_te_custom_border_radius'].': ';
- echo '<select name="borderradius'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">';
+ echo '<select class="dropdown large auto-save" name="borderradius'.$id.'" data-id="'.$id.'" data-type="'.$type.'">';
echo '<option value=""'.(''==$row['value']?' selected':'').'>'.$lang['srv_te_default'].'</option>';
for ($i=5; $i<=30; $i+=5) {
echo '<option value="'.$i.'"'.($i==$row['value']?' selected':'').'>'.$i.'px</option>';
}
echo '</select> ';
+ echo '</div> ';
// Stil pisave bold, italic, underline
} elseif($type == 14) {
+ echo '<div class="setting_box">';
+
echo $lang['srv_te_custom_font_style_keywords'].': ';
- echo '<select name=""keyword_style'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">';
+ echo '<select class="dropdown large auto-save" name=""keyword_style'.$id.'" data-id="'.$id.'" data-type="'.$type.'">';
echo '<option value=""'.(''==$row['value']?' selected':'').'>'.$lang['srv_te_default'].'</option>';
echo '<option value="bold" '.('bold'==$row['value']?' selected':'').'>'.$lang['srv_te_custom_font_style_keywords_bold'].'</option>';
echo '<option value="italic" '.('italic'==$row['value']?' selected':'').'>'.$lang['srv_te_custom_font_style_keywords_italic'].'</option>';
echo '<option value="underline" '.('underline'==$row['value']?' selected':'').'>'.$lang['srv_te_custom_font_style_keywords_underline'].'</option>';
echo '</select> ';
+ echo '</div> ';
// Accessibility checkbox (radio/checkboxi niso obarvani)
} elseif($type == 17) {
+ echo '<div class="setting_box">';
+
echo '<label for="accessibility'.$id.'">'.$lang['srv_te_custom_icon_accessibility'].': ';
echo '<input type="checkbox" value="1" name="accessibility'.$id.'" id="accessibility'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save" '.($row['value'] == '1' ? ' checked="checked"' : '').'></label>';
+ echo '</div> ';
}
- echo '</p>';
}
function preview () {
|