예제 #1
0
 public static function getExpressionOptions($_expression, $_options)
 {
     $startLoadTime = getmicrotime();
     $cmd = cmd::byId(str_replace('#', '', cmd::humanReadableToCmd($_expression)));
     if (is_object($cmd)) {
         $return['html'] = trim($cmd->toHtml('scenario', $_options));
     } else {
         try {
             $return['html'] = getTemplate('core', 'scenario', $_expression . '.default');
             if (is_json($_options)) {
                 $_options = json_decode($_options, true);
             }
             if (is_array($_options) && count($_options) > 0) {
                 foreach ($_options as $key => $value) {
                     $replace['#' . $key . '#'] = $value;
                 }
             }
             if (!isset($replace['#id#'])) {
                 $replace['#id#'] = rand();
             }
             $return['html'] = template_replace(cmd::cmdToHumanReadable($replace), $return['html']);
         } catch (Exception $e) {
         }
     }
     $replace = array('#uid#' => 'exp' . mt_rand());
     $return['html'] = translate::exec(template_replace($replace, $return['html']), 'core/template/scenario/' . $_expression . '.default');
     return $return;
 }
예제 #2
0
<?php

require_once dirname(__FILE__) . "/../../../../../core/php/core.inc.php";
include_file('core', 'authentification', 'php');
if (!isConnect()) {
    echo '<div class="alert alert-danger div_alert">';
    echo translate::exec('401 - Accès non autorisé');
    echo '</div>';
    die;
}
?>
<legend>Mémoires du clavier</legend>
<div class="alert alert-info">
            Info : <br/>
            - Ce tableau vous permet de visualiser les mémoires occupées sur votre clavier<br/>
			- Pour enregistrer un nouveau code cliquez sur le bouton Vert sur la mémoire désirée et suivez les étapes<br/>
			- Le zipato ne permet pas de supprimer une mémoire, cependant vous pouvez remplacer le code d'une mémoire exsitante<br/>
			- Il est impossible d'enregistrer le même code/badge sur deux mémoires différentes<br/>
			- Il est est impossible (par mesure de sécurité) de lire la valeur d'un code enregistré<br/>
			- Pour vider toutes vos mémoires, vous pouvez exclure et inclure le module<br/>
        </div>
<table class="table table-condensed table-bordered">
	<thead>
		<tr>
			<th>1</th>
			<th>2</th>
			<th>3</th>
			<th>4</th>
			<th>5</th>
			<th>6</th>
			<th>7</th>
예제 #3
0
파일: getJS.php 프로젝트: GaelGRIFFON/core
 *
 * Jeedom is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Jeedom. If not, see <http://www.gnu.org/licenses/>.
 */
