diff --git a/COMMENT_CA_MARCHE.md b/COMMENT_CA_MARCHE.md
new file mode 100644
index 0000000..639487f
--- /dev/null
+++ b/COMMENT_CA_MARCHE.md
@@ -0,0 +1,73 @@
+# BsHelper
+
+__BsHelper::modal(string $header, string $body, array $options = array(), array $buttons = array())__
+
+_param string $header_ :
+Contenu de l'en-tête
+_param string $body_ :
+Contenu du corps
+_param array $options_ :
+Tableau indiquant l'ID du modal, classes supplémentaires et la présence ou non dans un formulaire.
+_param array $buttons_ :
+Tableau caractérisant les 3 boutons du modal.
+
+Créer un modal de Bootstrap :
+
+ echo $this->Bs->modal('Mon en-tête', 'Mon contenu');
+
+Crée une modal simple sans bouton close et confirm.
+
+Pour personnalisé vos boutons, utilisez le tableau $buttons :
+
+ $this->Bs->modal(
+ 'Mon en-tête',
+ 'Mon contenu',
+ array(
+ 'id' => 'abc123',
+ 'class' => 'modal-form',
+ ),
+ array(
+ 'open' => array(
+ 'name' => 'S'inscrire',
+ 'class' => 'btn-success'
+ ),
+ 'close' => array(
+ 'name' => 'Annuler',
+ 'class' => 'btn-link'
+ ),
+ 'confirm' => array(
+ 'name' => 'Confirmer',
+ 'link' => array(
+ 'controller' => 'monController',
+ 'action' => 'monAction'
+ ),
+ 'class' => 'btn-success'
+ )
+ )
+ );
+
+Si vous voulez naviguer en dehors du projet en cliquant sur le bouton confirmer, utilisez une URL absolue à la place du tableau de CakePHP.
+
+Pour insérer un formulaire dans le body :
+
+ $this->Bs->modal('Mon en-tête', $form);
+
+La variable $form désigne ici le code HTML de votre formulaire.
+
+----------------------------------------------------------------------------------------------------------------------------
+
+__BeHelper::alert(string $text, string $state, array $options = array())__
+
+$text : Définit le contenu de l'alerte.
+$state : L'état bootrstrap de l'alerte.
+$options : Tableau d'options caractérisant l'alerte.
+
+ $this->Bs->alert('monTexte', 'warning');
+
+Donnera :
+
+ '
monTexte
'
+
+Le tableau $options prend des attributs HTML classiques, mais aussi l'index 'dismiss' (true/false) pour définir si l'alerte peut être fermée ou non. Par défaut à true.
+
+ $this->Bs->alert('monTexte', 'warning', array('dismiss' => 'true', 'id' => 'monId', 'style' => 'color:purple ;'));
diff --git a/View/Helper/BsHelper.php b/View/Helper/BsHelper.php
old mode 100644
new mode 100755
index bf8c0e1..090ff2a
--- a/View/Helper/BsHelper.php
+++ b/View/Helper/BsHelper.php
@@ -1,6 +1,6 @@
' . BL;
$out .= '' . BL;
$out .= '' . BL;
@@ -86,7 +93,7 @@ public function html($titre = '' , $description = '' , $lang = 'fr') {
$out .= ''.$titre.'' . BL;
$out .= '' . BL;
$out .= '' . BL;
-
+
return $out;
}
@@ -101,37 +108,37 @@ public function html($titre = '' , $description = '' , $lang = 'fr') {
*/
public function html5($titre = '' , $description = '' , $lang = 'fr') {
-
+
$out = $this->html($titre , $description , $lang);
-
+
// Script JS for IE and HTML 5
$out .= '' . BL;
-
+
return $out;
}
-
+
/**
* Close the head element and initialize the body element
*
* @return string
*/
-
+
public function body($classBody = '') {
-
+
$out = '' . BL;
-
+
if($classBody == '')
$out .= '' . BL;
- else
+ else
$out .= '' . BL;
-
+
return $out;
}
-
-
+
+
/**
* Close the body element and the html element
*
@@ -139,13 +146,13 @@ public function body($classBody = '') {
*/
public function end() {
-
+
$out = '' . BL;
$out .= '';
-
+
return $out;
}
-
+
/**
* Load CSS for the current page
@@ -155,7 +162,7 @@ public function end() {
*/
public function css($path = array(), $options = array()) {
-
+
$out = parent::css($this->pathCSS). BL ;
if ($this->fa_load) {
$out .= parent::css($this->fa_path) . BL;
@@ -163,11 +170,14 @@ public function css($path = array(), $options = array()) {
if ($this->bs_addon_load) {
$out .= parent::css($this->bs_addon_path) . BL;
}
-
+ if ($this->dp_css_path) {
+ $out .= parent::css($this->dp_css_path) . BL;
+ }
+
// Others CSS
foreach($path as $css)
$out .= parent::css($css, $options) . BL;
-
+
return $out;
}
@@ -180,17 +190,18 @@ public function css($path = array(), $options = array()) {
*/
public function js($array_js = array()) {
-
+
$out = parent::script($this->pathJquery) . BL;
$out .= parent::script($this->pathJS) . BL;
-
+ $out .= parent::script($this->dp_js_path). BL;
+
// Others JS
foreach($array_js as $js)
$out .= parent::script($js). BL;
-
+
return $out;
}
-
+
/**
* Close div elements
*
@@ -246,7 +257,7 @@ public function container($options = array()) {
$out = '';
$class = CONTAINER;
if(isset($options['class']))
- $class .= SP . $options['class'];
+ $class .= SP . $options['class'];
$out .= parent::div($class , null, $options). BL;
return $out;
}
@@ -269,7 +280,7 @@ public function row($options = array()) {
/**
* Create a
element.
- *
+ *
* Differents layouts with options.
*
* ### Construction
@@ -295,7 +306,7 @@ public function row($options = array()) {
*
* @param string layout, size and options (offset, push and/or pull)
* @param array $attributes Options of the div element
- * @return string DIV tag element
+ * @return string DIV tag element
*/
public function col() {
$class = '';
@@ -322,7 +333,7 @@ public function col() {
$device = str_replace($replace, '.', $device);
$device = explode('.', $device);
- // Sould define the device in first
+ // Sould define the device in first
foreach ($device as $elem) {
if (!$ecran) {
$nom = substr($elem, 0, 2);
@@ -377,7 +388,7 @@ private function optCol($elem, $screen){
case 'ph':
return 'col-'.$screen.'-push-'.$size;
break;
-
+
case 'of':
return 'col-'.$screen.'-offset-'.$size;
break;
@@ -429,20 +440,20 @@ private function optCol($elem, $screen){
/**
* Initialize the table with the head and the body element.
- * @param array $titles 'title' => title of the cell
+ * @param array $titles 'title' => title of the cell
* 'width' => width in percent of the cell
* 'hidden' => layout
* @param array $class classes of the table (hover, striped, etc)
* @return string
*/
- function table($titles, $class = array()) {
-
+ public function table($titles, $class = array()) {
+
$classes = '';
$out = '
'.BL;
+
return $out;
}
-
+
/**
* Create a button with a confirm like a Bootstrap Modal
* @param string $button the name of the button, the header and the confirm button in the modal
diff --git a/webroot/css/bs_addon.css b/webroot/css/bs_addon.css
old mode 100644
new mode 100755
index 0fe6c77..72537d6
--- a/webroot/css/bs_addon.css
+++ b/webroot/css/bs_addon.css
@@ -24,3 +24,7 @@
/* Add the class .info for tables lines */
.table > tbody > tr > td.info{background-color: #d9edf7;border-top-color: #bce8f1;}
+
+i.fa-open-modal {
+ cursor: pointer;
+}