summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.SurveyUrlLinks.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey/classes/class.SurveyUrlLinks.php')
-rw-r--r--admin/survey/classes/class.SurveyUrlLinks.php68
1 files changed, 33 insertions, 35 deletions
diff --git a/admin/survey/classes/class.SurveyUrlLinks.php b/admin/survey/classes/class.SurveyUrlLinks.php
index 0fa3856..4fafb89 100644
--- a/admin/survey/classes/class.SurveyUrlLinks.php
+++ b/admin/survey/classes/class.SurveyUrlLinks.php
@@ -56,29 +56,36 @@ class SurveyUrlLinks
$podstran = $_REQUEST['podstran'];
$m = $_REQUEST['m'];
-
- $popUp = new PopUp();
- $popUp->setId('div_survey_links');
- $popUp->setHeaderText($lang['srv_public_link_title'].':');
-
+
+ echo '<div id="div_survey_links">';
+
+ echo '<h2>'.$lang['srv_public_link_title'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\'); return false;">✕</a></div>';
+
#vsebino shranimo v buffer
ob_start();
-
- echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\'); return false;">✕</a></div>';
if ($msg != null){
- echo ($msg);
- echo '<br />';
+ echo '<p class="bottom16">'.($msg);
+ echo '</p>';
}
$hashUrl = new HashUrl($this->_anketa);
$links = $hashUrl->getSurveyHashes();
if (count($links) == 0){
- echo $lang['srv_public_link_noLink'].'<br />';
+ echo '<p class="bottom16">'.$lang['srv_public_link_noLink'].'</p>';
+ }
+
+ echo '<p class="bottom16"><a href="#" onclick="addSurveyUrlLink(\''.$podstran.'\',\''.$m.'\');">'.$lang['srv_public_link_addLink'].'</a></p>';
+
+ // Dodaten link posebej za NIJZ
+ global $site_domain;
+ if($site_domain == 'anketa.nijz.si' && ($podstran == 'data' || $podstran == 'data_nijz')){
+ echo '<p class="bottom16"><a href="#" onclick="addSurveyUrlLink(\'data_nijz\',\''.$m.'\');">NIJZ - '.$lang['srv_public_link_addLink'].'</a></p>';
}
- echo '<p><a href="#" onclick="addSurveyUrlLink(\''.$podstran.'\',\''.$m.'\');">'.$lang['srv_public_link_addLink'].'</a></p>';
+
if (count($links) > 0){
- echo '<caption>'.$lang['srv_public_link_existing'].'</caption>';
+ echo '<caption>'.$lang['srv_public_link_existing'].':</caption>';
echo '<table class="tbl_survey_links">';
echo '<tr>';
@@ -118,7 +125,7 @@ class SurveyUrlLinks
echo '</span></td>';
echo '<td style="text-align: center;">';
- echo '<input type="checkbox" name="hash_link_refresh" id="hash_link_refresh_'.$this->_anketa.'_'.$link['hash'].'" data-hash="'.$link['hash'].'" data-anketa="'.$this->_anketa.'" onchange="hash_refresh_change(this);"'. (($link['refresh'] == '1') ? ' checked' : '') .'>';
+ echo '<input type="checkbox" name="hash_link_refresh" id="hash_link_refresh_'.$this->_anketa.'_'.$link['hash'].'" data-hash="'.$link['hash'].'" data-anketa="'.$this->_anketa.'" onchange="hash_refresh_change(this);"'. (($link['refresh'] == '1') ? ' checked' : '') .'><label for="hash_link_refresh_'.$this->_anketa.'_'.$link['hash'].'" class="empty"></label>';
echo '</td>';
echo '<td>';
@@ -155,19 +162,12 @@ class SurveyUrlLinks
echo '</table>';
}
-
- #dodamo vsebino
- $content = ob_get_clean();
- $popUp->setContent($content);
-
- # dodamo gumb Preklici
- $buttonClose = new PopUpCancelButton();
- $buttonClose->setCaption($lang['srv_zapri'])->setTitle($lang['srv_zapri']);
- $buttonClose->setFloat('right');
- $popUp->addButton($buttonClose);
- echo $popUp;
-
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
}
function addLink(){
@@ -175,12 +175,9 @@ class SurveyUrlLinks
global $global_user_id;
#zaenkrat samo za podatke in par analiz
- $podstran = (isset($_REQUEST['podstran']) && ($_REQUEST['podstran'] == A_COLLECT_DATA || $_REQUEST['podstran'] == A_ANALYSIS ))
- ? $_REQUEST['podstran']
- : 'data';
- $m = (isset($_REQUEST['m']))
- ? $_REQUEST['m']
- : '';
+ $podstran = (isset($_REQUEST['podstran']) && ($_REQUEST['podstran'] == A_COLLECT_DATA || $_REQUEST['podstran'] == A_ANALYSIS || $_REQUEST['podstran'] == 'data_nijz')) ? $_REQUEST['podstran'] : 'data';
+
+ $m = (isset($_REQUEST['m'])) ? $_REQUEST['m'] : '';
# polovimo trenutno nastavljene profile
SurveyUserSetting::getInstance()->Init($this->_anketa, $global_user_id);
@@ -244,8 +241,8 @@ class SurveyUrlLinks
function saveRefresh() {
$hashUrl = new HashUrl($this->_anketa);
- $hash = $_REQUEST['hash'];
- $refresh = $_REQUEST['refresh'];
+ $hash = isset($_REQUEST['hash']) ? $_REQUEST['hash'] : null;
+ $refresh = isset($_REQUEST['refresh']) ? $_REQUEST['refresh'] : null;
$hashUrl->updateRefresh($hash,$refresh);
}
@@ -253,8 +250,9 @@ class SurveyUrlLinks
function saveAccessPassword() {
$hashUrl = new HashUrl($this->_anketa);
- $hash = $_REQUEST['hash'];
- $pass = $_REQUEST['access_password'];
+ $hash = isset($_REQUEST['hash']) ? $_REQUEST['hash'] : null;
+ $pass = isset($_REQUEST['access_password']) ? $_REQUEST['access_password'] : null;
+ $comment = isset($_REQUEST['comment']) ? $_REQUEST['comment'] : null;
// firefox na koncu vsakega contenteditable doda <br>, ki ga tukaj odstranimo
if (substr($comment, -4) == '<br>') {