dom = $dom; } /** * Adds a javascript blob to this template * * @param unknown_type $script */ public function addScript(TemplateLibraryContent $script) { $this->script[] = $script; } /** * Adds a style blob to this template * * @param unknown_type $style */ public function addStyle(TemplateLibraryContent $style) { $this->style[] = $style; } /** * Returns the (combined, in inclusion order) script text blob, or * false if there's no javascript for this template * * @return javascript string or false */ public function getScript() { $ret = ''; foreach ($this->script as $script) { if (! $script->included) { $ret .= $script->content . "\n"; } } return ! empty($ret) ? $ret : false; } /** * Returns the (combined, in inclusion order) stylesheet text blob, or * false if there's no style sheet associated with this template * * @return javascript string or false */ public function getStyle() { $ret = ''; foreach ($this->style as $style) { if (! $style->included) { $ret .= $style->content . "\n"; } } return ! empty($ret) ? $ret : false; } }