replace array fix, proto statesystem parameter exchange
This commit is contained in:
parent
01c075f772
commit
69390d4c59
@ -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
|
||||
|
||||
@ -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){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user