Commit 7fa29e08 authored by metzlerd's avatar metzlerd
Browse files

Added support for args parameter in the menu to add additional menu

items. 
parent 806e35bc
...@@ -147,8 +147,9 @@ class FrxMenu { ...@@ -147,8 +147,9 @@ class FrxMenu {
$cache = unserialize($cache); $cache = unserialize($cache);
// Load menu item defaults // Load menu item defaults
$menu = $cache['menu']; $menu = @$cache['menu'];
$path = $menu['path']; $path = $menu['path'];
$path_args = @$menu['args'];
$type = @$menu['type']; $type = @$menu['type'];
$title = @$menu['title'] ? $menu['title']: $row->title; $title = @$menu['title'] ? $menu['title']: $row->title;
if (module_exists('locale')) { if (module_exists('locale')) {
...@@ -180,7 +181,8 @@ class FrxMenu { ...@@ -180,7 +181,8 @@ class FrxMenu {
// Now generate the callback arguments // Now generate the callback arguments
$parts = explode( '/', $new_path); $parts = explode( '/', $new_path);
$page_args = array_keys($parts, '%'); $page_args = array_keys($parts, '%');
$page_args = array_merge(array($path, $row->report_name), $page_args); $path_args = $path_args ? rtrim($path,'/') . '/' . ltrim($path_args, '/') : $path;
$page_args = array_merge(array($path_args, $row->report_name), $page_args);
// Set the access callback // Set the access callback
$access_callback = isset($cache['access']) ? 'forena_check_all_access' : TRUE; $access_callback = isset($cache['access']) ? 'forena_check_all_access' : TRUE;
......
...@@ -452,10 +452,17 @@ function forena_layout_form($form, $form_state, $report_name) { ...@@ -452,10 +452,17 @@ function forena_layout_form($form, $form_state, $report_name) {
$form['menu']['path'] = array( $form['menu']['path'] = array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Menu Path'), '#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)'), '#description' => t('Indicate site reletive path to menu. Parameters may be embedded in the url using a :parm syntax (e.g. states/:state)'),
'#default_value' => @$menu['path'], '#default_value' => @$menu['path'],
); );
$form['menu']['args'] = array(
'#type' => 'textfield',
'#title' => t('Additional Arguments'),
'#description' => t('Indicate additonal parameters that should be extracted after the menu path using a :parm syntax (e.g. :parma/:parmb)'),
'#default_value' => @$menu['args'],
);
$form['menu']['title'] = array( $form['menu']['title'] = array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Menu Title'), '#title' => t('Menu Title'),
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<name>help.design</name> <name>help.design</name>
</row> </row>
<row> <row>
<title>Reort Skins</title> <title>Report Skins</title>
<name>help.skins</name> <name>help.skins</name>
</row> </row>
</root> </root>
...@@ -21,23 +21,23 @@ ...@@ -21,23 +21,23 @@
available. &nbsp;Explanation of the opions on this form are as available. &nbsp;Explanation of the opions on this form are as
follows:</p> follows:</p>
<p> <p>
<strong>Body -&nbsp;</strong>&nbsp;The html body of the <strong>Body -;</strong>&nbsp;The html body of the
report.&nbsp; report.&nbsp;
</p> </p>
<p> <p>
<strong>Category</strong> - This controls under which group the <strong>Category</strong> - This controls under which group the
report appears under the My Reports link. report appears under the My Reports link.
</p> </p>
<p>Form - The form determines the look and feel of the report. <p>
<strong>Menu</strong> - Specify configuration options for a drupal menu
here.
</p>
<p><strong>Skin</strong> - The skin determines the look and feel of the report.
&nbsp;In conventional report writers this can be thought of as &nbsp;In conventional report writers this can be thought of as
what kinid of paper form the report printed on. &nbsp;In the what kinid of paper form the report printed on. &nbsp;In the
modern days of the web most layout is controlled by Cascacding modern days of the web most layout is controlled by Cascacding
Style Sheets (CSS). &nbsp;Specify the form of the report and any Style Sheets (CSS) and Javascript Libraries. See the section on
css or js files of the same name in your reports directory will Report Skins for additional information on creating report skins.</p>
automatically get added to the report. &nbsp;In this way you can
establish common styles that get used by reports that have the
same form name. &nbsp;If you leave this blank, the default form,
specified in the Forena configuration menu is used.&nbsp;</p>
<p> <p>
<strong>Hidden</strong> - Checking this box will cause the report <strong>Hidden</strong> - Checking this box will cause the report
not to be listed in the My Reports list regardless of the Category not to be listed in the My Reports list regardless of the Category
......
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