Skip to content

Commit

Permalink
Merge pull request #23 from JEALG/master
Browse files Browse the repository at this point in the history
Update V4 + Debian 10
  • Loading branch information
Anakins committed Jun 19, 2020
2 parents 8d0b3f5 + dee1e61 commit f9cb7b2
Show file tree
Hide file tree
Showing 194 changed files with 23,761 additions and 5,300 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -45,3 +45,4 @@ $RECYCLE.BIN/
Network Trash Folder
Temporary Items
.apdisk
.vscode/settings.json
1 change: 0 additions & 1 deletion 3rparty/readme

This file was deleted.

8 changes: 5 additions & 3 deletions README.md
@@ -1,5 +1,8 @@
# jeedom_Horoscope
Plugin Horoscope pour Jeedom - En développement.
<img align="right" src="plugin_info/horoscope_icon.png" width="150">

# Jeedom - Horoscope

Plugin Horoscope pour Jeedom

Ce plugin a pour but de pouvoir donner l'horoscope chaque jour via une petite phrase.

Expand All @@ -8,4 +11,3 @@ Il suffit de créer une personne (un équipement) et de lui affecter un signe du
La phrase sera ensuite générée via le biais d'un site internet sur l'astrologie.

Ceci est mon premier plugin :-)

28 changes: 26 additions & 2 deletions core/ajax/horoscope.ajax.php
Expand Up @@ -24,11 +24,35 @@
throw new Exception(__('401 - Accès non autorisé', __FILE__));
}

if (init('action') == 'gethoroscope') {
$horoscope = horoscope::byId(init('id'));
if (!is_object($horoscope)) {
throw new Exception(__('Horoscope inconnu verifier l\'id', __FILE__));
}
$return = utils::o2a($horoscope);
$return['cmd'] = array();
foreach ($horoscope->getCmd() as $cmd) {
$cmd_info = utils::o2a($cmd);
$cmd_info['value'] = $cmd->execCmd(null, 0);
$return['cmd'][] = $cmd_info;
}
ajax::success($return);
}


if (init('action') == 'autoDEL_eq') {
$eqLogic = horoscope::byId(init('id'));
if (!is_object($eqLogic)) {
throw new Exception(__('Horoscope eqLogic non trouvé : ', __FILE__) . init('id'));
}
foreach ($eqLogic->getCmd() as $cmd) {
$cmd->remove();
$cmd->save();
}
ajax::success();
}

throw new Exception(__('Aucune méthode correspondante à : ', __FILE__) . init('action'));
/* * *********Catch exeption*************** */
} catch (Exception $e) {
ajax::error(displayExeption($e), $e->getCode());
}
?>
2 changes: 2 additions & 0 deletions core/class/.htaccess
@@ -0,0 +1,2 @@
Order allow,deny
Deny from all

0 comments on commit f9cb7b2

Please sign in to comment.