| | |
| | | if (!empty($this->scripts['docready'])) { |
| | | $this->add_script('$(document).ready(function(){ ' . $this->scripts['docready'] . "\n});", 'foot'); |
| | | } |
| | | |
| | | |
| | | if (is_array($this->script_files['foot'])) { |
| | | foreach ($this->script_files['foot'] as $file) { |
| | | $page_footer .= sprintf($this->script_tag_file, $file); |
| | |
| | | |
| | | // add page hader |
| | | if ($hpos) { |
| | | $output = substr($output,0,$hpos) . $page_header . substr($output,$hpos,strlen($output)); |
| | | $output = substr_replace($output, $page_header, $hpos, 0); |
| | | } |
| | | else { |
| | | $output = $page_header . $output; |
| | |
| | | |
| | | // add page footer |
| | | if (($fpos = strripos($output, '</body>')) || ($fpos = strripos($output, '</html>'))) { |
| | | $output = substr($output, 0, $fpos) . "$page_footer\n" . substr($output, $fpos); |
| | | $output = substr_replace($output, $page_footer."\n", $fpos, 0); |
| | | } |
| | | else { |
| | | $output .= "\n".$page_footer; |
| | |
| | | foreach ($this->css_files as $file) { |
| | | $css .= sprintf($this->link_css_file, $file); |
| | | } |
| | | $output = substr($output, 0, $pos) . $css . substr($output, $pos); |
| | | $output = substr_replace($output, $css, $pos, 0); |
| | | } |
| | | |
| | | $this->base_path = $base_path; |
| | |
| | | echo $hook['content']; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Callback function for preg_replace_callback in write() |
| | | * |