Newer
Older
David Metzler
committed
<?php
/**
* Display reports to edit for admins in the structure menu
* Enter description here ...
*/
function forena_admin_reports() {
GLOBAL $language;
$links[] = array('href' => 'reports/add', 'title' => 'Create New Report' );
$content = drupal_get_form('forena_sync_form');
$output = drupal_render($content);
$output .= theme('links',
array(
'links' => $links,
'attributes' => array('class' => 'action-links'),
)
// Add Data tables if it exists.
drupal_add_css(drupal_get_path('module', 'forena') . '/forena.css');
if (file_exists('sites/all/libraries/dataTables/media/js/jquery.dataTables.min.js')) {
drupal_add_js(drupal_get_path('module', 'forena') . '/forena.admin.js');
drupal_add_js('sites/all/libraries/dataTables/media/js/jquery.dataTables.min.js');
}
$headers = array(t('title'), t('name'), t('category'), t('operation'));
$result = db_query('SELECT * FROM {forena_reports} where language=:language ORDER BY category,title', array(':language' => $language->language));
foreach ($result as $row) {
$rpt = str_replace('/', '.', $row->report_name);
$edit = l(t('Edit'), 'reports/' . $rpt . '/edit');
$clone = l(t('Clone'), 'reports/add/' . $rpt);
$delete = l(t('Delete'), 'reports/' . $rpt . '/delete', array('query' => array('destination' => 'admin/structure/reports')));
$title = l(t($row->title), 'reports/' . $rpt);
$data[] = array($title, $row->report_name, $row->category, $edit . ' ' . $clone . ' ' . $delete);
$output .= '<div id="forena-reports-list">';
$output .= theme_table(array('header' => $headers, 'rows' => $data, 'attributes' => array('class' => array( 'dataTable-paged')), 'caption' => '', 'sticky' => TRUE, 'colgroups' => array(), 'empty' => ''));
$output .= '</div>';
/**
* @param string $report_name
*/
function forena_delete_report($report_name, $delete_file = TRUE) {
if ($delete_file) $do = unlink($info['basename']);
@list($tlang, $tname) = explode('/', $report_name, 2);
if (array_key_exists($tlang, language_list())) {
$report_name = $tname;
$language = $tlang;
->condition('report_name', $report_name)
->condition('language', $language)
->execute();
drupal_set_message(t('Unable to delete file %s', array('%s' => $info['basename'])), 'error');
}
}
function forena_filter_element($fmt, $name) {
global $user;
$element['format'] = array(
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => $fmt!='',
if (!$fmt) $fmt='full_html';
$formats = filter_formats($user);
foreach ($formats as $format) {
$options[$format->format] = $format->name;
$element['format']['guidelines'][$format->format] = array(
'#theme' => 'filter_guidelines',
'#required' => TRUE,
'#format' => $format,
);
}
$element['format']['guidelines']['#weight']=12;
$element['format'][$name] = array(
'#type' => 'select',
'#title' => t('Text format'),
'#options' => $options,
'#default_value' => $fmt,
'#access' => count($formats) > 1,
'#weight' => 10,
'#attributes' => array('class' => array('filter-list')),
);
$element['format']['help'] = array(
'#type' => 'container',
'#theme' => 'filter_tips_more_info',
'#attributes' => array('class' => array('filter-help')),
'#weight' => 11,
);
/**
* Accepts the name of a file
*
* Returns an editor object of the file.
*
function forena_get_report_editor($report_name) {
if ($report_name) {
$r_text='';
$report_path = forena_report_path();
$filename = $report_path . '/' . $report_name . '.frx';
if (file_exists($filename)) {
$r_text = file_get_contents($filename);
}
David Metzler
committed
/**
* Report syncronization form
* @param $formid
* @param $form_state
David Metzler
committed
*/
function forena_sync_form($formid, &$form_state) {
$form['sync_overwrite'] = array(
'#type' => 'checkbox',
'#title' => t('Revert all delivered reports to orignial'),
'#description' => t('All customizations to module delivered reports will be lost.')
);
$form['sync'] = array(
'#type' => 'submit',
'#value' => t('Clear Cache'),
'#submit' => array('forena_settings_sync_submit'),
);
}
/**
* Forena admin settings form
*
*/
function forena_settings() {
$skins = variable_get('forena_skins', array());
$report_path = forena_report_path();
David Metzler
committed
$form['forena_report_repos'] = array(
'#type' => 'textfield',
'#title' => t('Report Repository'),
'#description' => t('Indicate the directory that you want to use for your reports. In order for you to ' .
'to be able to save reports, this directory should be writable by the web user. Relative' .
'paths should be entered relative to the base path of your drupal installation.'),
'#default_value' => $report_path,
);
$form['forena_last_report_path'] = array(
'#type' => 'value',
'#value' => forena_report_path(),
$form['forena_input_format'] = forena_filter_element(variable_get('forena_input_format', filter_default_format()), 'forena_input_format');
$form['forena_default_form'] = array(
'#title' => t('Default report skin'),
'#description' => t('Specify the default skin to be used. New skins can be created by creating .skinfo files in your reports directory.'
. ' Skins are basically css and javascript libraries added to your report.'),
'#default_value' => variable_get('forena_default_form', ''),
$form = system_settings_form($form);
$form['#submit'][] = 'forena_settings_submit';
return $form;
David Metzler
committed
}
/**
* Added submit handler to create directories and clear menu cache
David Metzler
committed
*
* @param unknown_type $form
* @param unknown_type $form_state
*/
function forena_settings_submit($form, &$form_state) {
$values = $form_state['values'];
David Metzler
committed
$path = $values['forena_report_repos'];
$src_dir = drupal_get_path('module', 'forena') . '/repos/reports';
if ($path != $values['forena_last_report_path']) {
if (!file_exists($path)) {
try {
if (file_exists($path)) {
drupal_set_message(t('Created directory %s', array($path))) ;
}
mkdir($path);
} catch (Exception $e) {
forena_error(t('Unable to create report directory'), $e->getMessage());
return;
}
}
forena_sync_reports();
}
function forena_settings_sync_submit($form, &$form_state) {
forena_sync_reports($form_state['values']['sync_overwrite']);
drupal_set_message(t('Report cache cleared'));
David Metzler
committed
}
function forena_format_form($formid, $form_state, $report_name) {
$desc = Frx::Menu()->parseURL($report_name);
$name = $desc['name'];
if (!$desc['exists']) {
$filename = $desc['filename'];
$format = isset($desc['format']) ? $desc['format'] : '';
if ($desc['exists']) {
$r = forena_get_report_editor($name);
drupal_set_title($r->title);
$form = array();
$r = forena_get_report_editor($name);
$frx_options = $r->getOptions();
$report_form = @$frx_options['form'];
$doclist = Frx::Menu()->doc_formats;
$skins[''] = t('Use Default');
$skins = array_merge(variable_get('forena_skins', array()), $skins);
$form['report_name'] = array(
'#type' => 'value',
'#value' => $name,
);
'#description' => t('The page style of your report. The {skin}.skinfo file specifies css and js file in your report.')
//begin checking doc generation options
if ($r) $nodes = $r->simplexml->head->xpath('frx:docgen/frx:doc');
if ($doclist) {
$form['docgen'] = array(
'#tree' => TRUE,
'#type' => 'fieldset',
'#title' => t('Document Options'),
'#description' => t('These are document transformation options. Options selected will display as links in your report view.')
);
//build the options and default list
$options = array();
$default = array();
foreach ($doclist as $value) {
$options[$value] = strtoupper($value);
$doc = isset($r) ? $r->simplexml->head->xpath('frx:docgen/frx:doc[@type="' . $value . '"]') : '';
if ($doc && array_search($value, $doclist)!==FALSE) {
//display checkboxes
$form['docgen']['docs'] = array(
'#type' => 'checkboxes',
'#description' => t('If no options are selected, the system will display all of the above as available for this report.'),
'#options' => $options,
'#default_value' => $default
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Save',
);
}
}
return $form;
}
function forena_format_form_submit($form, &$form_state) {
$name = $values['report_name'];
$r = forena_get_report_editor($name);
$options = array(
'form' => $values['form']);
$r->setOptions($options);
// Doc gen settings.
if (isset($form['docgen'])) {
$docgen = array();
if ($selected = array_filter(@$values['docgen']['docs'])) {
if ($selected) foreach ($selected as $key => $value) {
}
}
$r->setDocgen($docgen);
}
if (forena_save_report($name, $r->asXML(), TRUE) == 1) {
drupal_set_message(t('Your report, %s has been saved.', array('%s' => $name)));
}
else {
drupal_set_message(t('There was an error saving your report, %s to the database.', array('%s' => $name)));
}
}
/**
* Form function for the edit report form
* @param $form_state
* @return the form
*/
function forena_layout_form($form, $form_state, $report_name) {
$desc = Frx::Menu()->parseURL($report_name);
global $language;
//determine if this is an add new report request
$filename = $desc['filename'];
$format = @$desc['format'];
if ($name) {
if ((isset($desc['exists']) && $desc['exists'])) {
$save_name = $name;
$r = forena_get_report_editor($name);
$title = (string)$r->title;
if (module_exists('locale')) {
@list($tlang, $tsave_name) = explode('/', $name, 2);
// FInd out if the starting name of the report is an installed language.
if (array_key_exists($tlang, language_list() )) {
$lang = $tlang;
$save_name = $tsave_name;
}
else {
$lang = 'en';
drupal_set_title(filter_xss($r->title));
// Need to get all option attributes
$frx_options = $r->getOptions();
$hidden = @$frx_options['hidden']=='1' ? 1 : 0;
$report_form = @$frx_options['form'];
$attributes = $r->get_attributes_by_id();
$category = $r->getCategory();
$body = $r->simplexml->body->asXML();
$css = @(string)$r->simplexml->head->style;
//array of xml attributes that are required to have a value
$required = array('id' => TRUE, 'label' => TRUE);
$form['report_name'] = array(
$form['name_in'] = array(
'#type' => 'value',
'#value' => $name_in,
);
$form['attributes'] = array(
'#type' => 'value',
'#value' => $attributes,
$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Title'),
'#default_value' => $title,
);
$form['body'] = array(
'#type' => 'text_format',
'#title' => t('Body'),
'#default_value' => $body,
'#rows' => 25,
'#format' => variable_get('forena_input_format', filter_default_format())
);
$form['visibility'] = array(
'#type' => 'fieldset',
);
$form['visibility']['category'] = array(
'#type' => 'textfield',
'#title' => t('Category'),
'#default_value' => $category,
'#autocomplete_path' => 'forena/categories/autocomplete',
'#description' => t('The heading your report will be grouped under on the report list.'),
$form['visibility']['hidden'] = array(
'#type' => 'checkbox',
'#default_value' => $hidden,
'#description' => t('Hide your report from showing up on the report list.'),
$form['menu'] = array(
'#type' => 'fieldset',
'#title' => t('Menu'),
'#tree' => TRUE,
'#collapsible' => TRUE,
'#collapsed' => empty($menu),
);
$form['menu']['path'] = array(
'#type' => 'textfield',
'#title' => t('Menu Path'),
'#description' => t('Indicate site reletive path to menu. Paramters may be embedded in the url using a :parm syntax (e.g. states/:state)'),
'#default_value' => @$menu['path'],
);
$form['menu']['title'] = array(
'#type' => 'textfield',
'#title' => t('Menu Title'),
'#description' => t('Title of menu item. Leave blank to use the report title as the menu title.'),
'#default_value' => @$menu['title'],
$menu_options = array(
'normal-item' => t('Normal'),
'local-task' => t('Tab'),
'default-local-taks' => t('Default Tab'),
'callback' => t('Callback'),
);
$form['menu']['type'] = array(
'#type' => 'select',
'#title' => 'Type of menu to create',
'#options' => $menu_options,
'#default_value' => @$menu['type'],
$form['style'] = array(
'#type' => 'fieldset',
'#title' => t('CSS Styles'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['style']['css'] = array(
'#type' => 'textarea',
'#default_value' => $css,
'#description' => t('Specify small css snipets that can be used in the reports.'),
'#rows' => 10,
'#cols' => 80,
);
'#type' => 'submit',
'#value' => 'Save',
$form['buttons']['delete'] = array(
'#type' => 'submit',
'#value' => 'Delete',
'#submit' => array('forena_edit_delete_submit'),
);
return $form;
}
else {
drupal_not_found();
}
}
else {
drupal_not_found();
function forena_layout_form_validate($form, &$form_state) {
$body = $values['body']['value'];
$doc_prefix = '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ENTITY nbsp " ">
]>';
if ($body) {
$body_xml = $doc_prefix . '<html xmlns:frx="urn:FrxReports">' . $body . '</html>';
if (@$body_doc->loadXML($body_xml) === FALSE) {
form_set_error('body', t('Invalid XHTML Document. Check for unclosed tags or stray &'));
if ($values['menu']['path']) {
if (!valid_url(str_replace(':', '', $values['menu']['path']), FALSE)) {
form_set_error('menu][path', t('Invalid Path'));
}
}
/**
* builds a string of the xml document,
* submits it to forena_save_report.
*/
function forena_layout_form_submit($form, &$form_state) {
$nodes = array();
$values = $form_state['values'];
$report_name = $values['report_name'];
$r = forena_get_report_editor($report_name);
// Title and category
$r->setTitle($values['title']);
$r->setCategory($values['category']);
// Form options
$options = array(
'hidden' => $values['hidden'],
);
$r->setOptions($options);
$menu = $r->getMenu();
if ($values['menu']!= $menu) {
$r->setMenu($values['menu']);
$rebuild_menu = TRUE;
}
// Body
$r->setBody($values['body']['value']);
// CSS
$r->setStyle($values['css']);
// If there are no frx attributes in the body then replace them with the old values.
$frx_nodes = $r->simplexml->xpath('body//*[@frx:*]');
if (!$frx_nodes) {
$r->save_attributes_by_id($values['attributes']);
}
//determine redirection.
$report_path = forena_report_path();
$filename = $report_path . '/' . $report_name . '.frx';
if (forena_save_report($report_name, $r->asXML(), TRUE) == 1) {
drupal_set_message(t('Your report, %s has been saved.', array('%s' => $report_name)));
// If we changed the menu we need to rebuild it.
if ($rebuild_menu) {
menu_rebuild();
}
/**
* Handle delete buttons from edit forms.
* @return unknown_type
*/
function forena_edit_delete_submit($form, &$form_state) {
$destination = '';
if (isset($_REQUEST['destination'])) {
$destination = drupal_get_destination();
unset($_REQUEST['destination']);
}
$form_state['redirect'] = array('path' => $link . '/delete', 'query' => array('destination' => $destination));
}
function forena_add_report_form($formid, $form_state, $report_name='') {
$name = '';
$filename = '';
$format = '';
if ($report_name) {
$desc = Frx::Menu()->parseURL($report_name);
$name = $desc['name'];
$filename = $desc['filename'];
$format = @$desc['format'];
}
$form = array();
global $language;
//determine if this is an add new report request
$r = forena_get_report_editor($name);
$title = (string)$r->title;
if (module_exists('locale')) {
@list($tlang, $tsave_name) = explode('/', $name, 2);
// FInd out if the starting name of the report is an installed language.
if (array_key_exists($tlang, language_list() )) {
$lang = $tlang;
$save_name = $tsave_name;
}
else {
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
}
}
// Need to get all option attributes
$frx_options = $r->getOptions();
$hidden = @$frx_options['hidden']=='1' ? 1 : 0;
$report_form = @$frx_options['form'];
$attributes = $r->get_attributes_by_id();
$category = $r->getCategory();
$body = $r->simplexml->body->asXML();
//array of xml attributes that are required to have a value
$required = array('id' => TRUE, 'label' => TRUE);
//list of supported document formats
$doclist = variable_get('forena_doc_formats', array());
$form['save_report_name'] = array(
'#type' => 'textfield',
'#title' => t('Report Name'),
'#description' => t('Enter only letters, numbers, and special characters: - _ /
<br/>White space is not permitted.
Create a directory using the format: (directory name) / (report name). Save multiple reports to the same directory
by referencing the same name.'),
'#required' => TRUE,
);
$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Title'),
'#default_value' => $title,
);
$form['category'] = array(
'#type' => 'textfield',
'#title' => t('Category'),
'#default_value' => $category,
'#autocomplete_path' => 'forena/categories/autocomplete',
'#description' => t('The heading your report will be grouped under on the report list.'),
);
$form['hidden'] = array(
'#type' => 'checkbox',
'#title' => t('Hidden'),
'#default_value' => $hidden,
'#description' => t('Hide your report from showing up on the report list.'),
);
$form['report_name'] = array(
'#title' => t('Create from report'),
'#type' => 'textfield',
'#autocomplete_path' => 'forena/reports/autocomplete',
'#default_value' => $name,
);
$form['save'] = array(
'#type' => 'submit',
'#value' => 'Create',
);
return $form;
}
function forena_add_report_form_validate($form, &$form_state) {
$values = $form_state['values'];
$regexp = "/^[A-Za-z0-9\/\_\-]*$/";
$save_report_name = $values['save_report_name'];
$desc = Frx::Menu()->parseURL($save_report_name);
//comparing the report names to see if they have changed.
//If they have, making sure the new name does not already exist.
$report_path = forena_report_path();
$filename = $report_path . '/' . $save_report_name . '.frx';
if (@$desc['exists']) {
form_set_error('save_report_name', t('The file ' . $save_report_name . ' already exists. Please enter another name.'));
}
function forena_add_report_form_submit($form, &$form_state) {
$values = $form_state['values'];
$report_name = $values['save_report_name'];
$desc = Frx::Menu()->parseURL($report_name);
$report_name = $desc['name'];
$r = forena_get_report_editor($values['report_name']);
// Title and category
$r->setTitle($values['title']);
$r->setCategory($values['category']);
// Form options
$options = array(
'hidden' => $values['hidden'],
$r->setOptions($options);
//determine redirection.
$filename = $desc['filename'];
if (forena_save_report($report_name, $r->asXML(), TRUE) == 1) {
drupal_set_message(t('Your report, %s has been saved.', array('%s' => $report_name)));
//if this is a new report then redirect to data blocks
if ($values['report_name']) {
}
else {
$form_state['redirect']= $desc['i_link'] . $edit;
}
function forena_create_trans_form($formid, $form_state, $report_name) {
$name = '';
$filename = '';
$format = '';
$desc = Frx::Menu()->parseURL($report_name);
$name = $desc['name'];
$filename = $desc['filename'];
$base_name = $desc['base_name'];
$format = @$desc['format'];
$form = array();
global $language;
$languages = language_list();
//determine if this is an add new report request
$r = forena_get_report_editor($name);
$title = (string)$r->title;
$lang = @$_GET['language'];
if ($lang) {
}
$form['base_name'] = array(
'#type' => 'value',
'#value' => $base_name
);
$form['report_name'] = array(
'#type' => 'value',
'#value' => $name,
);
$languages[$key] = $obj->native;
$form['report_lang'] = array(
'#type' => 'value',
'#value' => $lang,
);
$def_lang = $lang ? $lang : 'en';
$form['save_report_language'] = array(
'#type' => 'select',
'#title' => t('Language'),
'#options' => $languages,
'#default_value' => $def_lang,
);
$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Title'),
'#default_value' => $title,
);
$form['save'] = array(
'#type' => 'submit',
'#value' => 'Create',
);
return $form;
}
function forena_create_trans_form_submit($form, &$form_state) {
$values = $form_state['values'];
$base_name = $values['base_name'];
$new_name = $values['save_report_language'] . '/' . $base_name;
$filename = $desc['filename'];
$report_name = $desc['name'];
$r = forena_get_report_editor($values['report_name']);
// Title and category
$r->setTitle($values['title']);
if (file_exists($filename)) {
drupal_set_message(t('Report %s already exists', array('%s' => $new_name)), 'error');
if (forena_save_report($report_name, $r->asXML(), TRUE) == 1) {
drupal_set_message(t('Translation, %s has been created. Switch languages to translate.', array('%s' => $values['title'])));
$form_state['redirect']= array( $desc['i_link'] . '/edit/layout');
/*
* administer the settings for document format options
*/
function forena_doc_formats_settings() {
// Invoke doc_type hook to see which document types are there.
$supported_doctypes = Frx::documentTypes();
$form['forena_doc_formats'] = array(
'#type' => 'checkboxes',
'#title' => t('Allowed Document Formats'),
'#default_value' => variable_get('forena_doc_formats', $supported_doctypes),
'#description' => t('check your desired document format'),
'#options' => $supported_doctypes,
);
$form['forena_doc_defaults'] = array(
'#type' => 'checkboxes',
'#title' => t('Default Document Formats'),
'#default_value' => variable_get('forena_doc_defaults', array()),
'#description' => t('check your desired document format'),
'#options' => $supported_doctypes,
);
$form['forena_email_override'] = array(
'#type' => 'checkbox',
'#title' => 'Run email merges in test mode' ,
'#default_value' => variable_get('forena_email_override', FALSE),
'#description' => t('When this box is checked emails are sent to the currently logged in user. Useful for testing environments.'),
);
$form['forena_email_input_format'] = forena_filter_element(variable_get('forena_email_input_format', 'full_text'), 'forena_email_input_format');
$form['forena_email_input_format']['#title'] = t('Email Input Format');
return system_settings_form($form);
}
/*
* administer the settings for document format options
*/
function forena_data_settings() {
$repos = Frx::RepoMan()->repositories;
$r_list = array();
$headers = array(t('Name'), t('Description'), t('Path'), t('Operation'));
foreach ($repos as $name => $r) {
$r_list[] = array(
$name,
$r['title'],
$r['path'],
l(t('configure'), 'admin/config/content/forena/data/configure/' . $name)
);
}
$output = '<ul class="action-links"><li>' . l(t('Add data source'), 'admin/config/content/forena/data/add') . '</li></ul>';
$output .= theme_table(array('header' => $headers, 'rows' => $r_list, 'attributes' => array(), 'caption' => '', 'sticky' => TRUE, 'colgroups' => array(), 'empty' => ''));
return $output;
}
function forena_data_settings_edit($form, &$form_state, $source=-1) {
global $databases;
$adding = ($source === -1);
if (!@$form_state['storage']) {
if ($adding) {
$form_state['storage'] = array(
'name' => '',
'title' => '',
'path' => '',
'config' => array(
'source' => 'user',
'database' => 'default',
'access callback' => 'user_access',
'user callback' => 'forena_current_user_id'
}
else {
Frx::RepoMan()->repository($source);
$repos = Frx::RepoMan()->repositories;
$r = $repos[$source];
$form_state['storage'] = array(
'name' => $source,
'title' => $r['title'],
);
}
}
$data = $form_state['storage'];
$config = $data['config'];
$locked = !($adding || (@$config['source'] == 'user'));
$values = @$form_state['values'];
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#description' => t('Machine readable name. Used in referencing all data used by this source. must should not contain any special characters or spaces.'),
'#disabled' => !$adding,
'#default_value' => $data['name'],
'#required' => TRUE,
$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Title'),
'#description' => t('Human readable name that describes the data source. This primarily occurs in error messages where the data source cannot be accessed.'),
'#default_value' => $data['title'],
);
$form['enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Enabled'),
'#description' => t('Disabling will cause all queries to return no data.'),
'#default_value' => @$data['enabled']!==0,
);
$form['debug'] = array(
'#type' => 'checkbox',
'#title' => t('Debug'),
'#description' => t('Write information to the screen and logs for each query executed.'),
'#default_value' => @$config['debug'],
);
$form['path'] = array(
'#type' => 'textfield',
'#title' => t('Path'),
'#disabled' => $locked,
'#description' => t('Directory containing data block files.'),
'#default_value' => @$data['path'],
);
$user_options = array(
'' => 'None',
'forena_current_user_id' => 'UID',
'forena_current_user_name' => 'User name',
);
$form['user_callback'] = array(
'#type' => 'select',
'#title' => 'Current user',
'#disabled' => $locked,
'#description' => t('Can be refererenced as :current_user in each data block.'),
'#options' => $user_options,
'#default_value' => @$config['user callback'],
// Access method list
$access = array(
'block' => t('Match values provided by a data block.'),
);
$form['access_method'] = array(
'#type' => 'select',
'#options' => $access,
'#disabled' => $locked,
'#title' => t('Data security method'),
'#default_value' => empty($config['access block']) ? 'callback' : 'block',
'#description' => t('Specify how the ACCESS defined for a data block is to be interpreted.'),
'#ajax' => array(
'callback' => 'forena_access_info_callback',
'wrapper' => 'access-details',