Commit 0ad11b1f authored by metzlerd's avatar metzlerd
Browse files

More code updates.

parent 36c4cb92
......@@ -51,8 +51,8 @@ class FrxSyntaxEngine {
// Check to see if there are child nodes
// If so use asXML otherwise string cast.
if ($retvar && strpos('<', $retvar)!==FALSE) {
if ($retvar && strpos($retvar, '<')!==FALSE) {
// Find the end of the first tag.
$p = strpos($retvar, '>');
$retvar = substr_replace($retvar, ' ', 0, $p+1);
......
......@@ -828,6 +828,8 @@ function forena_data_block_form($form_state) {
'#description' => t('Select a template to preview the data block in.'),
);
//If there are parameters in the data block allow the user to input data
//Check if there is already a parameter of the same name in the existing report. If there is, use the report value.
if ($params) {
$rpt_params = array();
//returns a 2 dimensional array of report parameters from the report
......@@ -1135,11 +1137,11 @@ function forena_admin_params_form($form_state) {
$attrs = $node->attributes();
$id = (string)$attrs['id'];
$label = (string)$attrs['label'];
$value = (string)$attrs['value'];
$value = (string)$attrs['value'] ? (string)$attrs['value'] : (string)$node;
$require = $attrs['require'];
$desc = (string)$attrs['desc'];
//make a subtree of params
//make a subtree for each param
$form['params'][$id] = array(
'#tree' => TRUE,
'#type' => 'fieldset',
......
......@@ -52,7 +52,7 @@ function forena_report_desc($name='') {
* @return array A list of css files that should be applied to the report.
*/
function forena_report_css($desc, $form, $format = '') {
$css_files = array();
$css_files = array();
// First check for the form file
$path = forena_report_path();
......@@ -119,9 +119,9 @@ function forena_report($name_in, $parms = array()) {
}
// Get data from the report;
$r_parms = $r->parameters;
$form = $r->form;
$rpt_xml = $r->rpt_xml;
$r_parms = $r->parameters;
$form = $r->options['form'];
$rpt_xml = $r->rpt_xml;
// Default the form
if (!$form) $form = variable_get('forena_default_form', 'letter');
......@@ -145,7 +145,7 @@ function forena_report($name_in, $parms = array()) {
'xml' => $r_text,
'title' => $title[0],
);
forena_generate_doc($format, $output, $options);
}
else {
......@@ -217,11 +217,12 @@ function __forena_load_repository(&$repo) {
if (file_exists($path .'/settings.php')) {
// Override with repository specific data
include($path .'/settings.php');
}
$repo = array_merge($repo, $conf);
// $repo['user callback'] = $conf['user callback'];
$repo['data'] = __forena_load_provider($repo, $repo['path']);
//$repo['auth'] = __forena_load_auth($security_provider);
}
......@@ -234,13 +235,16 @@ function __forena_load_repository(&$repo) {
*/
function __forena_load_provider($conf, $repo_path) {
$name = $conf['data provider'];
if (!$name) $name = $conf['data_engine'];
if (!$name) $name = $conf['data_engine'];
forena_define_plugins();
// Instantiate the path
//drupal_set_message("conf: <pre>". print_r($conf, 1) ."</pre> repo_path: <pre>". print_r($repo_path,1) ."</pre>");
if (class_exists($name)) {
$o = new $name($conf, $repo_path);
return $o;
}
}
/*
......@@ -251,7 +255,6 @@ function forena_repository($name='') {
global $_forena_repositories;
static $repos ='';
// Empty repository so we need to initialize
if (!$repos) {
// Build the default sample one
......@@ -270,6 +273,8 @@ function forena_repository($name='') {
'title' => 'Drupal Reports');
}
//drupal_set_message("repos: <pre>". print_r($repos, 1) ."</pre>");
// Now determine if the object exists
if ($name) {
......@@ -287,7 +292,7 @@ function forena_repository($name='') {
else {
return $repos;
}
}
/**
......@@ -344,8 +349,9 @@ function forena_load_cache($r_xhtml) {
*/
function forena_invoke_data_provider($data_block, $parameters=array(), $clause='') {
list($provider, $block) = explode('/', $data_block, 2);
// Get the data
// Get the data
$repos = forena_repository($provider);
if ($repos['user callback']) {
$user_fn = $repos['user callback'];
$parameters['current_user'] = $user_fn();
......@@ -439,7 +445,6 @@ function forena_get_report($report_name, $data=array()) {
$r_text = file_get_contents($filename);
try {
$r = forena_report_object($r_text, $data);
} catch (Exception $e) {
forena_error('Unable to read report', $e->getMessage());
......
......@@ -102,7 +102,6 @@ function forena_menu() {
'title' => t('My Reports'),
'access arguments' => array('list reports'),
'type' => MENU_NORMAL_ITEM,
'file' => 'forena.common.inc',
);
$items['forena/fields/format/autocomplete'] = array(
......@@ -253,7 +252,7 @@ function forena_user_reports() {
while ($row = db_fetch_object($result)) {
$access = TRUE;
$cache = $row->cache;
if ($cache) {
$cache = unserialize($cache);
......@@ -305,8 +304,7 @@ function forena_render_report($report, $format='', $data='', $options= array())
$output = $o->render($format);
//If a format was requested render a custom non-drupal document
if ($format) {
if ($format) {
forena_generate_doc($format, $output, $options);
}
else {
......
<?php
<?php
// $Id$
/**
* @file
......
......@@ -20,6 +20,7 @@ class FrxOracle extends FrxDataProvider {
* @param string $repos_path Path to location of data block definitions
*/
public function __construct($conf, $repos_path) {
parent::__construct($conf, $repos_path);
$this->use_oracle_xml = FALSE;
$uri = $conf['uri'];
......
Supports Markdown
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