replace array fix, proto statesystem parameter exchange

This commit is contained in:
Ulf Gebhardt 2014-11-20 23:32:11 +01:00
parent 01c075f772
commit 69390d4c59
2 changed files with 7 additions and 10 deletions

View File

@ -80,10 +80,10 @@ SYSTEM.prototype.load = function(id){
async: false,
data: {},
dataType: 'html',
url: entry['url'],
url: entry['url']+'&'+window.location.search.substr(1),
success: function(data){
$(entry['div']).html(data);
system.log(system.LOG_INFO,'load page: '+id+entry['div']+' - success');},
system.log(system.LOG_INFO,'load page: '+id+entry['div']+' '+entry['url']+'&'+window.location.search.substr(1)+' - success');},
error: function(XMLHttpRequest, textStatus, errorThrown){system.log(system.LOG_ERROR,errorThrown);}
});
//load css

View File

@ -1,21 +1,18 @@
<?php
namespace SYSTEM\PAGE;
class replace
{
public static function replace($text, $vars){
if(!$vars){
$vars = array();}
$search = array();
$replace = array();
foreach(array_keys($vars) as $var){
$search[] = '/\${'.$var.'}/';}
foreach($vars as $var){
$replace[] = $var;}
foreach($vars as $key=>$value){
if(!is_array($value)){
$search[] = '/\${'.$key.'}/';
$replace[] = $value;}
}
return @preg_replace($search, $replace, $text);
}
public static function replaceFile($path, $vars){