Changeset 9580 for trunk/include/template.class.php
- Timestamp:
- Mar 9, 2011, 11:17:14 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r9559 r9580 659 659 if ( !empty($content) ) 660 660 { // second call 661 $this->scriptLoader->add_inline( $content, @$params['require'] ); 661 $this->scriptLoader->add_inline( 662 $content, 663 empty($params['require']) ? array() : explode(',', $params['require']) 664 ); 662 665 } 663 666 } … … 935 938 if(!empty($require)) 936 939 { 937 if(!isset($this->registered_scripts[$require])) 938 fatal_error("inline script not found require $require"); 939 $s = $this->registered_scripts[$require]; 940 if($s->load_mode==2) 941 $s->load_mode=1; // until now the implementation does not allow executing inline script depending on another async script 940 foreach ($require as $id) 941 { 942 if(!isset($this->registered_scripts[$id])) 943 $this->load_known_required_script($id, 1) or fatal_error("inline script not found require $id"); 944 $s = $this->registered_scripts[$id]; 945 if($s->load_mode==2) 946 $s->load_mode=1; // until now the implementation does not allow executing inline script depending on another async script 947 } 942 948 } 943 949 $this->inline_scripts[] = $code; … … 974 980 foreach (self::$ui_core_dependencies as $script_id => $required_ids) 975 981 $this->add($script_id, $load_mode, $required_ids, null, $version); 982 } 983 984 // Try to load undefined required script 985 foreach ($script->precedents as $script_id) 986 { 987 if (! isset( $this->registered_scripts[$script_id] ) ) 988 $this->load_known_required_script($script_id, $load_mode); 976 989 } 977 990 } … … 1114 1127 1115 1128 if ( empty($script->path) ) 1116 $script->path = dirname(self::$known_paths['jquery. ui'])."/$id.min.js";1129 $script->path = dirname(self::$known_paths['jquery.effects'])."/$id.min.js"; 1117 1130 } 1118 1131 … … 1123 1136 } 1124 1137 } 1138 } 1139 1140 private function load_known_required_script($id, $load_mode) 1141 { 1142 if ( isset(self::$known_paths[$id]) or strncmp($id, 'jquery.ui.', 10)==0 or strncmp($id, 'jquery.effetcs.', 15)==0 ) 1143 { 1144 $this->add($id, $load_mode, array(), null); 1145 return true; 1146 } 1147 return false; 1125 1148 } 1126 1149
Note: See TracChangeset
for help on using the changeset viewer.