Skip to content

Commit

Permalink
Templates fix
Browse files Browse the repository at this point in the history
* Fix for missing icon for device when selected
  • Loading branch information
sergejey committed Mar 21, 2021
1 parent 420c311 commit fc10f48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions lib/objects.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1170,15 +1170,14 @@ function processTitle($title, $object = 0)
for ($i = 0; $i < $total; $i++) {
$property_name = $m[1][$i] . '.' . $m[2][$i];
$data = getGlobal($property_name);
if ($data == '') $data = 0;
$descr = $m[3][$i];
$descr = preg_replace('#(?<!\\\)\;#', ";-;;-;", $descr);
$descr = preg_replace('#\\\;#', ";", $descr);
$tmp = explode(';-;;-;', $descr);
$totald = count($tmp);
$hsh = array();
if ($totald == 1) {
if ($data != 0) {
if ($data != '') {
$hsh[$data] = $descr;
} else {
$hsh[$data] = '';
Expand All @@ -1188,14 +1187,19 @@ function processTitle($title, $object = 0)
$item = trim($tmp[$id]);
if (preg_match('/(.*?)=(.+)/uis', $item, $md)) {
$search_value = $md[1];
if ($search_value=='') $search_value='<empty>';
$search_replace = $md[2];
} else {
$search_value = $id;
$search_value = $id.'';
$search_replace = $item;
}
$hsh[$search_value] = $search_replace;
}
if ($data == '') $data='0';
if ($data == '' && isset($hsh['<empty>'])) {
$data = '<empty>';
} elseif ($data == '') {
$data = '0';
}
}
$title = str_replace($m[0][$i], $hsh[$data], $title);
}
Expand Down
2 changes: 1 addition & 1 deletion templates/classes/views/SOpenable.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
$('.updatedText-JS-' + sID_%.object_id%).text(beautyText_%.object_id%);
});

var openable%.object_id%Level=parseInt('%.level%');
var openable%.object_id%Timer=0;
function sendNewLevel%.object_id%() {
Expand Down

0 comments on commit fc10f48

Please sign in to comment.