Skip to content

Commit

Permalink
minor patches and one bug fix around project_id
Browse files Browse the repository at this point in the history
  • Loading branch information
123andy committed Mar 31, 2023
1 parent 40dfc45 commit d13dbdc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
3 changes: 1 addition & 2 deletions ExternalModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
namespace ImageMap\ExternalModule;

use ExternalModules\AbstractExternalModule;
use ExternalModules\ExternalModules;
use Form;


Expand Down Expand Up @@ -66,7 +65,7 @@ private function injectImageMaps() {
if (empty($row)) {
// The specified imagemap is not defined
\REDCap::logEvent("Missing ImageMap", "$imagemap_name is defined for field $field_name but does not exist.",
"", "", "", $project_id);
"", "", "", $this->getProjectId());
continue;
}

Expand Down
3 changes: 0 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"name": "Image Map",
"namespace": "ImageMap\\ExternalModule",
"description": "This module replaces an input, radio, or checkbox field with an interactive image where users can click on image regions to select one or more field options. Find the complete <b><a href='https://github.com/ctsit/imagemap' target='_blank'>documentation</a></b> and an example instrument at <a href='https://github.com/ctsit/imagemap/blob/master/docs/Instrument%20Example.zip' target='_blank'>https://github.com/ctsit/imagemap</a>.",
"permissions": [
"redcap_every_page_top"
],
"framework-version": 9,
"authors": [
{
Expand Down
21 changes: 8 additions & 13 deletions documentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
table.detail textarea {
width: 100%;
resize: auto;
resize: unset;
}
span.copy {float:right;margin-right: -10px;}

Expand Down Expand Up @@ -81,7 +81,7 @@
?>
<tr>
<td>
<img class='preview' src='<?php echo $module->getUrl( $detail['image'] ) ?>'/>
<img class='preview' src='<?php echo $module->getUrl( $detail['image'] ) ?>' alt=""/>
</td>
<td>
<table class='detail'>
Expand Down Expand Up @@ -125,24 +125,19 @@

<h4>How can I make my own images?</h4>
<p>
You must have a png image file AND create a html file containing <code>area</code> tags. An example area file is below:
You must have a png image file AND create a html file containing <code>area</code> tags. An example area file is below:</p>
<pre class="code"><?php echo htmlspecialchars( file_get_contents($module->getModulePath() .'maps/smile_scale.html', false, null, 0, 200)) ?></pre>
The value for the data-key attribute will be the value stored in REDCap - either as radio/checkbox keys or in a text box. Currently you must submit these files to our git repo - in the future we may add the ability to insert those files into the External Module as parameters.
<p>The value for the data-key attribute will be the value stored in REDCap - either as radio/checkbox keys or in a text box. Currently, you must submit these files to our git repo - in the future we may add the ability to insert those files into the External Module as parameters.
</p>

<script src="https://cdn.jsdelivr.net/npm/clipboard@1/dist/clipboard.min.js"></script>

<script>
new Clipboard('.copy', {
text: function(trigger) {
var tr = $(this).parentsUntil('tr').parent();
var target = $('.copy-target',tr);
var text = target.text();
return text;
text: function() {
const tr = $(this).parentsUntil('tr').parent();
const target = $('.copy-target',tr);
return target.text();
}
});

// $('.copy').bind('click', function() {
//
// });
</script>

0 comments on commit d13dbdc

Please sign in to comment.