Difference between revisions of "Page settings.php"

From ARK
Jump to: navigation, search
Line 626: Line 626:
 
         'result_feeds' => $group_feeds,
 
         'result_feeds' => $group_feeds,
 
         'result_downloads' => $group_dls,
 
         'result_downloads' => $group_dls,
 +
);
 +
</pre>
 +
==Micro View (Record View)==
 +
These settings configure the micro view (or record view) page. The micro view requires configuration for the left panel, and record nav options as well as some general settings.
 +
===General Page Settings===
 +
Set the default page:
 +
<pre>
 +
// Default Micro viewer page (used by search result handlers)
 +
$conf_micro_viewer = $ark_dir."micro_view.php";
 +
</pre>
 +
===Micro View Left Panel===
 +
Configures the left panel in the micro view pages, requires the administrator to configure the lpanel with either Option 1 (linklists) or Option 2 (subforms). Requires the $mvlpoutput to be set, and when using the subform option requires the 'ark_page' to be set to 'micro_view' in the [[sf_module]].
 +
 +
====Subforms Option Example====
 +
Define the configuration type:
 +
<pre>
 +
$mvlpoutput = 'subforms';
 +
</pre>   
 +
Configure the subform module to include the relevant modules:
 +
<pre>
 +
$mvlp_subform_module =
 +
    array(
 +
        'view_state' => 'max',
 +
        'edit_state' => 'view',
 +
        'sf_nav_type' => 'none',
 +
        'sf_title' => 'mvlpmodlist',
 +
        'sf_html_id' => 'mvlpmodlist', // Must be unique
 +
        'script' => 'php/subforms/sf_module.php',
 +
        'ark_page'=> 'micro_view',
 +
        'fields' => array (
 +
            'cxt',
 +
            'smp',
 +
            'spf',
 +
            'sph'
 +
            )
 +
);
 +
</pre>
 +
Load the subform:
 +
<pre>
 +
$micro_view_left_panel =
 +
    array(
 +
        'col_id' => 'mvlp',
 +
        'col_alias' => FALSE,
 +
        'col_type' => 'primary_col',
 +
        'subforms' =>
 +
            array(
 +
                $mvlp_subform_module
 +
        )
 
);
 
);
 
</pre>
 
</pre>

Revision as of 15:55, 24 February 2011

Include Server Settings

And include the settings related to your server environment contained within the env_settings.php:

// Include settings related to your server environment
include('env_settings.php');

Navigation

Navigation Pages

Unless listed in this array, all pages will appear in the main nav.

$conf_hide_pages =
    array(
        'index.php',
        'record_view.php',
        'contact.php',
        'about.php',
        'search.php',
        'folder.php',
        'overlay_holder.php',
        'export.php',
        'alias_admin.php',
        'markup_admin.php',
        'import.php'
);

Navigation Links

Configure to state what links will appear in the end of the navigation bar.

$conf_linklist =
    array(
        'file' => 'index.php',
        'vars' => 'logout=true',
        'label' => 'logout'
);

Left Panel Configuration

As of v0.8 there are two configuration options (Option 1: Link list or Option 2: Subform) which may be used to provide users with links in the left panel. The left panel now follows the subform-linklist options for all views including the user home, data entry and micro view (record view) left panels- not including the search-data view). Both options require the option to be defined first, i.e. $delpoutput = 'subforms'; OR $delpoutput = 'linklist'; (this example is for data entry). It should be noted that if this is not set, the left panel sets this to 'linklist' by default.

Example of left panel in data entry configured with linklist

Option 1 - Link list

This is a simple list of links that will be formatted and outputted into the left panel, and has been the default mechanism for configuring links in the left panel to date. This usually requires administrators to configure individual links for registers and detailed forms (view). Each link requires the following:

  • href - link to the output
  • mknname - mark-up nickname will search the markup table for this nickname and print the markup
  • img - link to an image used

