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/theyoungdesigners_com/modules/jstree/ |
Upload File : |
<?php
namespace modules\jstree;
class main extends \moduleMain {
private $active = FALSE;
public function __construct() {
parent::__construct(__DIR__);
}
public function Activate() {
hook_add('component.add', [$this, '__component']);
hook_add('html.prepare', [$this, '__html_prepare']);
}
public function __component(&$status, $requested) {
if ($requested == 'jstree') {
$this->active = TRUE;
$status = TRUE;
}
}
public function __html_prepare($modulemain) {
$base = $modulemain->StaticUriModule(__DIR__);
$id = $modulemain->IncludeFile($base . '/default/style.min.css');
$css = <<<BLOCK
.jstree-anchor {
cursor: pointer;
color: #999;
}
.jstree-anchor .sitelink {
text-decoration: none;
font-weight: bold;
color: #555;
}
.jstree-anchor a.sitelink {
color: #00E;
}
BLOCK;
$id->AddCSS($css);
$id = $modulemain->IncludeFile($base . '/jstree.min.js');
$javascript = <<<BLOCK
function _create_prototype_node() {
var _node = document.createElement('LI'), _temp1, _temp2;
_node.setAttribute('role', 'treeitem');
_temp1 = document.createElement('I');
_temp1.className = 'jstree-icon jstree-ocl';
_temp1.setAttribute('role', 'presentation');
_node.appendChild(_temp1);
_temp1 = document.createElement('SPAN');
_temp1.className = 'jstree-anchor';
_temp1.setAttribute('href','#');
_temp1.setAttribute('tabindex','-1');
_temp2 = document.createElement('I');
_temp2.className = 'jstree-icon jstree-themeicon';
_temp2.setAttribute('role', 'presentation');
_temp1.appendChild(_temp2);
_node.appendChild(_temp1);
_temp1 = _temp2 = null;
return _node;
}
$(document).on('loaded.template', function() {
$('.jstree').each(function() {
var \$tree = $(this);
\$tree.bind('loading.jstree', function (e, data) {
data.instance._data.core.node = _create_prototype_node();
// }).on('click.jstree', '.jstree-anchor', function (e) {
// e.stopImmediatePropagation();
}).on('load_node.jstree', function(e, jstree) {
var info = jstree.instance._model.data;
$.each(info, function(key, value) {
if (typeof value.data != 'undefined' && value.parent != '#') { // have data, so attach
info[key].li_attr['data-data'] = value.data;
}
});
}).on('ready.jstree refresh.jstree', function(e, jstree) {
var info = jstree.instance._model.data;
$.each(info, function(key, value) {
if (typeof value.data != 'undefined' && value.parent == '#') {
\$element = $('#' + key);
if (\$element.length) {
\$element.attr('data-data', value.data);
}
}
});
});
var href = \$tree.attr('href');
\$tree.jstree({
'core' : {
'data' : {
'url' : href ,
'data' : function (node) {
return { 'id' : node.id };
}
}
}
});
});
}).on('page.refresh', function(e, data) {
if (typeof data.jstree != 'undefined') {
$('.jstree').each(function() {
var \$tree = $(this);
var jstree = \$tree.jstree(true);
jstree.refresh();
});
}
});
BLOCK;
$id->JavascriptCommand($javascript)->depends('jquery');
}
}