Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3165 → Rev 3166

/trunk/widget/Widget.php
158,4 → 158,4
self::$config = array_merge(self::$config, $widget_config);
}
}
}
}
/trunk/widget/bibliotheque/WidgetCommun.php
454,4 → 454,4
 
return $str;
}
}
}
/trunk/widget/modules/manager/squelettes/css/manager.css
86,7 → 86,7
border: 0.1rem solid #ddd;
border-radius: 0.3rem;
padding: 1rem;
overflow: visible;
overflow: hidden;
}
 
 
108,7 → 108,7
margin: 1rem;
height: 300rem;
min-height: 100%;
width: 100%;
width: 90%;
pointer-events: none;
overflow: hidden
}
131,23 → 131,24
/* styles de base si JS est activé */
.js #group-settings-form .input-file-container {
position: relative;
width: 225px;
width: 100%;
}
.js #group-settings-form .label-file {
display: block;
padding: 14px 45px;
padding: 1rem;
background: #009FB8;
color: #fff !important;
font-size: 1em;
font-size: 1.5rem;
transition: all .4s;
cursor: pointer;
border-radius: 0.2em;
border-radius: 0.2rem;
}
.js #group-settings-form .input-file {
position: absolute;
top: 0; left: 0;
width: 225px;
padding: 14px 0;
width: 80%;
padding: 1rem;
margin: auto;
opacity: 0;
cursor: pointer;
}
162,21 → 163,26
}
 
/* styles du retour visuel */
#group-settings-form .file-return {
margin: 0;
#group-settings-form .file-return:not(:empty)::before{
content:'Nom du fichier: ';
font-size: 1rem;
}
#group-settings-form .file-return:not(:empty) {
margin: 1em 0;
 
#group-settings-form .file-return:not(:empty) img{
margin: 1rem auto;
display: block;
}
 
.js #group-settings-form .file-return {
font-style: italic;
font-size: .9em;
font-size: 1.5rem;
font-weight: bold;
}
/* on complète l'information d'un contenu textuel
uniquement lorsque le paragraphe n'est pas vide */
.js #group-settings-form .file-return:not(:empty):before {
content: "Selected file: ";
/*.js #group-settings-form .file-return:not(:empty):before {
content: "Fichier sélectionné: ";
font-style: normal;
font-weight: normal;
}
*/
/trunk/widget/modules/manager/squelettes/js/manager.js
22,15 → 22,24
$('#profile-details-fields-section').append(html);
}
 