within the 'href' the following vars need to be set up (see example below):

  • view - the view the link should point to (regist, detfrm, files or a custom view)
  • item_key - itemkey to point to if any (cxt_cd, smp_cd)
Example of left panel in data entry configured with subforms (sf_module and sf_linklist)

Option 2 - Subform

As of v0.8 subforms can be executed within the left panel. This opens the door for a range of custom subforms to be written providing useful user interface features. This also permits us to use conditional behaviours for the panel.

In order to set this up correctly, you need to set up a subform and place it within a column as you would in data entry or micro view. In order to use the sf_linklist (as in the above example) create a link list array according to the criteria for option 1 (see above) and then put this into the 'fields' element of the subform instead of an array of fields. This is documented within the page for this subform as this is now a behaviour specific to this subform. The example below also uses the sf_module to define the modules to display in the left panel, which gives the option of inserting icons for the detailed forms and registers if they are configured in the mod_settings.

User Home

These settings control the subforms and left panel in the user home. The user home needs configuration both for the left panel and for the subforms included in the main area.

User Home Left Panel

Configures the left panel in the user home pages, requires the administrator to configure the lpanel with either Option 1 (linklists) or Option 2 (subforms). Requires the $uhlpoutput to be set, and when using the subform option requires the 'ark_page' to be set to 'user_home' in the sf_module.

Subforms Option Example

Define the configuration type:

$uhlpoutput = 'subforms';

Configure the subform:

$uhlp_subform_module =
    array(
        'view_state' => 'max',
        'edit_state' => 'view',
        'sf_nav_type' => 'none',
        'sf_title' => 'mvlpmodlist', 
        'sf_html_id' => 'mvlpmodlist', // Must be unique
        'script' => 'php/subforms/sf_module.php',
        'ark_page'=> 'user_home',
        'fields' => array (
            'cxt',
            'smp',
            'spf',
            'sph'
            )
); 
 

Load the subform:

$user_home_left_panel =
    array(
        'col_id' => 'mvlp',
        'col_alias' => FALSE,
        'col_type' => 'primary_col',
        'subforms' =>
            array(
                $uhlp_subform_module
        )
);

Data Entry

These settings configure the data entry page. The data entry requires configuration for both the left panel and the record navigation bar appearing at the top of the main area. Further options for advanced file upload are also included below.

Data Entry Left Panel

This section gives examples for the left panel configuration in the data entry pages.

Link list Option Example

Define the configuration type:

$delpoutput = 'linklist';

Configure the links:

$data_entry_left_panel[] = 
array(
        'href' => "{$_SERVER['PHP_SELF']}?view=regist&item_key=cxt_cd", 
        'mknname' => 'regcxt'
	);
$data_entry_left_panel[] = 
array(
	'href' => "{$_SERVER['PHP_SELF']}?view=detfrm&item_key=cxt_cd", 
	'mknname' => 'detcxt'
	);
$data_entry_left_panel[] = 
array(
	'href' => "{$_SERVER['PHP_SELF']}?view=regist&item_key=pln_cd", 
	'mknname' => 'regpln'
	);
$data_entry_left_panel[] = 
array(
	'href' => "{$_SERVER['PHP_SELF']}?view=regist&item_key=sph_cd", 
	'mknname' => 'regsph'
	);
$data_entry_left_panel[] = 
array(
	'href' => "{$_SERVER['PHP_SELF']}?view=regist&item_key=abk_cd", 
	'mknname' => 'regabk'
	);
$data_entry_left_panel[] = 
array(
	'href' => "{$_SERVER['PHP_SELF']}?view=files", 
	'mknname' => 'uplfile'
	);

Subforms Option Example

Define the configuration type:

$delpoutput = 'subforms';

Configure the linklist (in this case, a linklist is being used to display the upload files link and the sf_linklist is calling the link):

$link_list_admin[] = 
array(
        'href' => "{$_SERVER['PHP_SELF']}?view=files", 
        'mknname' => 'uplfile',
        'img' => 'bigplus.png'
        );

