SplitParamsStr($params_str);
}
/**
* Splits tag params into associative array
*
* @param string $params_str
* @access private
*/
function SplitParamsStr($params_str)
{
preg_match_all('/([\${}a-zA-Z0-9_.]+)=(["\']{1,1})(.*?)(? $val){
$values[$val[1]] = str_replace('\\' . $val[2], $val[2], $val[3]);
}
$this->AddParams($values);
}
/**
* Sets new parameter value
*
* @param string $name
* @param string $val
* @access public
*/
function Set($name, $val)
{
//echo "sessing params: [$name] = [$val] (class: ".get_class($this).")
";
// $this->_Params[strtolower($name)] = $val;
$this->_Params[$name] = $val;
}
/**
* Removes parameter
*
* @param string $name
* @access public
*/
function Remove($name)
{
unset($this->_Params[$name]);
}
/**
* Gets parameter value by parameter name
*
* @param string $name
* @param int $mode
* @return string
* @access public
*/
function Get($name, $mode=FALSE_ON_NULL)
{
// echo " name : '$name' || mode : $mode
";
//$name = strtolower($name);
if (array_key_exists($name, $this->_Params))
return $this->_Params[$name];
else
return $mode == FALSE_ON_NULL ? false : '';
}
/**
* Mass parameter setting from hash
*
* @param Array $params
* @access public
*/
function AddParams($params)
{
if (!is_array($params)) return;
/*if (count($this->_Params) == 0) {
$this->_Params = $params;
}
else {*/
foreach ($params as $name => $val)
// $this->Set(strtolower($name), $val);
$this->Set($name, $val);
//}
}
/**
* Return all paramters as hash
*
* @return Array
* @access public
*/
function GetParams()
{
return $this->_Params;
}
}
class kArray extends kBase {
var $_Array;
/**
* Returns array value with any deep key
*
* @return mixed
* @todo array_unshift doesn't accept parameters by reference, fix it's usage in this method
*/
function GetArrayValue()
{
$args = func_get_args();
array_unshift_ref($args, $this->_Array);
return call_user_func_array('getArrayValue', $args);
}
function SetArrayValue()
{
$args = func_get_args();
$value = array_pop($args);
$arr =& $this->_Array;
for ($i=0; $i