require_once dirname(__FILE__) . "/core.inc.php";
$file = dirname(__FILE__) . "/../../" . init('file');
$pathinfo = pathinfo($file);
if ($pathinfo['extension'] != 'js') {
    die;
}
if (file_exists($file)) {
    header('Content-Type: application/javascript');
    $lastModified = filemtime($file);
    $etagFile = md5_file($file);
    $ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : false;
    $etagHeader = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? trim($_SERVER['HTTP_IF_NONE_MATCH']) : false;
    header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastModified) . " GMT");
    header("Etag: {$etagFile}");
    header('Cache-Control: public');
    if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $lastModified || $etagHeader == $etagFile) {
        header("HTTP/1.1 304 Not Modified");
        exit;
    }
    echo translate::exec(file_get_contents($file), init('file'), true);
    exit;
}
예제 #4
0
function include_file($_folder, $_fn, $_type, $_plugin = '')
{
    $type = '';
    if ($_folder == '3rdparty') {
        $_folder = $_folder;
        $_fn = $_fn . '.' . $_type;
        $path = dirname(__FILE__) . "/../../{$_folder}/{$_fn}";
        if ($_type == 'css') {
            $type = 'css';
        } else {
            if ($_type == 'js') {
                $type = 'js';
            } else {
                $type = 'php';
            }
        }
    } else {
        if ($_type == 'class') {
            $_folder .= '/class';
            $_fn = $_fn . '.class.php';
            $type = 'php';
        }
        if ($_type == 'com') {
            $_folder .= '/com';
            $_fn = $_fn . '.com.php';
            $type = 'php';
        }
        if ($_type == 'config') {
            $_folder .= '/config';
            $_fn = $_fn . '.config.php';
            $type = 'php';
        }
        if ($_type == 'modal') {
            $_folder = $_folder . '/modal';
            $_fn = $_fn . '.php';
            $type = 'php';
        }
        if ($_type == 'php') {
            $_folder = $_folder . '/php';
            $_fn = $_fn . '.php';
            $type = 'php';
        }
        if ($_type == 'css') {
            $_folder = $_folder . '/css';
            $_fn = $_fn . '.css';
            $type = 'css';
        }
        if ($_type == 'js') {
            $_folder = $_folder . '/js';
            $_fn = $_fn . '.js';
            $type = 'js';
        }
        if ($_type == 'class.js') {
            $_folder = $_folder . '/js';
            $_fn = $_fn . '.class.js';
            $type = 'js';
        }
        if ($_type == 'custom.js') {
            $_folder = $_folder . '/custom';
            $_fn = $_fn . 'custom.js';
            $type = 'js';
        }
        if ($_type == 'custom.css') {
            $_folder = $_folder . '/custom';
            $_fn = $_fn . 'custom.css';
            $type = 'css';
        }
        if ($_type == 'api') {
            $_folder .= '/api';
            $_fn = $_fn . '.api.php';
            $type = 'php';
        }
        if ($_type == 'html') {
            $_folder .= '/html';
            $_fn = $_fn . '.html';
            $type = 'php';
        }
        if ($_type == 'configuration') {
            $_folder .= '';
            $_fn = $_fn . '.php';
            $type = 'php';
        }
    }
    if ($_plugin != '') {
        $_folder = 'plugins/' . $_plugin . '/' . $_folder;
    }
    $path = dirname(__FILE__) . "/../../{$_folder}/{$_fn}";
    if (file_exists($path)) {
        if ($type == 'php') {
            ob_start();
            require_once $path;
            echo translate::exec(ob_get_clean(), "{$_folder}/{$_fn}");
        } else {
            if ($type == 'css') {
                echo "<link href=\"{$_folder}/{$_fn}?md5=" . md5_file($path) . "\" rel=\"stylesheet\" />";
            } else {
                if ($type == 'js') {
                    echo "<script type=\"text/javascript\" src=\"core/php/getJS.php?file={$_folder}/{$_fn}&md5=" . md5_file($path) . "\"></script>";
                }
            }
        }
    } else {
        throw new Exception("File not found : {$_fn} at {$_folder} : {$path}", 35486);
    }
}
예제 #5
0
파일: index.php 프로젝트: GaelGRIFFON/core
     if (isset($_GET['ajax']) && $_GET['ajax'] == 1) {
         include_file('core', 'authentification', 'php');
         try {
             if (!isConnect()) {
                 throw new Exception('{{401 - Accès non autorisé}}');
             }
             include_file('desktop', init('p'), 'php', init('m'));
         } catch (Exception $e) {
             $_folder = 'desktop/php';
             if (init('m') != '') {
                 $_folder = 'plugins/' . init('m') . '/' . $_folder;
             }
             ob_end_clean();
             //Clean pile after expetion (to prevent no-traduction)
             echo '<div class="alert alert-danger div_alert">';
             echo translate::exec(displayExeption($e), $_folder . '/' . init('modal') . '.php');
             echo '</div>';
         }
         die;
     } else {
         include_file('desktop', 'index', 'php');
         die;
     }
 } else {
     if ($_GET['v'] == "m") {
         if (isset($_GET['modal'])) {
             include_file('mobile', init('modal'), 'modal', init('plugin'));
         } else {
             if (isset($_GET['p']) && isset($_GET['ajax'])) {
                 if (isset($_GET['m'])) {
                     include_file('mobile', $_GET['p'], 'html', $_GET['m']);