コード例 #1
0
ファイル: jeedom.ajax.php プロジェクト: GaelGRIFFON/core
     ajax::success();
 }
 if (init('action') == 'haltSystem') {
     ajax::success(jeedom::haltSystem());
 }
 if (init('action') == 'rebootSystem') {
     ajax::success(jeedom::rebootSystem());
 }
 if (init('action') == 'forceSyncHour') {
     ajax::success(jeedom::forceSyncHour());
 }
 if (init('action') == 'doUPnP') {
     if (config::byKey('allowupnpn') != 1) {
         throw new Exception(__('Vous devez d\'abord activer l\'UPnP avant de forcer sa mise en place', __FILE__));
     }
     ajax::success(jeedom::doUPnP());
 }
 if (init('action') == 'saveCustom') {
     $path = dirname(__FILE__) . '/../../';
     if (init('version') != 'desktop' && init('version') != 'mobile') {
         throw new Exception(__('La version ne peut etre que desktop ou mobile', __FILE__));
     }
     if (init('type') != 'js' && init('type') != 'css') {
         throw new Exception(__('La version ne peut etre que js ou css', __FILE__));
     }
     $path .= init('version') . '/custom/';
     if (!file_exists($path)) {
         mkdir($path);
     }
     $path .= 'custom.' . init('type');
     if (file_exists($path)) {