From 623c65e2752fcb71295689eaea0b9c74cf810cc7 Mon Sep 17 00:00:00 2001 From: Thomas Mudrunka Date: Wed, 27 Jul 2011 03:57:00 +0200 Subject: [PATCH] Nyni muze assistent obsahovat vic kroku adresovatelnych pres URL --- assistants/new-item.inc.php | 1 + index.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/assistants/new-item.inc.php b/assistants/new-item.inc.php index bd0aedb..01036ba 100644 --- a/assistants/new-item.inc.php +++ b/assistants/new-item.inc.php @@ -1,3 +1,4 @@ render_form_add('model'); echo $this->render_form_add('item'); diff --git a/index.php b/index.php index 8d6ff14..0b33337 100755 --- a/index.php +++ b/index.php @@ -445,10 +445,11 @@ class Sklad_UI { die(); } - function safe_include($dir,$name,$ext='.inc.php') { + function safe_include($dir,$name,$vars=array(),$ext='.inc.php') { if(preg_match('/[^a-zA-Z0-9-]/',$name)) die(trigger_error('SAFE INCLUDE: Securityfuck.')); $filename="$dir/$name$ext"; if(!is_file($filename)) die(trigger_error('SAFE INCLUDE: Fuckfound.')); + foreach($vars as $var => $val) $$var=$val; ob_start(); include($filename); $out=ob_get_contents(); @@ -529,7 +530,8 @@ class Sklad_UI { die('Tell me why you cry'); break; case 'assistant': //assistant - echo $this->safe_include(DIR_ASSISTANTS,$PATH_CHUNKS[2]); + $assistant_vars['step'] = isset($PATH_CHUNKS[3]) && is_numeric($PATH_CHUNKS[3]) ? trim($PATH_CHUNKS[3]) : false; + echo $this->safe_include(DIR_ASSISTANTS,$PATH_CHUNKS[2],$assistant_vars); break; default: //? $search = (isset($_GET['q']) && trim($_GET['q']) != '') ? trim($_GET['q']) : false; -- 2.30.2