Nyni muze assistent obsahovat vic kroku adresovatelnych pres URL
authorThomas Mudrunka <tomas@mudrunka.cz>
Wed, 27 Jul 2011 01:57:00 +0000 (03:57 +0200)
committerThomas Mudrunka <tomas@mudrunka.cz>
Wed, 27 Jul 2011 01:57:00 +0000 (03:57 +0200)
assistants/new-item.inc.php
index.php

index bd0aedb240bd76e99b4058bf43017ecee350934b..01036babe31f175608ed64059c050a57c88c5c6c 100644 (file)
@@ -1,3 +1,4 @@
 <?php
+echo $step;
 echo $this->render_form_add('model');
 echo $this->render_form_add('item');
index 8d6ff1460af8ab9350aea7d8cd06d3772ca7c5bd..0b333376167f26dfbb8a90c2b6b6029d2791cb9e 100755 (executable)
--- 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;
This page took 0.110251 seconds and 4 git commands to generate.