Configure the subforms - Subform listing the modules:

$delp_subform_module =
    array(
        'view_state' => 'max',
        'edit_state' => 'view',
        'sf_nav_type' => 'none',
        'sf_title' => 'delpmodlist', 
        'sf_html_id' => 'delpmodlist', // Must be unique
        'script' => 'php/subforms/sf_module.php',
        'ark_page'=> 'data_entry',
        'fields' => array (
            'cxt',
            'smp',
            'spf',
            'sph',
            )
);

Admin Subform calling the file upload linklist from above:

$delp_subform_admin =
    array(
        'view_state' => 'max',
        'edit_state' => 'view',
        'sf_nav_type' => 'none',
        'sf_title' => 'delpadmin', 
        'sf_html_id' => 'delpadmin', // Must be unique
        'script' => 'php/subforms/sf_linklist.php',
        'op_label' => 'space',
        'op_input' => 'save',
        'op_linktype' => 'icon',
        'op_sf_cssclass' => 'module_list',
        'op_modtype' => FALSE, //if each modtype uses same fields (see below)
        'fields' => $link_list_admin
);    

Load the subforms:

$data_entry_left_panel =
    array(
        'col_id' => 'delp',
        'col_alias' => FALSE,
        'col_type' => 'primary_col',
        'subforms' =>
            array(
                $delp_subform_module,
                $delp_subform_admin
        )
);

Record Toolbar

Configure the tools for the record view toolbar. This tool bar controls what navigation and options which appear in data entry record toolbar.

Record Navigation

First form the individual buttons and displays:

// Previous record
$group_nav[] =
    array(
	'name' => 'prev',
        'type' => 'text',
        'href' => "",
        'css_class' => FALSE,
        'mkname' => 'prev',
        'lightbox' => FALSE
);
// Displays current site code
$group_nav[] =
    array(
	'name' => 'ste_cd',
        'type' => 'text',
        'href' => "",
        'css_class' => FALSE,
        'mkname' => 'ste_cd',
        'lightbox' => FALSE
);
// Displays current record number
$group_nav[] =
    array(
	'name' => 'current',
        'type' => 'text',
        'href' => "",
        'css_class' => FALSE,
        'mkname' => 'current',
        'lightbox' => FALSE
);
// Displays current modtype
$group_nav[] =
    array(
	'name' => 'modtype',
        'type' => 'text',
        'href' => "",
        'css_class' => FALSE,
        'mkname' => 'modtype',
        'lightbox' => FALSE
);
// Next record
$group_nav[] =
    array(
	'name' => 'next',
        'type' => 'text',
        'href' => "",
        'css_class' => FALSE,
        'mkname' => 'next',
        'lightbox' => FALSE
);

Refresh View

// Refresh button
$group_refresh[] =
    array(
	'name' => 'refresh',
        'type' => 'img',
        'href' => "{$_SERVER['PHP_SELF']}?disp_reset=default",
        'css_class' => 'refresh',
        'mkname' => 'reset',
        'lightbox' => FALSE
);

Administrator Tools

// ADMIN TOOLS
// Delete record
$group_admin[] =
    array(
        'name' => 'delete',
        'type' => 'img',
	'href' => FALSE,
        'css_class' => 'delimg',
        'mkname' => 'del',
        'lightbox' => 'lightbox|200'
);
// Edit modtype
$group_admin[] =
    array(
	'name' => 'changemod',
        'type' => 'text',
	'href' => FALSE,
        'css_class' => 'recedit',
        'mkname' => 'chgtype',
        'lightbox' => 'lightbox|200'
);
// Edit record number
$group_admin[] =
    array(
	'name' => 'changeval',
        'type' => 'text',
	'href' => FALSE,
        'css_class' => 'recedit',
        'mkname' => 'chgkey',
        'lightbox' => 'lightbox|200'
);

And then put them in the toolbar conf array:

