Index: common_helper.php =================================================================== --- common_helper.php (revision 11289) +++ common_helper.php (working copy) @@ -8036,6 +8036,22 @@ echo getHeader(); } +function addToJsAdminIncludes($addedfile) +{ + $CI =& get_instance(); + $js_admin_includes = $CI->config->item("js_admin_includes"); + $js_admin_includes[] = $addedfile; + $CI->config->set_item("js_admin_includes", array_unique($js_admin_includes)); +} + +function addToCssAdminIncludes($addedfile) +{ + $CI =& get_instance(); + $css_admin_includes = $CI->config->item("css_admin_includes"); + $css_admin_includes[] = $addedfile; + $CI->config->set_item("css_admin_includes", array_unique($css_admin_includes)); +} + /** * This function returns the header for the printable survey * @return String Index: frontend_helper.php =================================================================== --- frontend_helper.php (revision 11289) +++ frontend_helper.php (working copy) @@ -135,7 +135,7 @@ $js_header_includes[] = '/scripts/jquery/jquery-ui.js'; $CI->config->set_item("js_admin_includes", $js_admin_includes); - $css_admin_includes = $CI->config->item("js_admin_includes"); + $css_admin_includes = $CI->config->item("css_admin_includes"); $css_header_includes[]= '/scripts/jquery/css/start/jquery-ui.css'; $css_header_includes[]= '/scripts/jquery/css/start/lime-progress.css'; $CI->config->set_item("css_admin_includes", $css_admin_includes); Index: qanda_helper.php =================================================================== --- qanda_helper.php (revision 11289) +++ qanda_helper.php (working copy) @@ -1670,7 +1670,7 @@ if (trim($aQuestionAttributes['time_limit'])!='') { - $js_header_includes[] = '/scripts/coookies.js'; + addToJsAdminIncludes('/scripts/coookies.js'); $answer .= return_timer_script($aQuestionAttributes, $ia); } @@ -1733,8 +1733,8 @@ $answer .= "\n\n"; $inputnames[]=$ia[1]; if($aQuestionAttributes['slider_rating']==1){ - $css_header_includes[]= '/admin/scripts/rating/jquery.rating.css'; - $js_header_includes[]='/admin/scripts/rating/jquery.rating.js'; + addToCssAdminIncludes('/scripts/admin/rating/jquery.rating.css'); + addToJsAdminIncludes('/scripts/admin/rating/jquery.rating.js'); $answer.='

'; $answer.=" "; - } } //just added these here so its easy to change in one place $errorClass = 'tip problem'; @@ -5108,13 +5103,13 @@
"; if ($aQuestionAttributes['location_mapservice']==1 && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off") - $js_header_includes[] = "https://maps.googleapis.com/maps/api/js?sensor=false"; + addToJsAdminIncludes('https://maps.googleapis.com/maps/api/js?sensor=false'); else if ($aQuestionAttributes['location_mapservice']==1) - $js_header_includes[] = "http://maps.googleapis.com/maps/api/js?sensor=false"; - elseif ($aQuestionAttributes['location_mapservice']==2) - $js_header_includes[] = "http://www.openlayers.org/api/OpenLayers.js"; + addToJsAdminIncludes('http://maps.googleapis.com/maps/api/js?sensor=false'); + elseif ($aQuestionAttributes['location_mapservice']==2) + addToJsAdminIncludes('http://www.openlayers.org/api/OpenLayers.js'); - if (isset($aQuestionAttributes['hide_tip']) && $aQuestionAttributes['hide_tip']==0) + if (isset($aQuestionAttributes['hide_tip']) && $aQuestionAttributes['hide_tip']==0) { $answer .= "
\n" . $clang->gT('Drag and drop the pin to the desired location. You may also right click on the map to move the pin.').''; @@ -5134,7 +5129,7 @@ if (trim($aQuestionAttributes['time_limit'])!='') { - $js_header_includes[] = '/scripts/coookies.js'; + addToJsAdminIncludes('/scripts/coookies.js'); $answer .= return_timer_script($aQuestionAttributes, $ia, "answer".$ia[1]); } @@ -5232,7 +5227,7 @@ if (trim($aQuestionAttributes['time_limit'])!='') { - $js_header_includes[] = '/scripts/coookies.js'; + addToJsAdminIncludes('/scripts/coookies.js'); $answer .= return_timer_script($aQuestionAttributes, $ia, "answer".$ia[1]); } @@ -5313,7 +5308,7 @@ if (trim($aQuestionAttributes['time_limit']) != '') { - $js_header_includes[] = '/scripts/coookies.js'; + addToJsAdminIncludes('/scripts/coookies.js'); $answer .= return_timer_script($aQuestionAttributes, $ia, "answer".$ia[1]); }