PHP_SMART_HOME_V3/app/templates/scene.phtml

68 lines
2.3 KiB
PHTML
Raw Normal View History

2019-08-23 11:39:42 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<?php
$partial = new Partial('head');
2019-10-11 14:38:20 +00:00
$partial->prepare('baseDir', $BASEDIR);
2019-08-23 11:39:42 +00:00
$partial->render();
?>
<title><?php echo $TITLE ?></title>
</head>
<body class="no-transitions">
<div class="row no-gutters main">
<div class="col-md-3 d-sm-none"></div>
<div class="col-md-3 nav-container">
2019-09-19 12:48:31 +00:00
<?php
$partial = new Partial('menu');
$partial->prepare('item', 'scene');
2019-10-11 12:12:05 +00:00
$partial->prepare('langMng',$LANGMNG);
2020-01-17 09:27:51 +00:00
$partial->prepare('debugMod',$DEBUGMOD);
2019-09-19 12:48:31 +00:00
$partial->render();
?>
2019-08-23 11:39:42 +00:00
</div>
<div class="col-md-9 main-body">
2019-10-11 12:12:05 +00:00
<a class="button is-primary m-1" onClick="$('#modal').removeClass('modal-container-hiden').show();"><?php $LANGMNG->echo('t_createScene');?></a>
2019-08-23 11:39:42 +00:00
<div class="row no-gutters">
2020-01-17 09:27:51 +00:00
<?php foreach ($SCENES as $sceneId => $sceneData) {
2019-08-24 11:13:04 +00:00
//BUTTON
$partialScenButton = new Partial('sceneButton');
2019-10-11 12:12:05 +00:00
$partialScenButton->prepare('langMng', $LANGMNG);
2019-08-24 11:13:04 +00:00
$partialScenButton->prepare('sceneId', $sceneId);
$partialScenButton->prepare('sceneData', $sceneData);
2020-01-17 09:27:51 +00:00
2019-08-24 11:13:04 +00:00
$partialScenButton->render();
2020-01-17 09:27:51 +00:00
2019-08-23 11:39:42 +00:00
// Edit
$partialSceneEdit = new Partial('sceneEdit');
2019-10-11 12:12:05 +00:00
$partialSceneEdit->prepare('langMng',$LANGMNG);
2019-08-23 11:39:42 +00:00
$partialSceneEdit->prepare('sceneId',$sceneId);
$partialSceneEdit->prepare('scene',$sceneData);
2020-01-17 09:27:51 +00:00
2019-08-23 11:39:42 +00:00
$partialSceneEdit->render();
?>
<?php } ?>
</div>
</div>
</div>
2020-01-17 09:27:51 +00:00
2019-10-13 08:07:03 +00:00
<?php if (isset($_POST['submit'])) {
$partial = new Partial('sceneCreateFinal');
2019-10-11 12:12:05 +00:00
$partial->prepare('langMng',$LANGMNG);
2019-08-23 11:39:42 +00:00
$partial->prepare('setStateFormDevices',$SETSTATEFORMDEVICES );
$partial->prepare('sceneIcon',$SCENEICON );
$partial->prepare('SceneName',$SCENENAME );
2020-01-17 09:27:51 +00:00
2019-08-23 11:39:42 +00:00
$partial->render();
} else {
$partial = new Partial('sceneCreate');
2019-10-11 12:12:05 +00:00
$partial->prepare('langMng',$LANGMNG);
2019-08-23 11:39:42 +00:00
$partial->prepare('subDevices',$SUBDEVICES);
2020-01-17 09:27:51 +00:00
2019-08-23 11:39:42 +00:00
$partial->render();
2020-01-17 09:27:51 +00:00
}
2019-08-23 11:39:42 +00:00
$partial = new Partial('footer');
$partial->render();
?>
</body>
2020-01-17 09:27:51 +00:00
</html>