public function parse($vars = null) { $stylesheet = $this->header . parent::parse($vars) . $this->footer; ob_start(); // Opening script tag if ($this->styleTag) { echo $this->openingTag . "\n"; } // Opening CDATA tag if ($this->CDATA) { echo '/*' . '<![CDATA[' . '*/' . "\n"; } echo $stylesheet; // Closing CDATA tag if ($this->CDATA) { echo "\n" . '/*' . ']]>' . '*/'; } // Closing script tag if ($this->styleTag) { echo "\n" . $this->closingTag; } $output = ob_get_contents(); ob_end_clean(); return $output; }
/** * Parses a script file. * * @since 1.0 * @access public * @param string * @return */ public function parse($vars = null) { // Pass to the parent to process the theme file $vars = parent::parse($vars); $script = $this->header . $vars . $this->footer; // Do not reveal root folder path. $file = str_ireplace(SOCIAL_JOOMLA, '', $this->file); // Replace \ with / to avoid javascript syntax errors. $file = str_ireplace('\\', '/', $file); $cdata = $this->CDATA; $scriptTag = $this->scriptTag; $safeExecution = $this->safeExecution; ob_start(); include SOCIAL_MEDIA . '/scripts/template.php'; $contents = ob_get_contents(); ob_end_clean(); return $contents; }