diff --git a/application/controllers/UploaderController.php b/application/controllers/UploaderController.php index d74dcfb..9d9c0b1 100644 --- a/application/controllers/UploaderController.php +++ b/application/controllers/UploaderController.php @@ -240,8 +240,8 @@ class UploaderController extends AdminController { } return; } - - $meta = ''; + $meta .= '\n"; - else - $js_header .= "\n"; - } - } - if(Yii::app()->getConfig("css_admin_includes")) - { - foreach (Yii::app()->getConfig("css_admin_includes") as $cssinclude) - { - $css_header .= "baseUrl.$cssinclude."\" />\n"; - } - } - if ( !$embedded ) { $header= "\n" @@ -7151,14 +7131,7 @@ function getHeader($meta = false) { $header.=" dir=\"rtl\" "; } - $header.= ">\n\t\n" - . $css_header - . "\n" - . "\n" - . "getConfig('generalscripts')."jquery/css/start/jquery-ui.css\" media=\"all\" type=\"text/css\" rel=\"stylesheet\" />" - . "getConfig('generalscripts')."jquery/css/start/lime-progress.css\" media=\"all\" type=\"text/css\" rel=\"stylesheet\" />" - . $js_header; - + $header.= ">\n\t\n"; if ($meta) $header .= $meta; diff --git a/application/helpers/replacements_helper.php b/application/helpers/replacements_helper.php index 70d6a86..8c8b00e 100644 --- a/application/helpers/replacements_helper.php +++ b/application/helpers/replacements_helper.php @@ -122,14 +122,66 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de if(!isset($templatedir)) $templatedir = getTemplatePath($templatename); if(!isset($templateurl)) $templateurl = getTemplateURL($templatename)."/"; - if (stripos ($line,"")) + // TEMPLATECSS and TEMPLATEJS + $_templatecss="";$_templatejs=""; + if(stripos ($line,"{TEMPLATECSS}")) { - $line=str_ireplace("", - "\n" - .useFirebug() - ."\t", $line); + global $css_header_includes; + if (file_exists($templatedir . '/jquery-ui-custom.css')) + { + $_jqueryuicssurl = "{$templateurl}jquery-ui-custom.css"; + } + elseif(file_exists($templatedir . '/jquery-ui.css')) + { + $_jqueryuicssurl = "{$templateurl}jquery-ui.css"; + } + else + { + $_jqueryuicssurl =Yii::app()->getConfig('generalscripts')."jquery/css/start/jquery-ui.css"; + } + $_templatecss.= "\n"; + if(Yii::app()->getConfig("css_admin_includes")) + { + foreach (Yii::app()->getConfig("css_admin_includes") as $cssinclude) + { + $css_header .= "\n"; + } + } + $_templatecss .= "\n"; + if($css_header_includes){ + $css_header_includes = array_unique($css_header_includes); + foreach ($css_header_includes as $cssinclude) + { + $_templatecss .= "\n"; + } + } + $_templatecss.= "\n"; + if (getLanguageRTL($clang->langcode)) + { + $_templatecss.="\n"; + } } + if(stripos ($line,"{TEMPLATEJS}")) + { + global $js_header_includes; + $_jqueryuijsurl=Yii::app()->getConfig('generalscripts')."jquery/jquery-ui.js"; + $_templatejs.= "\n"; + $_templatejs.= "\n"; + if($js_header_includes){ + $js_header_includes = array_unique($js_header_includes); + foreach ($js_header_includes as $jsinclude) + { + if (substr($jsinclude,0,4) == 'http') + $_templatejs .= "\n"; + else + $_templatejs .= "\n"; + } + } + $_templatejs.= "\n"; + $_templatejs.= "\n"; + $_templatejs.= useFirebug(); + } // surveyformat if (isset($thissurvey['format'])) { @@ -402,11 +454,7 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de $_saveall = ""; } - $_templatecss = "\n"; - if (getLanguageRTL($clang->langcode)) - { - $_templatecss.="\n"; - } + if(!isset($help)) $help = ""; if (flattenText($help, true,true) != '') @@ -776,6 +824,7 @@ EOD; $coreReplacements['SURVEYLISTHEADING'] = (isset($surveylist))?$surveylist['listheading']:''; $coreReplacements['SURVEYNAME'] = (isset($thissurvey['name']) ? $thissurvey['name'] : ''); $coreReplacements['TEMPLATECSS'] = $_templatecss; + $coreReplacements['TEMPLATEJS'] = $_templatejs; $coreReplacements['TEMPLATEURL'] = $templateurl; $coreReplacements['THEREAREXQUESTIONS'] = $_therearexquestions; if (!$anonymized) $coreReplacements['TOKEN'] = $_token; diff --git a/templates/default/startpage.pstpl b/templates/default/startpage.pstpl index f1c2796..5eda98b 100644 --- a/templates/default/startpage.pstpl +++ b/templates/default/startpage.pstpl @@ -22,7 +22,7 @@ progress-graph .zero, progress-graph .graph, progress-graph .cent { display: none; } - + {TEMPLATEJS} {GOOGLE_ANALYTICS_JAVASCRIPT}