Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/patientapps_www/modules/patientapps/view/ |
Upload File : |
<?php
class PatientApps_View extends View {
public function render_index() {
$css = <<<BLOCK
.patientapps select {
width: 500px;
}
.patientapps select[name="branch"] option {
font-size: 14pt;
padding: 3px;
}
BLOCK;
$id = $this->IncludeFile('')
->depends('jquery');
$id->AddCSS($css);
$js = <<<BLOCK
$(document).on('loaded.template', function(e) {
$('.patientapps select[name="branch"]').on('change', function(e) {
var branch = $(this).val();
document.location.href = '/patientapps/branch/' + branch;
});
});
BLOCK;
$id->JavascriptCommand($js, FALSE);
$html = <<<BLOCK
<div class="indented patientapps">
<h3>{{page_title}}</h3>
<p>Please select a PatientApps Branch</p>
<div class="controls"><select class="required" id="branch" name="branch" size="20">{{#each branches}}
<option value="{{this}}">{{this}}</option>
{{/each}}</select></div>
</div>
BLOCK;
$this('patientapp_index')->html($html)->title('PatientApps Builds');
}
public function render_branch() {
$html = <<<BLOCK
<form method="POST">
<div class="indented patientapps">
<h3>{{page_title}}</h3>
<p>Title: <strong title="extracted from home.html">{{title}}</strong></p>
<p>Short Title: <strong title="extracted from manifest.json">{{title_short}}</strong> [<span title="output filename is based on this. make sure it is not 'unknown'">{{product}}</span>]</p>
<p>Latest Commit: <strong>{{fullhash}}</strong></p>
<p>Visit Website <a href="{{website}}/" target="_blank">{{website}}</a></p>
<p><a href="/patientapps/generate/{{fullhash}}/{{branch}}" title="this will take a minute or two for the first time while audio is transcribed">Generate PatientApps.net Files</a></p>
<p><a href="https://{{preview}}/?procedure={{product}}&preview=1#/" target="_blank">Preview website</a> - Generate must be run first.</p>
<p><a href="/patientapps/images/{{fullhash}}" target="_blank">Display Images</a></p>
<p><a href="/patientapps/unreferenced/{{fullhash}}" target="_blank">Unreferenced Images</a></p>
<p><a href="/patientapps/ionic-import/{{fullhash}}" target="_blank">View Ionic Import results</a></p>
<fieldset><legend> Procedure Settings </legend>
<div>
<p><label title="ignore supplied audio when checked"><input type="checkbox" name="ignore_audio" value="1"{{#if ignore_audio}}checked{{/if}}> Adios Audio</label></p>
<p><label title="enable tracking"><input type="checkbox" name="tracking" value="1"{{#if tracking}}checked{{/if}}> Tracking?</label> (should be enabled)</p>
<p><label title="show message to physicians. This useless page should ONLY be enabled for SAMPLES"><input type="checkbox" name="physicians" value="1"{{#if physicians}}checked{{/if}}> include Message to Physicians?</label></p>
</div>
<div style="text-align:right">
{{#if publish}}<input type="button" value="Publish" title="This will run a 'Generate' first" class="action-publish" href="/patientapps/publish/{{fullhash}}/{{branch}}"> |{{/if}}
<input type="submit" value="Update">
</div>
</fieldset>
<p>view patient feedback | check for errors</p>
<p>[x] bugs exists for this product - go to bug tracker</p>
{{#if filelist}}
<h4>Files for patientsapps.net</h4>
<table>
<tr><td width="200"><strong>Name</strong></td><td width="150"><strong>Last modified</strong></td><td width="100" align="right"><strong>Size</strong></td><td width="10"></td><td><strong>Description</strong></td></tr>
{{#each filelist}}
<tr><td>{{#if link}}<a href="{{link}}" target="_blank">{{name}}</a>{{else}}{{name}}{{/if}}</td><td>{{date}}</td><td title="{{fs}} bytes" align="right">{{size}}</td><td></td><td>{{{action}}}</td></tr>
{{/each}}
</table>
{{/if}}
</div>
</form>
BLOCK;
$this('patientapp_branch')->html($html)->title('PatientApps Branch');
}
public function render_image() {
$base = $this->StaticUriModule(dirname(__DIR__));
$id = $this->IncludeFile($base . '/dropzone.min.js');
$css = <<<BLOCK
.thumbframe {
display: inline-block;
border: 5px outset #4096A4;
background-color: #CFEDCE;
margin: 15px 10px;
}
/* these sizes include 10px for the border */
.thumbframe.i {
width: 370px;
height: 280px;
}
.thumbframe.b {
width: 610px;
height: 205px;
}
.thumbframe.c {
width: 270px;
height: 205px;
}
.thumbframe.error {
border-color: #f00;
}
.thumbframe.dz-drag-hover {
border-style: dashed;
}
.thumbimage {
height: 100%;
align-items: center;
justify-content: center;
display: flex;
}
.thumbimage img.landscape {
width: 100%;
}
.thumbimage img.portrait {
height: 100%;
}
.thumbcaption {
text-align: center;
padding: 8px 0;
}
div.dz-preview.dz-file-preview {
display: none;
}
BLOCK;
$id = $this->IncludeFile('');
$id->AddCSS($css);
// fullhash is used to determine the product being updated
$javascript = <<<'BLOCK'
$(document).on('loaded.template', function() {
$('div.thumbframe').each(function() {
let $zone = $(this);
let name = $zone.data('name');
let fullhash = $zone.data('fullhash');
$zone.dropzone({
paramName: 'file[' + name + ']',
url: '/patientapps/override/' + fullhash,
createImageThumbnails: false,
complete: function(file) {
let response = file.xhr.responseText;
let obj = jQuery.parseJSON(response);
for(let i = 0; i < obj.images.length; i++) {
let img = obj.images[i];
let $placeholder = $('div.thumbframe[data-name="' + img.name + '"]');
$placeholder.find('div.thumbcaption').html(img.caption);
let href = $placeholder.find('img').attr('src');
const url = new URL(href, document.location.href);
url.searchParams.set('_', Math.floor(Date.now() / 1000));
$placeholder.find('img').attr('src', url.toString());
}
},
});
});
$('input.action-publish').on('click', function(e) {
var $this = $(this);
e.preventDefault();
window.location.href = $this.attr('href');
});
});
BLOCK;
$id->JavascriptCommand($javascript, FALSE);
// https://www.dropzonejs.com/#installation
// <input class="droparea" type="file" name="file[{{hash}}]">
$html = <<<BLOCK
<h3>{{page_title}}</h3>
<p>Drag-and-drop new images to replace the ones included below</p>
<h4>Page Banners</h4>
<div class="thumbs">
<p>The first column is for larger screens, the second for screens less than 440px wide</p>
{{#each thumb_b}}
<div class="image-group">
{{#with a}}
<div class="thumbframe b{{#if error}} error{{/if}}" data-fullhash="{{../../fullhash}}" data-name="{{name}}" title="{{original}}">
<a class="thumbimage" href="/patientapps/images/{{../../fullhash}}/{{name}}" target="_blank"><img
class="{{class}}" src="/patientapps/images/{{../../fullhash}}/{{name}}?wd={{wd0}}"></a>
<div class="thumbcaption">
{{name}}, {{mime}}<br>{{wd}} × {{ht}}{{res}}, {{fs}} {{{related}}}
</div>
</div>
{{/with}}
{{#with b}}
<div class="thumbframe c{{#if error}} error{{/if}}" data-fullhash="{{../../fullhash}}" data-name="{{name}}" title="{{original}}">
<a class="thumbimage" href="/patientapps/images/{{../../fullhash}}/{{name}}" target="_blank"><img
class="{{class}}" src="/patientapps/images/{{../../fullhash}}/{{name}}?wd={{wd0}}"></a>
<div class="thumbcaption">
{{name}}, {{mime}}<br>{{wd}} × {{ht}}{{res}}, {{fs}} {{{related}}}
</div>
</div>
{{/with}}
</div>
{{/each}}
</div>
<h4>Illustrations</h4>
<div class="thumbs">
{{#each thumb_i}}
<div class="thumbframe i{{#if error}} error{{/if}}" data-fullhash="{{../fullhash}}" data-name="{{name}}" title="{{original}}">
<a class="thumbimage" href="/patientapps/images/{{../fullhash}}/{{name}}" target="_blank"><img
class="{{class}}" src="/patientapps/images/{{../fullhash}}/{{name}}?wd={{wd0}}"></a>
<div class="thumbcaption">
{{name}}, {{mime}}<br>{{wd}} × {{ht}}{{res}}, {{fs}}
</div>
</div>
{{/each}}
</div>
BLOCK;
$this('patientapp_image')->html($html)->title('Images');
}
public function render_orphan() {
$html = <<<BLOCK
<div class="indented">
<h3>{{page_title}}</h3>
{{#if external}}
<p>The following are external assets (no action required):</p>
<ul>{{#each external}}
<li>{{this}}</li>
{{/each}}</ul>
{{/if}}
{{#if missing}}
<p>The following assets are missing:</p>
<ul>{{#each missing}}
<li>{{this}}</li>
{{/each}}</ul>
{{/if}}
<p>The following assets do not appear to be used:</p>
<ul>{{#each asset}}
<li>{{filename}}</li>
{{/each}}</ul>
<br/><br/>
</div>
BLOCK;
$this('patientapp_orphan')->html($html)->title('Unreferenced Assets');
}
public function render_findfile() {
$button = hook_execute_late('html.button', '', 'Show History', 'far fa-search', 'cc-blue');
$html = <<<BLOCK
<div class="indented">
<h3>{{page_title}}</h3>
<form method="post" action="/patientapps/findfile" class="website-form frm">
<div class="control-group cf-public required">
<label for="filename">Full Pathname of File</label>
<div class="controls"><input id="filename" class="required" name="filename" size="30" type="text" value="{{filename}}" placeholder="src/pages/home/home.html" title="regexp is accepted here"></div>
<div class="status-message" for="filename"></div></div>
<br/>
<div class="form-buttons">
<div class="form-actions right"><a class="submit" href="#">$button</a></div>
</div>
</form>
<br/>
{{#if output}}
<hr>
{{{output}}}
{{/if}}
</div>
BLOCK;
$this('patientapp_findfile')->html($html)->title('Locate a File in the Repo');
}
public function render_similar() {
$html = <<<BLOCK
<div class="indented">
<h3>{{page_title}}</h3>
{{#each similar}}
<div>
<img src="/~/patientapps/img/{{basename}}" {{{dim}}}>
</div>
{{/each}}
</div>
BLOCK;
$this('patientapp_similar')->html($html)->title('Similar Images');
}
public function render_nagivation() {
$html = <<<BLOCK
<div class="indented">
<h3>{{page_title}}</h3>
<ul class="admin-list list-provider">
{{#each menu}}
<li><a href="{{href}}" class="adminButton"{{#if hint}} title="{{hint}}"{{/if}} target="_blank">{{#if icon}}{{{icon}}}{{else}}<i class="fas"></i>{{/if}}{{caption}}</a></li>
{{/each}}
</ul>
</div>
BLOCK;
$this('patientapp_nav')->html($html)->title('PatientApps');
}
}