X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=blobdiff_plain;f=application%2Flibraries%2FHtml_head_params.php;h=d729d8822aec20c722a9785b35c498ade607ce2c;hb=09add6ca11db3ca299f73fbc92f4f2d0aed1daa8;hp=6723455578bf8a400487128b77b79a942af3ded1;hpb=2e3f97f19e5cbfb4ba378726dce16d1242e60696;p=living-lab-site.git diff --git a/application/libraries/Html_head_params.php b/application/libraries/Html_head_params.php index 6723455..d729d88 100644 --- a/application/libraries/Html_head_params.php +++ b/application/libraries/Html_head_params.php @@ -5,9 +5,10 @@ * included inside the head tag like: title, stylesheets, scripts and meta * information. * - * The constructor automatically adds the default stylesheet and default script - * if any from 'application/config/p2p-tube.php' so they don't have to be added - * manually. + * The constructor automatically adds the autoload-configured CSSs and JSs + * if any from "application/config/${site_config}.php" so they don't have to be + * added manually. The configuration parameters are: + * 'autoload_css', 'autoload_js'. * * The variables are passed as data in 'application/views/html_begin.php' which * is going to generate the tags based on their information. @@ -27,6 +28,8 @@ class Html_head_params { // Dictionary for meta tags: name => content public $metas; + protected $site_config = 'p2p-tube'; + /** * Initializes member variables with the parameters provided and adds the * default stylesheet to member $css and the default script to @@ -45,7 +48,11 @@ class Html_head_params { { $CI =& get_instance(); $CI->load->helper('url'); - $CI->load->config('p2p-tube'); + + if (isset($this->site_config)) + $CI->load->config($this->site_config); + else + { /* TODO: no site config*/ } if (isset($params['title'])) $this->title = $params['title']; @@ -68,10 +75,10 @@ class Html_head_params { $this->metas = array(); // Default parameters from configuration file - if ($CI->config->item('default_css') != '') - $this->css[] = $CI->config->item('default_css'); - if ($CI->config->item('default_js') != '') - $this->js[] = $CI->config->item('default_js'); + $this->css = array_merge( + $CI->config->item('autoload_css'), $this->css); + $this->js = array_merge( + $CI->config->item('autoload_js'), $this->js); // URL correct prefixes foreach ($this->css as $i => $val)