Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvaner committed Apr 25, 2018
1 parent 48dac5c commit 3d1f220
Show file tree
Hide file tree
Showing 66 changed files with 3,775 additions and 4 deletions.
43 changes: 43 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/

root = true

[*.php]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.js]
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.css]
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.py]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.sh]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
nbproject/
\.project
\.DS_Store
Thumbs.db
*.php~
composer.lock
vendor
\.idea
tests/mocked_Jeedom_env/plugins/*
2 changes: 2 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Order Deny,Allow
Deny from all
35 changes: 35 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
matrix:
include:
- language: php
php: 5.6
before_script:
- find . -type f -name *.php | xargs -n1 php -l
script:
- cd ${TRAVIS_BUILD_DIR}
- pwd
after_success:
- cd ${TRAVIS_BUILD_DIR}
- ls -latr
after_failure:
- cd ${TRAVIS_BUILD_DIR}
- ls -latr

- language: python
python: 2.7
install:
- pip install pylint
script:
- cd ${TRAVIS_BUILD_DIR}
- ./tests/tools/lintAllPythonFiles.sh
- language: markdown
addons:
apt:
packages:
- aspell
- aspell-fr
script:
- gem install mdl
- cd ${TRAVIS_BUILD_DIR}
- ./tests/tools/setCustomMDWarnings.sh
- mdl -r $MDLWAR *.md docs/fr_FR/*.md
- ./tests/tools/spellCheckMD.sh
2 changes: 2 additions & 0 deletions 3rparty/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Order Deny,Allow
Deny from all
1 change: 1 addition & 0 deletions 3rparty/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ce dossier doit contenir toutes les librairies externes utilisées par votre plugin.
18 changes: 18 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Description

## Etapes à reproduire (pour les bugs)

1.
2.
3.
4.

## Contexte:

## Proposition de solution (optionnel):

## Environnement:

* **Version Jeedom**:
* **Plateforme**:
* **Version du Plugin**:
9 changes: 5 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Expand Down Expand Up @@ -290,8 +290,8 @@ to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
{description}
Copyright (C) {year} {fullname}

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -329,11 +329,12 @@ necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.

<signature of Ty Coon>, 1 April 1989
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice

This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

[![license](https://img.shields.io/github/license/Jeedom-Plugins-Extra/plugin-ExtraTemplate.svg)](./LICENSE) [![GitHub contributors](https://img.shields.io/github/contributors/Jeedom-Plugins-Extra/plugin-ExtraTemplate.svg)](../../graphs/contributors) [![GitHub release](https://img.shields.io/github/release/Jeedom-Plugins-Extra/plugin-ExtraTemplate.svg)](../../releases) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/_USERNAME) [![Waffle.io - Columns and their card count](https://badge.waffle.io/Jeedom-Plugins-Extra/plugin-ExtraTemplate.svg?columns=all)](https://waffle.io/Jeedom-Plugins-Extra/plugin-ExtraTemplate)

### Master: [![Build Status](https://travis-ci.org/Jeedom-Plugins-Extra/plugin-ExtraTemplate.svg?branch=master)](https://travis-ci.org/Jeedom-Plugins-Extra/plugin-ExtraTemplate) [![Coverage Status](https://coveralls.io/repos/github/Jeedom-Plugins-Extra/plugin-ExtraTemplate/badge.svg?branch=master)](https://coveralls.io/github/Jeedom-Plugins-Extra/plugin-ExtraTemplate?branch=master)

### Develop: [![Build Status](https://travis-ci.org/Jeedom-Plugins-Extra/plugin-ExtraTemplate.svg?branch=develop)](https://travis-ci.org/Jeedom-Plugins-Extra/plugin-ExtraTemplate) [![Coverage Status](https://coveralls.io/repos/github/Jeedom-Plugins-Extra/plugin-ExtraTemplate/badge.svg?branch=develop)](https://coveralls.io/github/Jeedom-Plugins-Extra/plugin-ExtraTemplate?branch=develop)

# Présentation:

Template de permettant de céér des plugins pour Jeedom

# Documentation du plugin, comment créér un plugin:

*Effacer cette section dans votre plugin*

[Documentation principale](https://github.com/rjullien/plugin-ExtraTemplate/blob/develop/docs/fr_FR/index-ExtraTemplate.md)

[Comment documenter un plug-in](https://github.com/Jeedom-Plugins-Extra/Jeedom-Plugins-Extra/wiki/Documentation-d'un-Plugin)

[Comment tester un plugin](https://github.com/Jeedom-Plugins-Extra/Jeedom-Plugins-Extra/wiki/Tester-un-plugin-avec-travis-ci)

[Comment creer l'icône](https://github.com/Jeedom-Plugins-Extra/Jeedom-Plugins-Extra/wiki/07-Cr%C3%A9ation-d'une-icone-plugin)

[Les bonnes pratiques](https://github.com/Jeedom-Plugins-Extra/Jeedom-Plugins-Extra/wiki/Bonnes-pratiques-pour-les-plugins)

[Créér un plugun au standard Jeedom-Plugins-Extra](https://github.com/Jeedom-Plugins-Extra/Jeedom-Plugins-Extra/wiki/PROJET-:-Crit%C3%A8re-de-validation-d'un-plugin)

# Documentation du plugin:
[![Read the Docs](https://img.shields.io/readthedocs/pip.svg)](docs/fr_FR/presentation.md)
[présentation](docs/fr_FR/presentation.md) [configuration](docs/fr_FR/configuration.md) [faq](docs/fr_FR/faq.md) [changelog](docs/fr_FR/changelog.md)

# Documentation complète:

[![Read the Docs](plugin_info/ExtraTemplate_icon.png)](https://jeedom-plugins-extra.github.io/plugin-ExtraTemplate)


[![Support via PayPal](https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg)](https://www.paypal.me/_USERNAME/)
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"require": {
"phpunit/phpunit": "7.0.3",
"php-coveralls/php-coveralls": "2.0"
}
}
2 changes: 2 additions & 0 deletions core/ajax/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Order Deny,Allow
Deny from all
45 changes: 45 additions & 0 deletions core/ajax/ExtraTemplate.ajax.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

/* This file is part of Jeedom.
*
* Jeedom is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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/>.
*/

