Exemplo n.º 1
0
	protected function doRender($tpl, $base = null)
	{
		$theme = CoOrg::getTheme();
		if ($theme != 'default')
		{
			$file = $this->_viewsPath.$theme.'/'.$tpl.'.html.tpl';
			if (!file_exists($file))
			{
				$file = $this->_viewsPath.'default/'.$tpl.'.html.tpl';
			}
		}
		else
		{
			$file = $this->_viewsPath.'default/'.$tpl.'.html.tpl';
		}
		if ($base)
		{
			$tpl = $this->_smarty->createTemplate('extends:'.$base.'|'.$file, $this->_data);
		}
		else
		{
			$tpl = $this->_smarty->createTemplate($file, $this->_data);
		}
		return $tpl->fetch();
	}
Exemplo n.º 2
0
	public static function getTemplatePath($tpl, $module)
	{
		if (in_array($module, CoOrg::config()->get('enabled_plugins')))
		{
			$basepath = 'plugins/'.$module.'/views/';
		}
		else
		{
			$basepath = 'app/'.$module.'/views/';
		}
		$theme = CoOrg::getTheme();
		if ($theme != 'default')
		{	
			if (file_exists($basepath.$theme.'/'.$tpl))
			{
				$path = $basepath.$theme.'/';
			}
			else
			{
				$path = $basepath.'default/';
			}
		}
		else
		{
			$path = $basepath.'default/';
		}
		return $path.$tpl;
	}