public function getContent($template = false, $replacements = false) { // Check if the first parameter is actually just the collection alias $pos = stripos($template, ContentBuilder::getTemplateExtension()); if ($pos === false || $pos !== strlen($template) - strlen(ContentBuilder::getTemplateExtension())) { //echo 'DEBUG This is NOT a template? '.$template.' Cause pos: '.$pos.' != '.(strlen($template)-strlen(ContentBuilder::getTemplateExtension()))."\n"; $collection_alias = $template; $template = $this->template; //.= '.'.ContentBuilder::getTemplateExtension(); } else { $collection_alias = substr($template, 0, -strlen(ContentBuilder::getTemplateExtension())); } //echo 'DEBUG collection alias: '.$collection_alias."\n"; // We need to know the collection alias in order to determine the set of slides (aka the "slide collection") to work with if (!$template) { $template = $this->template; } $slides = $this->getSlides($this->slides_subpath); //echo 'DEBUG slides<pre>'; //print_r($slides); //echo '</pre>'; if (count($slides) > 1) { // We need to make the slide paths webroot-relative if (self::$slides_webpath) { foreach ($slides as &$s) { $s = self::$slides_webpath . ($this->slides_subpath ? $this->slides_subpath . DIRECTORY_SEPARATOR : '') . $s; } } $replacements['slides'] = $slides; return self::$cb->getContent($template, $replacements); } else { return false; } }