Basic Plugin

You are here:
< Back

<?php
/**
* Plugin template for ClinDATC Free/Plus Version 2.x
* Author: Mike Goh, ClinDATC developer
* Last update: 2016-01-13
*/

/**
* Declare plugin variables
* If main plugin filename is jquery-report.php; directory name must be jquery-report E.g. /jquery-report/jquery-report.php
* $plugin_id: UNIQUE identifier in ClinDATC plugin library
* "menu location": MAIN menus: Questionnaires, Participants, Study | TAB menus: Register New, Users & Groups, Tools, Settings, Developer Tools
*/
$plugin_id = "";
$plugin_name = "";
$plugin_description = "";
$plugin_version = "";
$plugin_by = '';
$plugin_details = '';
$plugin_menu = array("menu location"=>"menu name");

/**
* INCLUDE external files in other pages (if plugin is to add features to other pages)
* include positions in a page: in_head, before_topNav, before_content, after_content
*/
$plugin_includes = array(
//"in_header"=>array("external-style.css"),
//"before_topNav"=>array("file1.php", "file2.php"),
//"before_content"=>array("file3.php"),
//"after_content"=>array("file4.php"),
);

/**
* INSERT codes between <head>(here)</head> OR in <body (here)> tag
*/
$custom_head = ''; // <head>(here)</head>
$custom_body = ''; // <body (here)>

get_header($plugin_name, $custom_head, $custom_body); // REQUIRED (but can redefine $plugin_name to other)
get_topNav($login); // REQUIRED (unless skip top nav display e.g. for more view space)

/**
* Action on <form> submit
*/
if (isset($_POST['submit'])) {
//...
//...
}
?>

<div id="content" class="container"><!-- container -->

<!-- Page header -->
<div class="page-header">
<h2><?php echo $plugin_name; ?></h2>
</div>

<!-- Tab nav -->
<?php echo tools_tabs_nav(); ?>
<br><!-- line break between tab nav and Bootstrap alerts -->

<!-- <form> setup -->
<form class="form-horizontal" method="post" action="?plugin=<?php echo $plugin_id; ?>">
...
...
</form>

</div><!-- container -->