-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathj16000channelmanagement_framework_resource_sanity_checks.class.php
executable file
·72 lines (57 loc) · 2.35 KB
/
j16000channelmanagement_framework_resource_sanity_checks.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* Jomres CMS Agnostic Plugin
* @author Woollyinwales IT <sales@jomres.net>
* @version Jomres 9
* @package Jomres
* @copyright 2005-2020 Vince Wooll
* Jomres (tm) PHP files are released under both MIT and GPL2 licenses. This means that you can choose the license that best suits your project.
**/
// ################################################################
defined( '_JOMRES_INITCHECK' ) or die( 'Direct Access to this file is not allowed.' );
// ################################################################
class j16000channelmanagement_framework_resource_sanity_checks{
function __construct($componentArgs)
{
// Must be in all minicomponents. Minicomponents with templates that can contain editable text should run $this->template_touch() else just return
$MiniComponents =jomres_getSingleton('mcHandler');
if ($MiniComponents->template_touch)
{
$this->template_touchable=false; return;
}
$ePointFilepath = get_showtime('ePointFilepath');
$output = array();
$pageoutput = array();
$output['CHANNELMANAGEMENT_FRAMEWORK_SANITY_CHECKS_TITLE'] = jr_gettext('CHANNELMANAGEMENT_FRAMEWORK_SANITY_CHECKS_TITLE','CHANNELMANAGEMENT_FRAMEWORK_SANITY_CHECKS_TITLE',false);
// Find any issues reported by channel management plugins
$MiniComponents->triggerEvent('21150');
$issues= get_showtime('channel_sanity_checks_errors');
if (!empty($issues) ) {
$rows = array();
foreach ($issues as $issue) {
$rows[]= array ("issue" => $issue);
}
$pageoutput[] = $output;
$tmpl = new patTemplate();
$tmpl->addRows( 'pageoutput', $pageoutput );
$tmpl->addRows( 'rows', $rows );
$tmpl->setRoot( $ePointFilepath.'templates'.JRDS.find_plugin_template_directory() );
$tmpl->readTemplatesFromInput( 'channelmanagement_sanity_checks_errors.html' );
echo $tmpl->getParsedTemplate();
} else {
// Show the whoopee everything is fine template
$pageoutput[] = $output;
$tmpl = new patTemplate();
$tmpl->addRows( 'pageoutput', $pageoutput );
$tmpl->addRows( 'rows', $tasks );
$tmpl->setRoot( $ePointFilepath.'templates'.JRDS.find_plugin_template_directory() );
$tmpl->readTemplatesFromInput( 'channelmanagement_sanity_checks_no_errors.html' );
echo $tmpl->getParsedTemplate();
}
}
// This must be included in every Event/Mini-component
function getRetVals()
{
return null;
}
}