Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

root / views / brique_view.php @ 04ec83b2

Historique | Voir | Annoter | Télécharger (6,46 ko)

1
<?php
2
/************************************************************************************
3
 *
4
 *  Projet AbulEdu Mur de Classe  - Licence: GNU/Affero GPL v3 ou +
5
 *
6
 *  (c) 2020 Frédéric Adamczak <fred@fadamczak.fr>
7
 *
8
 *   This file is part of AbulEdu Mur de Classe.
9
 *
10
 *   AbulEdu Mur de Classe is free software: you can redistribute it and/or modify
11
 *   it under the terms of the GNU Affero General Public License as published by
12
 *   the Free Software Foundation, either version 3 of the License, or
13
 *   (at your option) any later version.
14
 *
15
 *   AbulEdu Mur de Classe is distributed in the hope that it will be useful,
16
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *   GNU Affero General Public License for more details.
19
 *
20
 *   You should have received a copy of the GNU General Public License
21
 *   along with ClicAlbum. If not, see <https://www.gnu.org/licenses/>.
22
 *
23
 ************************************************************************************/
24

    
25
function afficher_nouvelleBrique($mur, $categories, $theme) {
26
  //debug($mur);
27
  //debug($categories);
28
  ?>
29

    
30
  <!doctype html>
31
  <html>
32
  <head>
33

    
34
      <?php include_once 'views/includes/head.php'?>
35
      <link rel="stylesheet" href="<?= PATH?>assets/styles/css/cssMurs/<?=$theme->getFichier()?>"/>
36

    
37
      <title><?= ucfirst($page) ?></title>
38
  </head>
39

    
40
  <body>
41

    
42
      <?php include_once 'views/includes/header.php'?>
43

    
44
      <div class="container">
45

    
46
        <div class="row">
47
          <div class="col-sm-12">
48
            <a href="<?=PATH.'index.php?page=mur&id='.$mur->getId()?>" title="retour au mur">
49
              <i class="far fa-hand-point-left"></i>
50
            </a>
51
          </div>
52
          <div class="col-sm-12 text-center" id="titre_mur">
53
            <?=$mur->getNom()?>
54
          </div>
55
        </div> <!-- row-->
56

    
57
        <div class="row mt-3">
58
          <div class="col-sm-12 mt-2 mb-3">
59
            Sélectionnez un type de brique à ajouter
60
          </div>
61
            <?php
62
              foreach ($categories as $categorie) {
63
                //debug($categorie);
64
                $nom = "cat_".$categorie->getId();
65
                ?>
66
                <div class="col-sm-2 mb-3">
67
                  <div class="card bg-light element" id="<?=$nom?>">
68
                    <div class="card-header text-center">
69
                      <!--data-toggle="tooltip" data-placement="top" title="Tooltip on top"-->
70
                      <span id="brique_icone" data-toggle="tooltip"
71
                        data-placement="top" title="<?=$categorie->getExtensions()?>">
72
                        <?= $categorie->getIcone(); ?>
73
                      </span>
74
                    </div>
75
                    <div clas="card-body">
76
                      <p id="brique_titre">
77
                        <?= utf8_decode($categorie->getTitre()); ?>
78
                      </p>
79
                      <p id="brique_descriptif">
80
                        <?= utf8_decode($categorie->getDescriptif()); ?>
81
                      </p>
82
                      <input type="hidden" id="isFichier" value="<?=$categorie->getIsFichier()?>" />
83
                      <input type="hidden" id="isUrl" value="<?=$categorie->getIsUrl()?>" />
84
                      <input type="hidden" id="isIframe" value="<?=$categorie->getIsIframe()?>" />
85
                      <input type="hidden" id="extensions" value="<?=$categorie->getExtensions()?>" />
86
                    </div>
87
                  </div>
88
                </div>
89

    
90
                <?php
91
              }
92
            ?>
93
        </div> <!-- row -->
94

    
95
        <div class="row ml-3" id="row_parametres">
96
          <div class="col-sm-12">
97

    
98
            <form id="briqueType" method="post" action="" enctype="multipart/form-data">
99
              <div class="form-group">
100
                <label for="titreBrique">Titre de la brique</label>
101
                <input type="text" class="form-control" id="titreBrique" name="titreBrique" required />
102
                <small class="form-text text-muted">Un titre simple et pas trop long...</small>
103
              </div>
104

    
105
              <div class="form-group">
106
                <label for="descriptifBrique">Descriptif de la brique</label>
107
                <textarea class="form-control" id="descriptifBrique" name="descriptifBrique" rows="3">
108
                </textarea>
109
              </div>
110

    
111
              <div class="form-group" id="paramUrl">
112
                <label for="urlBrique">Url</label>
113
                <input type="url" class="form-control" id="urlBrique" name="urlBrique"
114
                  placeholder="http://...."
115
                />
116
                <small class="form-text text-muted">adresse internet du site...</small>
117
              </div>
118

    
119
              <div class="form-group" id="paramIframe">
120
                <label for="iframeBrique">Code d'intégration</label>
121
                <input type="text" class="form-control" id="iframeBrique"
122
                  name="iframeBrique" placeholder="<iframe=..."
123
                />
124
                <small class="form-text text-muted"></small>
125
              </div>
126

    
127
              <div class="input-group mb-3" id="paramFichier">
128

    
129
                <div class="input-group mb-3">
130
                  <div class="input-group mb-3">
131
                    <div class="form-group">
132
                      <label for="exampleInputFile">Sélectionner un fichier</label>
133
                      <input type="file" class="form-control-file" id="fichierBrique" name="fichierBrique">
134
                    </div>
135
                  </div>
136
                </div>
137
              </div>
138

    
139
              <!-- Quelques infos cachées mais utiles pour la suite .... -->
140
              <input type="hidden" name="idCategorie" id="idCategorie" />
141
              <input type="hidden" name="role" id="role" value="<?= $_SESSION['role']?>" />
142

    
143
              <div class="row">
144
                <div class="col-sm-2">
145
                  <input type="button" class="btn btn-primary" name="btValide" id="btValide" value="Valider" />
146
                </div>
147
                  <div class="col-sm-10">
148
                    <span id="infoUser">
149
                      La brique sera visible sur le mur lorsque l'administrateur du
150
                      mur la validera.
151
                    </span>
152
                  </div>
153
              </div>
154

    
155
            </form>
156

    
157
          </div>
158
        </div>
159

    
160
      </div> <!-- container -->
161

    
162
    <?php include_once 'views/includes/footer.php'?>
163
    <script src="<?= PATH?>assets/js/brique.js"></script>
164

    
165
  </body>
166

    
167
  </html>
168

    
169
      <?php
170
    }
171
     ?>
Redmine Appliance - Powered by TurnKey Linux