diff options
Diffstat (limited to 'admin/survey/classes/class.SurveyZoom.php')
-rw-r--r-- | admin/survey/classes/class.SurveyZoom.php | 354 |
1 files changed, 206 insertions, 148 deletions
diff --git a/admin/survey/classes/class.SurveyZoom.php b/admin/survey/classes/class.SurveyZoom.php index 593a1ee..ed1c953 100644 --- a/admin/survey/classes/class.SurveyZoom.php +++ b/admin/survey/classes/class.SurveyZoom.php @@ -122,11 +122,9 @@ class SurveyZoom $css = (self::$currentProfileId == 0 ? ' gray' : '');
if ($hideAdvanced == false || self::$currentProfileId != 0) {
- echo '<li class="space"> </li>';
echo '<li>';
- echo '<span class="as_link'.$css.'" id="link_zoom" title="'.$lang['srv_zoom_setting'].'" onclick="showZoomSettings();">'.$lang['srv_zoom_setting'].'</span>';
+ echo ' <span class="'.$css.'" id="link_zoom" title="'.$lang['srv_zoom_setting'].'" onclick="showZoomSettings();">'.$lang['srv_zoom_setting'].'</span>';
echo '</li>';
-
}
}
@@ -216,23 +214,30 @@ class SurveyZoom $currentFilterProfile = self::$profiles[$current_pid];
if ( self::$currentProfileId != ZOOM_DEFAULT_PROFILE ) {
- echo '<div id="not_default_setting">';
+ echo '<div id="not_default_setting" class="popup_note">';
echo $lang['srv_not_default_setting'];
- echo '</div><br class="clr displayNone">';
+ echo '</div>';
}
- echo '<div id="zoom_profiles_left">';
- echo '<span id="zoom_profiles_holder">';
+
+ echo '<div class="popup_main with_menu">';
+
+
+ echo '<div id="zoom_profiles_left" class="popup_left">';
+ echo '<div id="zoom_profiles_holder">';
+
# zlistamo vse profile
- echo '<span id="zoom_profiles" class="select">';
+ echo '<div id="zoom_profiles" class="list select">';
if (count(self::$profiles)) {
foreach (self::$profiles as $id => $profile) {
- echo '<div class="option' . ($current_pid == $id ? ' active' : '') . '" id="zoom_profile_' . $id . '" value="'.$id.'" '.($current_pid == $id ? '' : ' onclick="zoomChangeProfile(\''.$id.'\')"').'>';
+ echo '<div class="list-item option' . ($current_pid == $id ? ' active' : '') . '" id="zoom_profile_' . $id . '" value="'.$id.'" '.($current_pid == $id ? '' : ' onclick="zoomChangeProfile(\''.$id.'\')"').'>';
echo $profile['name'];
if($current_pid == $id){
+ echo '<div class="profile_icons">';
+
# sistemskega ne moremo izbrisati
if ($current_pid != 0) {
echo '<a href="#" title="'.$lang['srv_delete_profile'].'" onclick="zoomProfileAction(\'showDelete\'); return false;"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>'."\n";
@@ -242,23 +247,29 @@ class SurveyZoom if ($current_pid > 0) {
echo '<a href="#" title="'.$lang['srv_rename_profile'].'" onclick="zoomProfileAction(\'showRename\'); return false;"><span class="faicon edit icon-as_link floatRight spaceRight"></span></a>'."\n";
}
+
+ echo '</div>';
}
echo '</div>';
}
}
- echo '</span>'; # zoom_profilea
- echo '</span>'; # zoom_profiles_holder
-
+ echo '</div>'; # zoom_profilea
+
+ // Gumb za dodajanje novega profila
+ echo '<button class="small white-black" title="'.$lang['srv_create_new_profile'].'" onclick="zoomProfileAction(\'newName\'); return false;">';
+ echo ' <span class="faicon plus_32"></span>'.$lang['srv_create_new_profile'];
+ echo '</button>';
+
+ echo '</div>'; # zoom_profiles_holder
echo '</div>'; # zoom_profiles_left
- echo '<div id="zoom_profiles_right">'."\n";
+ echo '<div id="zoom_profiles_right" class="popup_right">'."\n";
if ($current_pid == 0) {
- echo '<div id="zoom_note">';
+ echo '<div id="zoom_note" class="popup_right_note">';
echo $lang['srv_change_default_profile'];
echo '</div>'; // zoom_profile_note
- echo '<br class="clr" />'."\n";
}
echo '<div id="zoom_content">';
@@ -266,20 +277,23 @@ class SurveyZoom echo '</div>'; // zoom_profile_content
echo '</div>'; // zoom_profile_right
+
+
+ echo '</div>';
- echo '<div id="zoom_button_holder">'."\n";
+ echo '<div id="zoom_button_holder" class="button_holder">'."\n";
+
if ((int)$current_pid <= 0 ) {
- echo '<span class="floatRight" title="'.$lang['srv_run_as_session_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zoomProfileAction(\'run_session_profile\'); return false;"><span>'.$lang['srv_run_as_session_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_create_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'newName\'); return false;"><span>'.$lang['srv_create_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'cancel\'); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
- } else {
- echo '<span class="floatRight" title="'.$lang['srv_save_run_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zoomProfileAction(\'runProfile\'); return false;"><span>'.$lang['srv_run_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_run_as_session_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'run_session_profile\'); return false;"><span>'.$lang['srv_run_as_session_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_create_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'newName\'); return false;"><span>'.$lang['srv_create_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'cancel\'); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
-
+ echo '<button class="medium white-blue" title="'.$lang['srv_close_profile'].'" onclick="zoomProfileAction(\'cancel\'); return false;">'.$lang['srv_close_profile'] . '</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_run_as_session_profile'] . '" onclick="zoomProfileAction(\'run_session_profile\'); return false;">'.$lang['srv_run_as_session_profile'] . '</button>';
+ }
+ else {
+ echo '<button class="medium white-blue" title="'.$lang['srv_close_profile'].'" onclick="zoomProfileAction(\'cancel\'); return false;">'.$lang['srv_close_profile'] . '</button>';
+ echo '<button class="medium white-blue" title="'.$lang['srv_run_as_session_profile'] . '" onclick="zoomProfileAction(\'run_session_profile\'); return false;">'.$lang['srv_run_as_session_profile'] . '</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_save_run_profile'] . '" onclick="zoomProfileAction(\'runProfile\'); return false;">'.$lang['srv_run_profile'] . '</button>';
}
+
echo '</div>'."\n"; // zoom_button_holder
@@ -287,26 +301,54 @@ class SurveyZoom //echo '<div id="zoom_cover_div"></div>'."\n";
// div za kreacijo novega
- echo '<div id="newProfileDiv">'.$lang['srv_missing_profile_name'].': '."\n";
- echo '<input id="newProfileName" name="newProfileName" type="text" value="" size="45" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zoomProfileAction(\'newCreate\'); return false;"><span>'.$lang['srv_analiza_arhiviraj_save'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'newCancel\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="newProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="newProfileName" name="newProfileName" type="text" class="text large" value=""/>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="zoomProfileAction(\'newCancel\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="zoomProfileAction(\'newCreate\'); return false;">'.$lang['srv_analiza_arhiviraj_save'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za preimenovanje
- echo '<div id="renameProfileDiv">'.$lang['srv_missing_profile_name'].': '."\n";
- echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . $currentFilterProfile['name'] . '" size="45" />'."\n";
- echo '<input id="renameProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zoomProfileAction(\'doRename\'); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'cancelRename\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="renameProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . $currentFilterProfile['name'] . '" class="text large"/>';
+ echo '<input id="renameProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="zoomProfileAction(\'cancelRename\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="zoomProfileAction(\'doRename\'); return false;">'.$lang['srv_rename_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za brisanje
- echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <b>' . $currentFilterProfile['name'] . '</b>?'."\n";
- echo '<input id="deleteProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zoomProfileAction(\'doDelete\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'cancelDelete\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="deleteProfileDiv">';
+
+ echo $lang['srv_missing_profile_delete_confirm'].': <span class="semi-bold">' . $currentFilterProfile['name'] . '</span>?';
+ echo '<input id="deleteProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="zoomProfileAction(\'cancelDelete\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="zoomProfileAction(\'doDelete\'); return false;">'.$lang['srv_delete_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
}
/** Funkcija prikaze osnovnih informacije profila
@@ -314,9 +356,11 @@ class SurveyZoom */
function DisplayProfileData($current_pid=null) {
global $lang;
+
if (isset($_POST['error'])) {
echo '<span class="red">* '.$lang[$_POST['error']].'</span><br/>';
}
+
# podatki profila
if ($current_pid == null) {
$current_pid = self::$currentProfileId;
@@ -326,39 +370,44 @@ class SurveyZoom $all_spr = Cache::cache_all_srv_spremenljivka(self::$sid,true);
- echo '<span>'.$lang['srv_zoom_choose'].'</span>';
+
+ echo '<div class="setting_line">';
+ echo $lang['srv_zoom_choose'];
+ echo '</div>';
+
if (count($all_spr) > 0)
foreach ($all_spr AS $id => $spremenljivka) {
if ( in_array($spremenljivka['tip'], array(1,2,3) ) ) {
- echo '<div class="zoom_var">';
-
- echo '<label>';
- echo '<input name="zoom_vars" id="zoom_var_'.$spremenljivka['id'].'" value="'.$spremenljivka['id'].'" type="checkbox"'
- .(is_array($vars) && in_array($spremenljivka['id'],$vars) ? ' checked' : '').'>';
- echo strip_tags($spremenljivka['variable']).' - '.strip_tags($spremenljivka['naslov']).'</label>';
-
+ echo '<div class="settings_block">';
+
+ echo ' <div class="setting_line">';
+ echo ' <input name="zoom_vars" id="zoom_var_'.$spremenljivka['id'].'" value="'.$spremenljivka['id'].'" type="checkbox" '.(is_array($vars) && in_array($spremenljivka['id'],$vars) ? ' checked' : '').'>';
+ echo ' <label for="zoom_var_'.$spremenljivka['id'].'">'.strip_tags($spremenljivka['variable']).' - '.strip_tags($spremenljivka['naslov']).'</label>';
+ echo ' </div>';
+
echo '</div>';
- } else if ( in_array($spremenljivka['tip'], array(6,16,17))) {
- echo '<div class="zoom_var">';
-
+ }
+ else if ( in_array($spremenljivka['tip'], array(6,16,17))) {
+ echo '<div class="settings_block">';
+
# izpišemo glavno spremenljivko
- echo '<label style="margin-left:20px;">';
- echo strip_tags($spremenljivka['variable']).' - '.strip_tags($spremenljivka['naslov']).'</label>';
+ echo ' <div class="setting_line">';
+ echo ' <label>'.strip_tags($spremenljivka['variable']).' - '.strip_tags($spremenljivka['naslov']).'</label>';
+ echo ' </div>';
# izpišemo gride (zamaknjeno)
$sql = sisplet_query("SELECT id, naslov, variable FROM srv_vrednost WHERE spr_id='$id' AND other = 0 ORDER BY vrstni_red");
while ($row = mysqli_fetch_assoc($sql)) {
- echo '<label style="margin-left:25px; margin-top:5px;">';
- echo '<input name="zoom_vars" id="zoom_var_'.$spremenljivka['id'].'_'.$row['id'].'" value="'.$spremenljivka['id'].'_'.$row['id'].'" type="checkbox"'
- .(is_array($vars) && in_array($spremenljivka['id'].'_'.$row['id'],$vars) ? ' checked' : '').'>';
- echo strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'</label>';
+ echo ' <div class="setting_line indent">';
+ echo ' <input name="zoom_vars" id="zoom_var_'.$spremenljivka['id'].'_'.$row['id'].'" value="'.$spremenljivka['id'].'_'.$row['id'].'" type="checkbox" '.(is_array($vars) && in_array($spremenljivka['id'].'_'.$row['id'],$vars) ? ' checked' : '').'>';
+ echo ' <label for="zoom_var_'.$spremenljivka['id'].'_'.$row['id'].'">'.strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'</label>';
+ echo ' </div>';
}
+
echo '</div>';
}
}
-
- echo '<br class="clr"/>';
}
/* Shranimo izbrane variable in resetiramo if na 0, ter pobrišemo morebitni pogoj če obstaja
@@ -464,36 +513,45 @@ class SurveyZoom static function displayZoomConditions($showDiv = true) {
global $lang;
-
- $vars = self::$profiles[self::$currentProfileId]['vars'];
+
+ $vars = isset(self::$profiles[self::$currentProfileId]['vars']) ? self::$profiles[self::$currentProfileId]['vars'] : '';
$all_spr = Cache::cache_all_srv_spremenljivka(self::$sid);
if (is_countable($vars) && count($vars) > 0) {
$conditions = self::$profiles[self::$currentProfileId]['conditions'];
+
if ($showDiv == true) {
- echo '<div id="div_zoom_condition" '.(self::$showVariables == false ? ' style="display:none"' : '').'>';
+ echo '<div id="div_zoom_condition" class="filter_box" '.(self::$showVariables == false ? ' style="display:none"' : '').'>';
}
- echo '<span class="" style="display:inline-block; width:100%">';
- echo '<b>'.$lang['srv_zoom'].'</b>';
- echo ' "'.self::$profiles[self::$currentProfileId]['name'].'"';
- echo '<span class="as_link spaceLeft" onclick="showZoomSettings();">'.$lang['srv_profile_edit'].'</span>';
- echo '<span class="as_link spaceLeft" id="span_zoom_condition_remove" onclick="removeZoomProfile();">'.$lang['srv_profile_remove'].'</span>';
-
- # dodamo še +/- za razpiranje variabel
- echo '<span class="floatRight spaceLeft">';
- echo '<span id="zoomSpritesMinus" class="'.(self::$extended == true ? '' : ' displayNone').'">';
- echo '<span class="pointer faicon icon-blue minus" onClick="toggleAllZoom(\'1\')" > </span>';
- echo '</span>';
- echo '<span id="zoomSpritesPlus" class="'.(self::$extended == true ? ' displayNone' : '').'">';
- echo '<span class="pointer faicon icon-blue plus" onClick="toggleAllZoom(\'0\')"> </span>';
- echo '</span>';
- echo '</span>';
-
- echo '</span>';
- echo '<br/>';
- echo '<span class="floatLeft'.( self::$extended == false ? ' displayNone': '').'" >';
- echo '<ul >';
+
+
+ echo '<div class="header">';
+
+ echo ' <span class="semi-bold">'.$lang['srv_zoom'].' </span>';
+ echo ' <span class="title">'.self::$profiles[self::$currentProfileId]['name'].'</span>';
+
+ # dodamo še +/- za razpiranje variabel
+ echo ' <span class="expand_icon">';
+ echo ' <span id="zoomSpritesMinus" class="'.(self::$extended == true ? '' : ' displayNone').'">';
+ echo ' <span class="pointer faicon icon-blue arrow2_u" onClick="toggleAllZoom(\'1\')" ></span>';
+ echo ' </span>';
+ echo ' <span id="zoomSpritesPlus" class="'.(self::$extended == true ? ' displayNone' : '').'">';
+ echo ' <span class="pointer faicon icon-blue arrow2_d" onClick="toggleAllZoom(\'0\')"></span>';
+ echo ' </span>';
+ echo ' </span>';
+
+ echo ' <div class="icons">';
+ echo ' <span class="faicon edit" title="'.$lang['srv_profile_edit'].'" onclick="showZoomSettings();"></span>';
+ echo ' <span class="faicon delete" id="span_zoom_condition_remove" title="'.$lang['srv_profile_remove'].'" onclick="removeZoomProfile();"></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="content '.( self::$extended == false ? 'displayNone': '').'">';
+ echo '<ul>';
+
IF (count($vars) > 0 && is_array($vars)) {
foreach ($vars AS $_spr) {
$_spr_tmp = explode('_',$_spr);
@@ -508,54 +566,63 @@ class SurveyZoom } else {
$row = Cache::srv_spremenljivka($spr);
}
+
echo '<li id="zoom_var_condition_'.$_spr.'">';
- echo '<div class="zoom_short_text" title="('.strip_tags($row['variable']).') '.strip_tags($row['naslov']).'">';
- echo '(<b>'.strip_tags($row['variable']).'</b>) ';
- echo strip_tags($row['naslov']);
+
+ echo '<div class="zoom_question" title="('.strip_tags($row['variable']).') '.strip_tags($row['naslov']).'">';
+ echo ' <span class="semi-bold">('.strip_tags($row['variable']).')</span> '.strip_tags($row['naslov']);
echo '</div>';
- echo '<div class="zoom_short_text">';
- #echo '<div class="zoom_short_text'.( self::$extended == false ? ' displayNone': '').'">';
+
+ echo '<div class="zoom_variable">';
if (isset($vre) && $vre > 0) {
# imamo multigride polovimo grids
$sql = sisplet_query("SELECT id, naslov, variable FROM srv_grid WHERE spr_id='$spr' AND other = 0 ORDER BY vrstni_red");
while ($row = mysqli_fetch_assoc($sql)) {
- echo '<label title="'.strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'">';
- echo '<input name="zoom_cond_'.$spr.'[]" id="zoom_cond_'.$spr.'_'.$vre.'_'.$row['id'].'" value="'.$spr.'_'.$vre.'_'.$row['id'].'" type="checkbox" onchange="changeZoomCheckbox(); return false;"';
- if (is_array($_conditions) && isset($_conditions[(int)$vre])) {
- if (in_array($row['id'],$_conditions[(int)$vre])) {
- echo 'checked="checekd"';
+
+ $checked = '';
+ if (is_array($_conditions) && isset($_conditions[(int)$vre])) {
+ if (in_array($row['id'],$_conditions[(int)$vre])) {
+ $checked = 'checked="checked"';
}
}
- echo ' autocomplete="off">';
+
+ echo '<input name="zoom_cond_'.$spr.'[]" id="zoom_cond_'.$spr.'_'.$vre.'_'.$row['id'].'" value="'.$spr.'_'.$vre.'_'.$row['id'].'" type="checkbox" onchange="changeZoomCheckbox(); return false;" autocomplete="off">';
- echo strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'</label>';
- echo "<br>";
+ echo '<label for="zoom_cond_'.$spr.'_'.$vre.'_'.$row['id'].'" title="'.strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'">';
+ echo strip_tags($row['variable']).' - '.strip_tags($row['naslov']);
+ echo '</label>';
}
- } else {
+ }
+ else {
# imamo navaden polovimo vrednosti
$sql = sisplet_query("SELECT id, naslov, variable FROM srv_vrednost WHERE spr_id='$spr' AND other = 0 ORDER BY vrstni_red");
while ($row = mysqli_fetch_assoc($sql)) {
- echo '<label title="'.strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'">';
- echo '<input neme="zoom_cond_'.$spr.'[]" id="zoom_cond_'.$spr.'_'.$vre.'_'.$row['id'].'" value="'.$spr.'_'.$vre.'_'.$row['id'].'" type="checkbox" onchange="changeZoomCheckbox(); return false;"';
- if (is_array($_conditions) && isset($_conditions[(int)$vre])) {
- if (in_array($row['id'],$_conditions[(int)$vre])) {
- echo 'checked="checekd"';
+
+ $checked = '';
+ if (is_array($_conditions) && isset($_conditions[(int)$vre])) {
+ if (in_array($row['id'],$_conditions[(int)$vre])) {
+ $checked = 'checked="checked"';
}
}
- echo '>';
- echo strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'</label>';
- echo "<br>";
+
+ echo '<input name="zoom_cond_'.$spr.'[]" id="zoom_cond_'.$spr.'_'.$vre.'_'.$row['id'].'" value="'.$spr.'_'.$vre.'_'.$row['id'].'" type="checkbox" onchange="changeZoomCheckbox(); return false;" '.$checked.'>';
+
+ echo '<label for="zoom_cond_'.$spr.'_'.$vre.'_'.$row['id'].'" title="'.strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'">';
+ echo strip_tags($row['variable']).' - '.strip_tags($row['naslov']);
+ echo '</label>';
}
}
+
echo '</div>';
+
echo '</li>';
}
}
echo '</ul>';
- echo '</span>';
+ echo '</div>';
if ($showDiv == true) {
echo '</div>';
@@ -836,7 +903,7 @@ class SurveyZoom static function generateAwkCondition() {
global $global_user_id;
- $zoom_if_id = (int)self::$profiles[self::$currentProfileId]['if_id'];
+ $zoom_if_id = isset(self::$profiles[self::$currentProfileId]['if_id']) ? (int)self::$profiles[self::$currentProfileId]['if_id'] : 0;
if ($zoom_if_id > 0 ) {
SurveyConditionProfiles :: Init(self::$sid, $global_user_id);
@@ -849,42 +916,31 @@ class SurveyZoom static function getConditionString() {
global $lang;
-# $condition_label = self::$profiles[self::$currentProfileId]['condition_label'];
- ob_start();
- $b = new Branching(self::$sid );
- $if_id = (int)self::$profiles[self::$currentProfileId]['if_id'];
- $b->display_if_label($if_id);
- #$condition_label = mysqli_escape_string(ob_get_contents());
- $condition_label = ob_get_contents();
- ob_end_clean();
+ ob_start();
+ $b = new Branching(self::$sid );
+ $if_id = isset(self::$profiles[self::$currentProfileId]['if_id']) ? (int)self::$profiles[self::$currentProfileId]['if_id'] : 0;
+ $b->display_if_label($if_id);
+ $condition_label = ob_get_contents();
+ ob_end_clean();
if ( $if_id > 0 && $condition_label != '') {
- echo '<div id="conditionProfileNote" class="segmenti">';
- echo '<span class="floatLeft spaceRight">';
- # dodamo še +/- za razpiranje variabel
- echo '<span id="zoomSpritesMinus1" class="'.(self::$showVariables == true ? '' : ' displayNone').'">';
- echo '<span class="pointer faicon icon-blue minus" onClick="toggleShowZoomVariables(\'1\')" > </span>';
- echo '</span>';
- echo '<span id="zoomSpritesPlus1" class="'.(self::$showVariables == true ? ' displayNone' : '').'">';
- echo '<span class="pointer faicon icon-blue plus" onClick="toggleShowZoomVariables(\'0\')"> </span>';
- echo '</span>';
- echo '</span >';
+
+ echo '<div id="conditionProfileNote" class="segmenti filter_box">';
+
+ echo ' <div class="header">';
- echo '<span class="floatLeft">'.$lang['srv_zoom_filter_note'].'</span>';
- echo '<span class="floatLeft spaceLeft">'.$condition_label.'</span>';
-/*
- // ali imamo napake v ifu
- if ((int)self::$profiles[self :: $currentProfileId]['condition_error'] != 0) {
- echo '<br>';
- echo '<span style="border:1px solid #009D91; background-color: #34D0B6; padding:5px; width:auto;"><img src="img_0/error.png" /> ';
- echo '<span class="red strong">'.$lang['srv_profile_condition_has_error'].'</span>';
- echo '</span>';
- }
- */
- echo '<span class="as_link spaceLeft" onclick="showZoomSettings();">'.$lang['srv_profile_edit'].'</span>';
- echo '<span class="as_link spaceLeft" onclick="removeZoomCheckbox();">'.$lang['srv_profile_remove'].'</span>';
+ echo ' <span class="semi-bold">'.$lang['srv_zoom'].'</span>';
+ echo ' <span class="condition">'.$condition_label.'</span>';
+
+ echo ' <div class="icons">';
+ echo ' <span class="faicon edit" onclick="showZoomSettings();" title="'.$lang['srv_profile_edit'].'"></span>';
+ echo ' <span class="faicon delete" onclick="removeZoomCheckbox();" title="'.$lang['srv_profile_remove'].'"></span>';
+ echo ' </div>';
+
+ echo ' </div>';
+
echo '</div>';
- echo '<br class="clr" />';
+
return true;
}
@@ -893,23 +949,25 @@ class SurveyZoom function doZoomFromInspect() {
global $lang;
+
# polovimo id-je variabel iz inspect profila in nastavimo zoom profil
$SI = new SurveyInspect(self::$sid);
$variables_to_add = $SI->getInspectVariables();
+ # shranjujenmo v sejo
session_start();
- # shranjujenmo v sejo
- # dodamo profil in ga izberemo za privzetega
- $_SESSION['surveyZoom'][self::$sid] = array('id'=>-1, 'name'=>$lang['srv_zoom_profile_session'],'vars'=>$variables_to_add, 'conditions'=> '', 'if_id'=>0);
- self::$profiles[-1] = array('id'=>$pid, 'sid'=>self::$sid, 'uid'=>self::$uid, 'name'=>$lang['srv_zoom_profile_session'], 'vars'=>$variables_to_add,'conditions'=>'');
- self::SetDefaultProfile(-1);
- self::$currentProfileId = -1;
- session_commit();
+ # dodamo profil in ga izberemo za privzetega
+ $_SESSION['surveyZoom'][self::$sid] = array('id'=>-1, 'name'=>$lang['srv_zoom_profile_session'],'vars'=>$variables_to_add, 'conditions'=> '', 'if_id'=>0);
+ self::$profiles[-1] = array('id'=>$pid, 'sid'=>self::$sid, 'uid'=>self::$uid, 'name'=>$lang['srv_zoom_profile_session'], 'vars'=>$variables_to_add,'conditions'=>'');
+ self::SetDefaultProfile(-1);
+ self::$currentProfileId = -1;
-
+ session_commit();
+
# prikažemo segmente
- $showDiv = ((int)$_POST['showDiv'] == 1)?true:false;
+ $showDiv = ((int)$_POST['showDiv'] == 1) ? true : false;
+
self::displayZoomConditions($showDiv);
}
}
\ No newline at end of file |