// Package these button groups up into a toolbar
$conf_record_nav =
    array(
    	'record_nav' => $group_nav,
        'record_refresh' => $group_refresh,
        'record_admin' => $group_admin,
);

Advanced File Upload

The following includes instructions on how to configure the advanced file uploader which was developed as a mechanism for not only batch uploading files, but also registering and/or linking them to existing records on the fly.

  • on - Set to TRUE, advanced file uploader dialog is displayed.
  • pattern - This is a regex (Regular expression) designed to detect the file names and associate the files with the appropriate records (item_keys). These example expressions are set up to treat the first 3 letters of a file name as the relevant site code and the numbers following as the number. (For example: 'pattern' => "/\b[a-zA-Z]*\-(([0-9]*)|(([0-9]*)-[a-zA-Z0-9]*))\.[a-zA-Z]{2,4}\b/i" handles files xxx-1234.jpg, xxx-1234-yyy.jpg, where xxx can be any letter and yyy any alphanumeric combination, only number before first '-' is used as an ID)
$fu =
    array(
     'on' => TRUE,
     'pattern' => "/\b[a-zA-Z]*\-(([0-9]*)|(([0-9]*)-[a-z0-9A-Z]*))\.[a-z0-9]{2,4}\b/i", 
);

Data View (Search)

These settings configure the data view (or search) page. The data view requires configuration for the left panel, the search tools options (results views, download options, etc) as well as some general settings for search results.

General Page Settings

Configure the viewers to display a set number of rows:

// Number of rows to display on the data viewer
$conf_viewer_rows = 25;

And the number of pages to display on the data viewer:

// Number of pages to display on the data viewer
$conf_num_res_pgs = 5; // best choose an odd number

Also configure the index pages for Data View and Search pages:

// Default data viewer page
$conf_data_viewer = $ark_dir."data_view.php";
// Default search page - search funtions will send data thru to this page
$conf_search_viewer = $ark_dir."data_view.php";

Set the default for search results display (options include: text, table, or map):

// Default $output_mode for the data viewer
$default_output_mode = 'table';

Data View Left Panel

This configures the left panel for the data view pages through a series of complex subforms including sf_linklist, sf_buildfilter, and sf_mysavedstuff.

Configure the linklist

