From e1ceb050e19c7574bca146a8da7047ee4ff456b5 Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Sun, 10 Jul 2016 05:02:35 -0400
Subject: [PATCH] Merge branch 'stable-3.1'

---
 interface/web/tools/tpl_default.php |   78 +++++---------------------------------
 1 files changed, 11 insertions(+), 67 deletions(-)

diff --git a/interface/web/tools/tpl_default.php b/interface/web/tools/tpl_default.php
index fb13b66..dacbeae 100644
--- a/interface/web/tools/tpl_default.php
+++ b/interface/web/tools/tpl_default.php
@@ -28,81 +28,25 @@
 */
 
 
-/******************************************
-* Begin Form configuration
-******************************************/
+global $app, $conf;
 
-$tform_def_file = "form/tpl_default.tform.php";
-
-/******************************************
-* End Form configuration
-******************************************/
-
-require_once('../../lib/config.inc.php');
-require_once('../../lib/app.inc.php');
+require_once '../../lib/config.inc.php';
+require_once '../../lib/app.inc.php';
 
 //* Check permissions for module
 $app->auth->check_module_permissions('tools');
 
-// Loading classes
-$app->uses('tpl,tform,tform_actions');
-$app->load('tform_actions');
+$app->uses('tpl');
 
-class page_action extends tform_actions {
-	
-	function onLoad() {
-                global $app, $conf, $tform_def_file;
+$app->tpl->newTemplate('listpage.tpl.htm');
+$app->tpl->setInclude('content_tpl', 'templates/tpl_default.htm');
 
-                // Loading template classes and initialize template
-                if(!is_object($app->tpl)) $app->uses('tpl');
-                if(!is_object($app->tform)) $app->uses('tform');
+$lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_tpl_default.lng';
+include $lng_file;
 
-                $app->tpl->newTemplate("tabbed_form.tpl.htm");
+$app->tpl->setVar($wb);
 
-                // Load table definition from file
-                $app->tform->loadFormDef($tform_def_file);
-				
-				// Importing ID
-                $this->id = $_SESSION['s']['user']['userid'];
-		$_POST['id'] = $_SESSION['s']['user']['userid'];
-
-                if(count($_POST) > 1) {
-                        $this->dataRecord = $_POST;
-                        $this->onSubmit();
-                } else {
-                        $this->onShow();
-                }
-        }
-        
-	function onBeforeInsert() {
-		global $app, $conf;
-		
-		if(!in_array($this->dataRecord['startmodule'],$this->dataRecord['modules'])) {
-			$app->tform->errorMessage .= $app->tform->wordbook['startmodule_err'];
-		}
-	}
-        
-	function onInsert() {
-		die('No inserts allowed.');
-	}
-		
-	function onBeforeUpdate() {
-		global $app, $conf;
-		
-		if($conf['demo_mode'] == true && $this->id <= 3) $app->tform->errorMessage .= 'This function is disabled in demo mode.';
-		
-		$_SESSION['s']['user']['language'] = $_POST['language'];
-		$_SESSION['s']['language'] = $_POST['language'];
-                
-                if(@is_array($this->dataRecord['modules']) && !in_array($this->dataRecord['startmodule'],$this->dataRecord['modules'])) {
-			$app->tform->errorMessage .= $app->tform->wordbook['startmodule_err'];
-		}
-	}
-	
-	
-}
-
-$page = new page_action;
-$page->onLoad();
+$app->tpl_defaults();
+$app->tpl->pparse();
 
 ?>

--
Gitblit v1.9.1