refactoring: utilise generer_url_public pour l'url du pdf
This commit is contained in:
parent
17edcf7841
commit
88d4d9a32e
2 changed files with 6 additions and 16 deletions
|
@ -7,19 +7,9 @@ function inc_charger_pdf_dist($fichier_pdf, $contexte = []){
|
|||
|
||||
$login = lire_config('curl_login');
|
||||
$password = lire_config('curl_mdp');
|
||||
$url = $GLOBALS['meta']['adresse_site'].'/spip.php?page=spipdf&spipdf='.$fichier_pdf;
|
||||
if (is_array($contexte) and count($contexte)) {
|
||||
foreach ($contexte as $champ => $val) {
|
||||
/* if (intval($val) === $val) {
|
||||
// if (intval($val)) {
|
||||
$val = intval($val);
|
||||
} else {
|
||||
$val = "$val";
|
||||
}
|
||||
*/
|
||||
$url .= "&$champ=$val";
|
||||
}
|
||||
}
|
||||
|
||||
$contexte['spipdf'] = $contexte['spipdf'] ?? $fichier_pdf ;
|
||||
$url = generer_url_public('spipdf', $contexte, true, false);
|
||||
|
||||
$CurlConnect = curl_init();
|
||||
// pour une connexion https locale avec certificat auto-signé
|
||||
|
@ -34,8 +24,8 @@ function inc_charger_pdf_dist($fichier_pdf, $contexte = []){
|
|||
$retour = curl_exec($CurlConnect);
|
||||
if( ! $retour = curl_exec($CurlConnect)) {
|
||||
trigger_error(curl_error($CurlConnect));
|
||||
}
|
||||
}
|
||||
curl_close($CurlConnect);
|
||||
|
||||
|
||||
return $retour;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<paquet
|
||||
prefix="gamumail"
|
||||
categorie="communication"
|
||||
version="1.1.0"
|
||||
version="1.1.1"
|
||||
etat="dev"
|
||||
compatibilite="[3.2.0;4.1.*]"
|
||||
logo="prive/themes/spip/images/gamumail-64.png"
|
||||
|
|
Loading…
Add table
Reference in a new issue