Commit db9c75cf authored by metzlerd's avatar metzlerd
Browse files

Updated to use info style format for block specific settings.

parent 0502f528
......@@ -306,6 +306,8 @@ class FrxDataSource{
$source = '';
$file = '';
$skip = FALSE;
$in_info = FALSE;
$info_text = '';
$tokens = array();
$options = array();
while ($i<$cnt) {
......@@ -316,7 +318,10 @@ class FrxDataSource{
$c = trim($c);
@list($a, $o) = explode('=', $c, 2);
$a = trim($a);
if (($a && $o) || $c == 'END' || $c == 'ELSE' ) {
if (($a && $o) || $c == 'END' || $c == 'ELSE' || $c == 'INFO') {
if ($c != 'INFO' ) {
$in_info = false;
}
switch ($a) {
case 'ACCESS':
$access = trim($o);
......@@ -330,6 +335,9 @@ class FrxDataSource{
case 'ELSE':
$skip = !$skip;
break;
case 'INFO':
$in_info = TRUE;
break;
case 'INCLUDE':
$inc_block = $this->getSQLInclude(trim($o));
if ($inc_block) {
......@@ -337,8 +345,6 @@ class FrxDataSource{
$tokens = array_merge($tokens, $inc_block['tokens']);
}
break;
default:
$options[$a] = $o;
}
}
......@@ -349,7 +355,9 @@ class FrxDataSource{
$file .= "$l\n";
}
if (!$skip) {
if ($in_info) {
if (strpos($l, $comment)!==0 && $l) $info_text .= "$l\n";
} elseif (!$skip) {
if (strpos($l, $comment)!==0 && $l) {
$data .= "$l\n";
}
......@@ -358,6 +366,8 @@ class FrxDataSource{
$i++;
}
$tokens = array_merge($tokens, $this->tokens($contents));
$options = drupal_parse_info_format($info_text);
$block = array( 'source' => $data, 'file' => trim($file, " \n"),
'tokens' => $tokens, 'options' => $options);
if ($access) $block['access'] = $access;
......
......@@ -51,10 +51,10 @@ class FrxDrupal extends FrxDataSource {
* for later querying and XML processing in the
* loadEntitys method
*/
if (@$options['ENTITY_TYPE'] && @$options['ENTITY_ID'] ) {
if (@$options['entity_type'] && @$options['entity_id'] ) {
$id_key = $options['ENTITY_ID'];
$type = $options['ENTITY_TYPE'];
$id_key = $options['entity_id'];
$type = $options['entity_type'];
$id = $data->$id_key;
if ($id) {
$entity_map[$id] = $row_node;
......
--ACCESS=access content
--ENTITY_TYPE=node
--ENTITY_ID=nid
SELECT nid, type, title, uid, sticky, promote from node WHERE type=:content_type
and status=1
ORDER BY title
--INFO
entity_type = node
entity_id = nid
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment