Changeset 20755
- Timestamp:
- 03/02/09 23:35:23 (2 years ago)
- Files:
-
- trunk/midcom/midcom_core/configuration/defaults.yml (modified) (1 diff)
- trunk/midcom/midcom_core/helpers/head.php (modified) (3 diffs)
- trunk/midcom/midcom_core/midcom.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom_core/configuration/defaults.yml
r20616 r20755 19 19 enable_included_list: false 20 20 enable_jquery_framework: true 21 jquery_load_from_google: true 21 22 enable_js_midcom: false 22 23 enable_uimessages: false trunk/midcom/midcom_core/helpers/head.php
r19573 r20755 18 18 private $link_head_urls = array(); 19 19 private $meta_head = array(); 20 private $configuration = null; 20 21 21 22 private $js_head = array(); … … 35 36 public $jsmidcom_enabled = false; 36 37 37 public function __construct($enable_jquery = false, $enable_jsmidcom = false, $jsmidcom_config = null) 38 { 39 if ($enable_jquery) 38 public function __construct(&$configuration) 39 { 40 $this->configuration = $configuration; 41 if ($this->configuration->enable_jquery_framework) 40 42 { 41 43 $this->enable_jquery(); 42 44 } 43 45 44 if ($ enable_jsmidcom)45 { 46 $this->enable_jsmidcom($ jsmidcom_config);46 if ($this->configuration->enable_js_midcom) 47 { 48 $this->enable_jsmidcom($this->configuration->js_midcom_config); 47 49 } 48 50 } … … 55 57 } 56 58 57 $url = MIDCOM_STATIC_URL . "/midcom_core/jQuery/jquery-{$version}.js"; 58 $this->jquery_inits = "<script type=\"text/javascript\" src=\"{$url}\"></script>\n"; 59 if ($this->configuration->jquery_load_from_google) 60 { 61 // Let Google host jQuery for us 62 $this->jquery_inits = "<script src=\"http://www.google.com/jsapi\"></script>\n"; 63 $this->jquery_inits .= "<script>\n"; 64 $this->jquery_inits .= " google.load('jquery', '{$version}');\n"; 65 $this->jquery_inits .= "</script>\n"; 66 } 67 else 68 { 69 // Load from a locally installed PEAR package 70 $url = MIDCOM_STATIC_URL . "/midcom_core/jQuery/jquery-{$version}.js"; 71 $this->jquery_inits = "<script type=\"text/javascript\" src=\"{$url}\"></script>\n"; 72 } 59 73 60 74 $script = 'var $j = jQuery.noConflict();'."\n"; trunk/midcom/midcom_core/midcom.php
r20620 r20755 60 60 61 61 // Load the head helper 62 $this->head = new midcom_core_helpers_head 63 ( 64 $this->configuration->enable_jquery_framework, 65 $this->configuration->enable_js_midcom, 66 $this->configuration->js_midcom_config 67 ); 62 $this->head = new midcom_core_helpers_head($this->configuration); 68 63 } 69 64
