From c4a081a32fbde7ec29a59f77c1704f2a630f92f5 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 18 Jan 2010 08:47:35 +0000 Subject: [PATCH] Updated filter and listing class. -Allow to load xml/tpl files from the themes too. Enables global usable lists like the 'baseSelectDialog'. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15164 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_filter.inc | 10 +++++++++- gosa-core/include/class_listing.inc | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gosa-core/include/class_filter.inc b/gosa-core/include/class_filter.inc index 6a6a4216e..efd72574e 100644 --- a/gosa-core/include/class_filter.inc +++ b/gosa-core/include/class_filter.inc @@ -351,8 +351,16 @@ class filter { $smarty->assign("$tag", $htmlCode); } + // Try to load template from plugin the folder first... + $file = get_template_path($this->xmlData['definition']['template'], true); + + // ... if this fails, try to load the file from the theme folder. + if(!file_exists($file)){ + $file = get_template_path($this->xmlData['definition']['template']); + } + // Load template - return ("".$smarty->fetch(get_template_path($this->xmlData['definition']['template'], true))); + return ("".$smarty->fetch($file)); } diff --git a/gosa-core/include/class_listing.inc b/gosa-core/include/class_listing.inc index a9c218123..9001f584a 100644 --- a/gosa-core/include/class_listing.inc +++ b/gosa-core/include/class_listing.inc @@ -447,7 +447,15 @@ class listing { // Assign summary $smarty->assign("HEADLINE", $this->headline); - return ($smarty->fetch(get_template_path($this->xmlData['definition']['template'], true))); + // Try to load template from plugin the folder first... + $file = get_template_path($this->xmlData['definition']['template'], true); + + // ... if this fails, try to load the file from the theme folder. + if(!file_exists($file)){ + $file = get_template_path($this->xmlData['definition']['template']); + } + + return ($smarty->fetch($file)); } -- 2.30.2