Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergejey committed Sep 23, 2019
1 parent 375df23 commit 9adc72c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
20 changes: 12 additions & 8 deletions 3rdparty/googleblockly/blocks/majordomo_states.js.php
Expand Up @@ -36,29 +36,33 @@
include_once("./config.php"); include_once("./config.php");
include_once("./lib/loader.php"); include_once("./lib/loader.php");


$session=new session("prj"); $session = new session("prj");


include_once("./load_settings.php"); include_once("./load_settings.php");
include_once(DIR_MODULES . "control_modules/control_modules.class.php"); include_once(DIR_MODULES . "control_modules/control_modules.class.php");


$objects = getObjectsByClass('OperationalModes'); $objects = getObjectsByClass('OperationalModes');


foreach($objects as $object) {
$object = SQLSelectOne("SELECT * FROM objects WHERE ID=".$object['ID']); foreach($objects as $object) {
?> $object = SQLSelectOne("SELECT * FROM objects WHERE ID=" . $object['ID']);
if (!$object['DESCRIPTION']) {
$object['DESCRIPTION']=$object['TITLE'];
}
?>


Blockly.Blocks['majordomo_<?php echo $object['TITLE']?>'] = { Blockly.Blocks['majordomo_<?php echo $object['TITLE']?>'] = {
init: function() { init: function () {
var thisBlock = this; var thisBlock = this;
this.setColour(220); this.setColour(220);
this.appendDummyInput() this.appendDummyInput()
.appendField('<?php echo addcslashes($object['DESCRIPTION'],"'")?>'); .appendField('<?php echo addcslashes($object['DESCRIPTION'], "'")?>');
this.setOutput(true); this.setOutput(true);
this.setTooltip(''); this.setTooltip('');
} }
}; };


<?php <?php
} }


$session->save(); $session->save();
2 changes: 1 addition & 1 deletion modules/objects/objects.class.php
Expand Up @@ -511,7 +511,7 @@ function callMethodSafe($name, $params = 0)


$call_stack[] = $current_call; $call_stack[] = $current_call;
if (!is_array($params)) { if (!is_array($params)) {
$params = array($params); $params = array();

This comment has been minimized.

Copy link
@zimur

zimur Sep 23, 2019

Contributor

Обнуление параметров намеренно вернул или случайно?

This comment has been minimized.

Copy link
@sergejey

sergejey Sep 24, 2019

Author Owner

Намеренно. Будем считать что это всегда должен быть массив, что б не "кто в лес кто по дрова". Там где передаётся не массив, а одно значение, будем исправлять (начал с модуля MQTT).

This comment has been minimized.

Copy link
@zimur

zimur Sep 24, 2019

Contributor

Может тогда здесь имеет смысл assertion поставить? А то как-то не правильно, что параметр молча обнуляется по дороге и просто исчезает.

} }
$params['m_c_s'] = $call_stack; $params['m_c_s'] = $call_stack;
$result = callAPI('/api/method/' . urlencode($this->object_title . '.' . $name), 'GET', $params); $result = callAPI('/api/method/' . urlencode($this->object_title . '.' . $name), 'GET', $params);
Expand Down
7 changes: 6 additions & 1 deletion modules/xray/xray.class.php
Expand Up @@ -445,6 +445,11 @@ function admin(&$out)
} }
*/ */
} }

if ($cmd!='') {
$this->redirect(ROOTHTML."panel/xray.html?view_mode=".$this->view_mode);
}

} }
if ($this->view_mode == 'timers') { if ($this->view_mode == 'timers') {
global $cmd; global $cmd;
Expand Down Expand Up @@ -548,7 +553,7 @@ function admin(&$out)


header("HTTP/1.0: 200 OK\n"); header("HTTP/1.0: 200 OK\n");
header('Content-Type: text/html; charset=utf-8'); header('Content-Type: text/html; charset=utf-8');
$limit = $out['LIMIT']; $limit = $out['LINES'];
$filter = $out['FILTER']; $filter = $out['FILTER'];
if (!$limit) { if (!$limit) {
$limit = 50; $limit = 50;
Expand Down
3 changes: 2 additions & 1 deletion templates/scripts/scripts_edit.html
Expand Up @@ -11,7 +11,8 @@
[#if ID=""#] [#if ID=""#]
<#LANG_NEW_SCRIPT#> <#LANG_NEW_SCRIPT#>
[#else#] [#else#]
<#LANG_EDIT_RECORD#> <#LANG_EDIT_RECORD#>:
<a href="?view_mode=<#VIEW_MODE#>&id=[#ID#]">[#TITLE#]</a>
[#endif#] [#endif#]
</li> </li>
</ul> </ul>
Expand Down

0 comments on commit 9adc72c

Please sign in to comment.