function render() { // get a list with all the global template sets $ts = new TemplateSets(); $globalTemplates = $ts->getGlobalTemplateSets(); $this->setValue("templates", $globalTemplates); $defaultTs = $ts->getDefaultTemplateSet(); $this->setValue("defaultTemplate", $defaultTs->getName()); parent::render(); }
/** * returns a TemplateSet object with the information about the template used * by the blog * * @return a TemplateSet object */ function getTemplateSet() { // since including these files is quite a costly operation, let's do it only // whenever we have to instead of always and always always... :) if ($this->_templateSet == null) { include_once PLOG_CLASS_PATH . "class/template/templatesets/templatesets.class.php"; $ts = new TemplateSets(); $this->_templateSet = $ts->getTemplateSet($this->getTemplate(), $this->getId()); if ($this->_templateSet == null) { // what if the admin removes the current template set used by this blog??? $this->_templateSet = $ts->getDefaultTemplateSet(); } } return $this->_templateSet; }