function inputFileStyle() {
function enregistrerNouveauChamps() {
var $typeChamp = $('#type_champ'),
$valeurNouveauChamp = [];
$type_champ.change(function() {
$valeurNouveauChamp = $(this).val();
console.log($valeurNouveauChamp);
});
}
 
 
function inputFile() {
 
// ajout de la classe JS à HTML
$('html').addClass('js');
 
// initialisation des variables
var $fileInput = $( ".input-file" ),
$button = $( ".label-file" ),
$the_return = $(".file-return");
$button = $( ".label-file" );
 
// action lorsque la "barre d'espace" ou "Entrée" est pressée
$button.on( 'keydown', function( event ) {
40,22 → 49,28
});
 
// action lorsque le label est cliqué
$button.on( 'click', function( event ) {
$fileInput.focus();
return false;
$button.click(function() {
$fileInput.focus();
return false;
});
 
// affiche un retour visuel dès que input:file change
// ...A voir ok=lus tard
// $fileInput.on( 'change', function( event ) {
// file = this.value();
// $the_return.html( file );
// });
$fileInput.change( function(event) {
var file = event.target.files[0]
var $theReturn = $('.' + $(this).attr('id'));
 
$theReturn.text(file.name);
 
if(file.type.match('image')) {
var tmppath = URL.createObjectURL(file);
$theReturn.append('<img src="' + tmppath + '" width="50%">');
}
});
}
 
jQuery(document).ready(function() {
 
inputFileStyle()
inputFile()
 
// var $projet = $('#projet');
 
/trunk/widget/modules/manager/squelettes/creation.tpl.html
73,6 → 73,7
<div class="register-section" id="basic-details-section">
<h2>Meta-données</h2>
 
<?php //var_dump($widget); ?>
<label for="projet">Projet *</label>
<input type="text" name="projet" id="projet" pattern="[a-z]*" <?php echo ($mode === 'modification') ? 'value="'.$widget['projet'].'" readonly' : 'required'; ?> title="Champ obligatoire : pas d'espace" />
 
118,7 → 119,7
<input type="file" class="input-file" name="logo" id="logo" accept="image" />
<label for="logo" class="label-file"><i class="fas fa-download"></i> Logo</label>
</div>
<p class="file-return"></p>
<div class="file-return logo"></div>
 
<?php echo isset($widget['logo']) ? '<img src="'.$widget['logo'].'" /><br />Pour changer, télécharger un nouveau fichier.': ''; ?>
 
126,7 → 127,7
<input type="file" class="input-file" name="fond" id="fond" value="<?php echo $widget['titre']; ?>" />
<label for="fond" class="label-file"><i class="fas fa-download"></i> Image de fond</label>
</div>
<p class="file-return"></p>
<div class="file-return fond"></div>
</div><!-- #profile-details-description-section -->
 
<div class="register-section" id="profile-details-fields-section">
164,7 → 165,7
<label for="especes"class="label-file"><i class="fas fa-download"></i> Espèces</label>
fichier type
</div>
<p class="file-return"></p>
<p class="file-return especes"></p>
 
 
<label for="add_fields">Ajouter un champ</label>
/trunk/widget/modules/manager/Manager.php
111,7 → 111,7
//https://api.tela-botanica.org/service:cel:NomsChampsEtendus/cle
$retour['squelette'] ='creation';
$jsonlangue = $this->getDao()->consulter($this->config['manager']['languesUrl']);
$tableaulangue= (array) json_decode($jsonlangue, true);
$tableaulangue = (array) json_decode($jsonlangue, true);
$retour['donnees']['langues'] = $tableaulangue['resultat'] ;
$retour['donnees']['widget'] = array();
if (isset($this->parametres['projet'])) {
119,11 → 119,12
$json = $this->getDao()->consulter($url);
$tableau = (array) json_decode($json, true);
$retour['donnees']['widget'] = $tableau[0];
$urltype = $this->cel_url_tpl.'?esttype=1';
$jsontype = $this->getDao()->consulter($urltype);
$tableautype= (array) json_decode($jsontype, true);
$retour['donnees']['type'] = $tableautype;
 
}
$urltype = $this->cel_url_tpl.'?esttype=1';
$jsontype = $this->getDao()->consulter($urltype);
$tableautype= (array) json_decode($jsontype, true);
$retour['donnees']['type'] = $tableautype;
return $retour;
}
 
/trunk/jrest/bibliotheque/GestionChampsEtendus.php
263,7 → 263,7
$requete = "SELECT cc.cle as cle_groupe, cc.label as nom_groupe, ccc.cle as cle_champ, ccc.label as label_champ, ccc.type as type_champ, ccc.valeur as valeur_champ, ccc.invisible, ccc.prive ".
"FROM `cel_catalogue_champs_etendus` cc ".
"INNER JOIN cel_catalogue_champs_etendus_liaison cl ON cc.cle = cl.groupe ".
"INNER JOIN cel_catalogue_champs_etendus ccc ON ccc.cle = cl.champ ".
"INNER JOIN cel_catalogue_champs_etendus ccc ON ccc.cle = cl.champ ".
"WHERE cc.langue = '".$langue."' ";
if ($groupe !== "") $requete .= " AND cl.groupe = '".$groupe."'";
$requete .= ' -- '.__FILE__.':'.__LINE__;
381,4 → 381,4
 
return $cle;
}
}
}
/trunk/jrest/services/CelWidgetManager.php
42,7 → 42,7
/**
* Méthode appelée avec une requête de type GET.
*/
public function getElement($params = array()) {
public function getElement($params = array()) {
switch(@strtolower($params[0])) {
case 'widget':
$this->getWidget();
53,8 → 53,8
$this->getWidget();
}
}
 
 
public function createElement($requeteDonnees) {
unset($requeteDonnees['signup_submit']);
$requeteDonnees['est_type'] = (isset($requeteDonnees['est_type']) && $requeteDonnees['est_type']== "on") ? '1' : '0';
63,7 → 63,7
$this->envoyerJson($retour);
 
}
 
public function updateElement($uid,$params) {
$retour = "";
if (isset($params['projet']) && isset($params['langue'])) {
70,11 → 70,11
$manager = new GestionWidget($this->config);
$params['est_type'] = (isset($params['est_type']) && $params['est_type']== "on") ? '1' : '0';
$retour = $manager->modifierWidget($params['projet'], $params['langue'], $params);
 
}
$this->envoyerJson($retour);
return "ff";
 
}
 
private function getWidget() {
81,8 → 81,8
$criteres = $this->traiterParametresAutorises($_GET);
$manager = new GestionWidget($this->config);
$liste = $manager->obtenirWidget($criteres);
 
 
$this->envoyerJson($liste);
}
 
89,7 → 89,7
 
protected function traiterParametresAutorises(Array $parametres) {
$parametres_traites = array();
 
foreach($parametres as $cle => $valeur) {
if(is_string($valeur) && !trim($valeur)) continue;
if(isset($this->parametres_autorises[$cle])) {
101,4 → 101,4
 
 
}
?>
?>