/**
* Fichier appelé lorsque le plugin effectue une requête Ajax
*/

try {
// Ajoute le fichier du core qui se charge d'inclure tous les fichiers nécessaires
require_once dirname(__FILE__) . '/../../../../core/php/core.inc.php';

// Ajoute le fichier de gestion des authentifications
include_file('core', 'authentification', 'php');

// Test si l'utilisateur est connecté
if (!isConnect('admin')) {
// Lève un exception si l'utilisateur n'est pas connecté avec les bons droits
throw new \Exception(__('401 - Accès non autorisé', __FILE__));
}

// Initialise la gestion des requêtes Ajax
ajax::init();

// Lève une exception si la requête n'a pas été traitée avec succès (Appel de la fonction ajax::success());
throw new \Exception(__('Aucune méthode correspondante à : ', __FILE__) . init('action'));
/* * *********Catch exeption*************** */
} catch (\Exception $e) {
// Affiche l'exception levé à l'utilisateur
ajax::error(displayExeption($e), $e->getCode());
}
2 changes: 2 additions & 0 deletions core/class/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Order Deny,Allow
Deny from all
115 changes: 115 additions & 0 deletions core/class/ExtraTemplate.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?php

/* This file is part of Jeedom.
*
* Jeedom is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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/>.
*/

/* * ***************************Includes********************************* */
require_once dirname(__FILE__) . '/../../../../core/php/core.inc.php';
require_once 'ExtraTemplateCmd.class.php';

class ExtraTemplate extends eqLogic
{
/* * *************************Attributs****************************** */


/* * ***********************Methode static*************************** */

/*
* Fonction exécutée automatiquement toutes les minutes par Jeedom
public static function cron() {
}
*/


/*
* Fonction exécutée automatiquement toutes les heures par Jeedom
public static function cronHourly() {
}
*/

/*
* Fonction exécutée automatiquement tous les jours par Jeedom
public static function cronDaily() {
}
*/


/* * *********************Méthodes d'instance************************* */

public function preInsert()
{

}

public function postInsert()
{

}

public function preSave()
{

}

public function postSave()
{

}

public function preUpdate()
{

}

public function postUpdate()
{

}

public function preRemove()
{

}

public function postRemove()
{

}

/*
* Non obligatoire mais permet de modifier l'affichage du widget si vous en avez besoin
public function toHtml($_version = 'dashboard') {
}
*/

/*
* Non obligatoire mais ca permet de déclencher une action après modification de variable de configuration
public static function postConfig_<Variable>() {
}
*/

/*
* Non obligatoire mais ca permet de déclencher une action avant modification de variable de configuration
public static function preConfig_<Variable>() {
}
*/

/* * **********************Getteur Setteur*************************** */
}
Loading

0 comments on commit 3d1f220

Please sign in to comment.