First configure the linklist, which requires the following:

  • href - link to the output ({$_SERVER['PHP_SELF']} is on same page, and then links to the key ID in cor_tbl_module of the designated data filter
  • mknname - mark-up nickname will search the markup table for this nickname and print the markup
  • img - optional image for the icon defined in the subform linklist:
$link_list_filters[] = 
array(
	'href' => "{$_SERVER['PHP_SELF']}?vtok=1&ftype=key&key=1", 
	'mknname' => 'filtercxt',
	'img' => 'view_mag.png'
	);
$link_list_filters[] = 
array(
        'href' => "{$_SERVER['PHP_SELF']}?vtok=1&ftype=key&key=6", 
        'mknname' => 'filtersmp',
        'img' => 'view_mag.png'
        );
$link_list_filters[] = 
array(
	'href' => "{$_SERVER['PHP_SELF']}?vtok=1&ftype=stecd", 
        'mknname' => 'filterstecd',
        'img' => 'view_mag.png'
        );
$link_list_filters[] = 
array(
	'href' => "{$_SERVER['PHP_SELF']}?vtok=1&ftype=action", 
        'mknname' => 'filteractor',
        'img' => 'view_mag.png'
        );
$link_list_filters[] = 
array(
	'href' => "{$_SERVER['PHP_SELF']}?vtok=1&ftype=ftx", 
        'mknname' => 'ftx',
        'img' => 'view_mag.png'
        );

Configure the linklist subform:

$dvlp_subform_filters =
    array(
        'view_state' => 'min',
        'edit_state' => 'view',
        'sf_nav_type' => 'name',
        'sf_title' => 'dvlp_filters', 
        'sf_html_id' => 'dvlp_filters', // Must be unique
        'script' => 'php/subforms/sf_linklist.php',
        'op_modtype' => FALSE, //if each modtype uses same fields (see below)
        // Does the linklist use an icon instead of a label as link
        'op_linktype' => 'icon',
        'op_sf_cssclass' => 'ftr_list',
        'fields' => $link_list_filters
);

Filter Builders

Various options exist for the types of filters administrators will want to make available to users- including different stages of pre-built or partially executed filters. For more information on this subform and options see sf_buildfilter.
Subform for the filter builder to run in the left panel:

$dvlp_filter_builder =
    array(
        'view_state' => 'min',
        'edit_state' => 'view',
        'sf_nav_type' => 'none',
        'sf_title' => 'dvlp_filters', 
        'sf_html_id' => 'dvlp_filters', // Must be unique
        'script' => 'php/data_view/subforms/sf_buildfilter.php',
        'op_modtype' => FALSE, //if each modtype uses same fields (see below)
        // Does the linklist use an icon instead of a label as link
        'op_sf_cssclass' => 'ftr_subform',
        'op_condition' =>
            array(
                array(
                    'func'=> 'chkTmpFtr',
                    'args'=> FALSE
            ), 
        ),
);

Subform for the filter builder to run in the left panel preloaded with a filter:

$dvlp_filter_builder_atridx =
    array(
        'view_state' => 'min',
        'edit_state' => 'view',
        'sf_nav_type' => 'none',
        'sf_title' => 'dvlp_filters', 
        'sf_html_id' => 'dvlp_filters', // Must be unique
        'script' => 'php/data_view/subforms/sf_buildfilter.php',
        'op_modtype' => FALSE, //if each modtype uses same fields (see below)
        // Does the linklist use an icon instead of a label as link
        'op_sf_cssclass' => 'ftr_subform',
        'op_filter' => 'atr', // the filter to be used
        'op_filter_args' =>
            array(
                // 'arg' => 'var', // example
                'atrtype' => 1,
                'op_display' => 'dd'
        )
        // 'op_condition' =>
        //     array(
        //         array(
        //             'func'=> 'chkTmpFtr',
        //             'args'=> FALSE
        //     ), 
        // ),
);

Subform for user saved filters

$dvlp_my_saved_filters =
    array(
        'view_state' => 'min',
        'edit_state' => 'view',
        'sf_nav_type' => 'name',
        'sf_title' => 'savedfilters', 
        'sf_html_id' => 'dvlp_saved_filters', // Must be unique
        'script' => 'php/data_view/subforms/sf_mysavedstuff.php',
        'op_modtype' => FALSE, //if each modtype uses same fields (see below)
        'op_sf_cssclass' => 'ftr_subform',
        // 'op_condition' =>
        //     array(
        //         array(
        //             'func'=> 'chkTmpFtr',
        //             'args'=> FALSE
        //     ), 
        // ),
);

Make a column to hold the subforms:

$data_view_left_panel =
    array(
        'col_id' => 'dvlp',
        'col_alias' => FALSE,
        'col_type' => 'primary_col',
        'subforms' =>
            array(
                $dvlp_filter_builder,
                $dvlp_filter_builder_atridx,
                $dvlp_subform_filters,
                $dvlp_my_saved_filters
        )
);

Results Toolbar

Configure the tools and display options for the search page (data_view). All of the toolbars require the following in the array:

  • type - Options of 'img', 'text', or 'newpage' (used in the all record view to display function in a new page)
  • href - The href link to the function being called
  • css_class - The css class to style the button or display
  • mkname - The name of markup contained within cor_tbl_markup used for buttons which combine text and images, are just text based. Set to FALSE if not used.
  • lightbox - Option of using the lightbox when calling an overlay form, set to FALSE otherwise

First form the individual buttons:

Tools

// TOOLS
$group_tools[] =
    array(
        'type' => 'img',
        'href' => "overlay_holder.php?sf_conf=conf_mac_userconfigfields&lboxreload=1",
        'css_class' => 'gears',
        'mkname' => FALSE,
        'lightbox' => 'lightbox'
);

Displays

// DISPs
$res = "results_mode=disp";
// Text view
$group_disp[] =
    array(
        'type' => 'img',
        'href' => "{$_SERVER['PHP_SELF']}?$res&disp_mode=text",
        'css_class' => 'text',
        'mkname' => FALSE,
        'lightbox' => FALSE
);
// Table view
$group_disp[] =
    array(
        'type' => 'img',
        'href' => "{$_SERVER['PHP_SELF']}?$res&disp_mode=table",
        'css_class' => 'table',
        'mkname' => FALSE,
        'lightbox' => FALSE
);
// Map view
$group_disp[] =
    array(
        'type' => 'img',
        'href' => "{$_SERVER['PHP_SELF']}?$res&disp_mode=map",
        'css_class' => 'map',
        'mkname' => FALSE,
        'lightbox' => FALSE
);
// All record view
$group_disp[] =
    array(
        'type' => 'newpage',
        'href' => "resultsmicro_view.php?",
        'css_class' => 'printall',
        'mkname' => FALSE,
        'lightbox' => FALSE
);    

Feeds

// FEEDS
$res = "results_mode=feed";
// RSS feed
$group_feeds[] =
    array(
        'type' => 'text',
        'href' => "{$_SERVER['PHP_SELF']}?$res&feed_mode=rss",
        'css_class' => FALSE,
        'mkname' => 'rss',
        'lightbox' => FALSE
);
// Atom feed
$group_feeds[] =
    array(
        'type' => 'text',
        'href' => "{$_SERVER['PHP_SELF']}?$res&feed_mode=atom",
        'css_class' => FALSE,
        'mkname' => 'atom',
        'lightbox' => FALSE
);

Downloads

// DOWNLOADS
$res = "results_mode=dl";
// CSV download
$group_dls[] =
    array(
        'type' => 'text',
        'href' => "overlay_holder.php?$res&dl_mode=csv&lboxreload=1&sf_conf=conf_mac_exportdownloadcsv",
        'css_class' => FALSE,
        'mkname' => 'csv',
        'lightbox' => 'lightbox|200'
);

And then put them in the toolbar conf array:

// Package these button groups up into a toolbar
$conf_results_nav =
    array(
        'tools' => $group_tools,
        'result_views' => $group_disp,
        'result_feeds' => $group_feeds,
        'result_downloads' => $group_dls,
);

Micro View (Record View)

These settings configure the micro view (or record view) page. The micro view requires configuration for the left panel, and record nav options as well as some general settings.

General Page Settings

Set the default page:

// Default Micro viewer page (used by search result handlers)
$conf_micro_viewer = $ark_dir."micro_view.php";

Micro View Left Panel

Configures the left panel in the micro view pages, requires the administrator to configure the lpanel with either Option 1 (linklists) or Option 2 (subforms). Requires the $mvlpoutput to be set, and when using the subform option requires the 'ark_page' to be set to 'micro_view' in the sf_module.

Subforms Option Example

Define the configuration type:

$mvlpoutput = 'subforms';

Configure the subform module to include the relevant modules:

$mvlp_subform_module =
    array(
        'view_state' => 'max',
        'edit_state' => 'view',
        'sf_nav_type' => 'none',
        'sf_title' => 'mvlpmodlist', 
        'sf_html_id' => 'mvlpmodlist', // Must be unique
        'script' => 'php/subforms/sf_module.php',
        'ark_page'=> 'micro_view',
        'fields' => array (
            'cxt',
            'smp',
            'spf',
            'sph'
            )
); 

Load the subform:

$micro_view_left_panel =
    array(
        'col_id' => 'mvlp',
        'col_alias' => FALSE,
        'col_type' => 'primary_col',
        'subforms' =>
            array(
                $mvlp_subform_module
        )
);