Expand name even if not in a row ([...])

This commit is contained in:
Nathan Gray 2012-03-29 15:13:56 +00:00
parent cedb8e3f6c
commit 545ffcf34e

View File

@ -204,7 +204,7 @@ var et2_arrayMgr = Class.extend({
// Check whether "$" occurs in the given identifier // Check whether "$" occurs in the given identifier
var pos_var = _ident.indexOf('$'); var pos_var = _ident.indexOf('$');
if (pos_var >= 0 && this.perspectiveData.row != null) if (pos_var >= 0 && (this.perspectiveData.row != null || !_ident.match(/\$\{?row\}?/)))
{ {
// Get the content array for the current row // Get the content array for the current row
var row = this.perspectiveData.row; var row = this.perspectiveData.row;
@ -218,10 +218,19 @@ var et2_arrayMgr = Class.extend({
if (typeof proto.compiledExpressions[_ident] == "undefined") if (typeof proto.compiledExpressions[_ident] == "undefined")
{ {
try try
{
if(this.perspectiveData.row == null)
{
// No row, compile for only top level content
proto.compiledExpressions[_ident] = et2_compilePHPExpression(
_ident, ["cont"]);
}
else
{ {
proto.compiledExpressions[_ident] = et2_compilePHPExpression( proto.compiledExpressions[_ident] = et2_compilePHPExpression(
_ident, ["row", "cont", "row_cont"]); _ident, ["row", "cont", "row_cont"]);
} }
}
catch(e) catch(e)
{ {
proto.compiledExpressions[_ident] = null; proto.compiledExpressions[_ident] = null;
@ -235,9 +244,17 @@ var et2_arrayMgr = Class.extend({
if (proto.compiledExpressions[_ident]) if (proto.compiledExpressions[_ident])
{ {
try try
{
if(this.perspectiveData.row == null)
{
// No row, exec with only top level content
_ident = proto.compiledExpressions[_ident](cont);
}
else
{ {
_ident = proto.compiledExpressions[_ident](row, cont, row_cont); _ident = proto.compiledExpressions[_ident](row, cont, row_cont);
} }
}
catch(e) catch(e)
{ {
egw.debug("error", e); egw.debug("error", e);