Browse Source

Minor template fixes

Julio Montoya 13 years ago
parent
commit
9125cca059

+ 6 - 3
main/inc/lib/sortabletable.class.php

@@ -204,12 +204,15 @@ class SortableTable extends HTML_Table {
 		}
 		return $this->pager;
 	}
-
+	
+	public function display() {
+		echo $this->return_table();
+	}
 	/**
 	 * Displays the table, complete with navigation buttons to browse through
 	 * the data-pages.
 	 */
-	public function display() {
+	public function return_table() {
 		$empty_table = false;
 		$content = $this->get_table_html();
 		
@@ -294,7 +297,7 @@ class SortableTable extends HTML_Table {
 				$html .= '</form>';
 			}
 		}
-		echo $html;
+		return $html;
 	}
 
 	/**

+ 5 - 4
main/inc/lib/template.lib.php

@@ -13,13 +13,16 @@ class Template extends Smarty {
 	function __construct($title = '') {
 		$this->title = $title;
 		
+		//Smarty 3 configuration
 		$this->setPluginsDir(api_get_path(LIBRARY_PATH).'smarty/plugins');
 		$this->setCacheDir(api_get_path(SYS_ARCHIVE_PATH));
 		$this->setCompileDir(api_get_path(SYS_ARCHIVE_PATH));
 		$this->setTemplateDir(api_get_path(SYS_CODE_PATH).'template/');
 		$this->setConfigDir(api_get_path(SYS_ARCHIVE_PATH));
 		
+		//Caching settings
 		$this->caching 			= true;
+		//$this->caching = Smarty::CACHING_LIFETIME_CURRENT;		
 		$this->cache_lifetime 	= Smarty::CACHING_OFF; // no caching
 		//$this->cache_lifetime 	= 120;
 		
@@ -27,12 +30,10 @@ class Template extends Smarty {
 		$this->set_footer(true);
 		$this->set_header(true);
 		
-		$this->set_system_parameters();
+		$this->set_system_parameters();		
 		
 		$this->set_user_parameters();
 		
-		
-		
 		$this->set_header_parameters();		
 		
 		$this->set_footer_parameters();	
@@ -45,7 +46,7 @@ class Template extends Smarty {
 		//To load a smarty plugin				
 		//$this->loadPlugin('smarty_function_get_lang');
 
-		//$this->caching = Smarty::CACHING_LIFETIME_CURRENT;				
+				
 		$this->assign('style', $this->style);	
 		//$this->testInstall();	
 	}

+ 6 - 1
main/template/default/layout/layout_1_col.tpl

@@ -6,7 +6,12 @@
 	{/if}	
 {/block}
 
-{block name=body}	
+{block name=body}
+	{if (!empty($actions) ) }
+		<div class="actions">
+		{$actions}	
+		</div>
+	{/if}
 	{$message}
 	{$content}
 {/block}