Skip to content

Commit

Permalink
introducing showFullPath var (issue simogeo#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
simogeo committed Oct 7, 2010
1 parent 6837413 commit c1a579b
Show file tree
Hide file tree
Showing 18 changed files with 1,747 additions and 1,666 deletions.
97 changes: 25 additions & 72 deletions connectors/lasso/client_params.inc
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,77 +1,30 @@
[//lasso
// create a single array of both get and post params
define_tag(
'params',
-namespace='client_',
-priority='replace',
-description='Returns an array that is a combination of [client_getparams] and [client_postparams].'
);
local('out') = array;
#out->merge(client_getparams);
#out->merge(client_postparams);
return(#out);
/define_tag;
[//lasso // create a single array of both get and post params
define_tag( 'params', -namespace='client_', -priority='replace',
-description='Returns an array that is a combination of
[client_getparams] and [client_postparams].' ); local('out') = array;
#out->merge(client_getparams); #out->merge(client_postparams);
return(#out); /define_tag; define_tag( 'param', -namespace='client_',
-req='param', -opt='count', -opt='explode', -priority='replace',
-description='Equivalent of [action_param], only for [client_params].
Safe to use inside inlines.' ); local('out') = string; local('key') =
#param; if(params >> '-count'); #out = client_params->find(#key)->size;

define_tag(
'param',
-namespace='client_',
-req='param',
-opt='count',
-opt='explode',
-priority='replace',
-description='Equivalent of [action_param], only for [client_params]. Safe to use inside inlines.'
);
local('out') = string;
local('key') = #param;

if(params >> '-count');
#out = client_params->find(#key)->size;

else(params >> '-explode');
#out = array;
local('matches') = client_params->find(#key);

if(#matches->size > 1);
iterate(#matches, local('i'));
#i->isa('pair') ? #out->insert(#i->second) | #out->insert(#i);
/iterate;

else(#matches->size);
#matches->first->isa('pair') ? #out->insert(#matches->first->second) | #out->insert(#matches->first);

/if;

else(params->size >= 2 && params->get(2)->isa('integer'));
local('index') = params->get(2);

if(client_params->find(#key)->size >= #index);
#out = client_params->find(#key)->get(#index)->second;
else(params >> '-explode'); #out = array; local('matches') =
client_params->find(#key); if(#matches->size > 1); iterate(#matches,
local('i')); #i->isa('pair') ? #out->insert(#i->second) |
#out->insert(#i); /iterate; else(#matches->size);
#matches->first->isa('pair') ? #out->insert(#matches->first->second) |
#out->insert(#matches->first); /if; else(params->size >= 2 &&
params->get(2)->isa('integer')); local('index') = params->get(2);

else;
#out = '';

/if;
else;
local('matches') = client_params->find(#key);

if(#matches->size > 1);
iterate(#matches, local('i'));
#out += (#i->isa('pair') ? (#i->second + '\r') | (#i + '\r'));
/iterate;

else(#matches->size);
#out = (#matches->first->isa('pair') ? #matches->first->second | #matches->first);

else;
#out = '';
/if;

/if;

return(#out);
/define_tag;
if(client_params->find(#key)->size >= #index); #out =
client_params->find(#key)->get(#index)->second; else; #out = ''; /if;
else; local('matches') = client_params->find(#key); if(#matches->size >
1); iterate(#matches, local('i')); #out += (#i->isa('pair') ?
(#i->second + '\r') | (#i + '\r')); /iterate; else(#matches->size); #out
= (#matches->first->isa('pair') ? #matches->first->second |
#matches->first); else; #out = ''; /if; /if; return(#out); /define_tag;



/* SVN $Id: client_params.inc 582 2008-02-21 16:22:11Z Jason Huck $ */
]
/* SVN $Id: client_params.inc 582 2008-02-21 16:22:11Z Jason Huck $ */ ]
Loading

0 comments on commit c1a579b

Please sign in to comment.