function autoEdit($anid) { global $aid, $hlpfile, $tipath, $radminsuper, $NPDS_Prefix, $adminimg; $f_meta_nom = 'autoStory'; $f_titre = adm_translate("Editer un Article"); //==> controle droit admindroits($aid, $f_meta_nom); //<== controle droit $result = sql_query("SELECT catid, title, time, hometext, bodytext, topic, informant, notes, ihome, date_debval,date_finval,auto_epur FROM " . $NPDS_Prefix . "autonews WHERE anid='{$anid}'"); list($catid, $title, $time, $hometext, $bodytext, $topic, $informant, $notes, $ihome, $date_debval, $date_finval, $epur) = sql_fetch_row($result); sql_free_result($result); $titre = stripslashes($title); $hometext = stripslashes($hometext); $bodytext = stripslashes($bodytext); $notes = stripslashes($notes); if ($topic < 1) { $topic = 1; } $affiche = false; $result2 = sql_query("SELECT topictext, topicimage, topicadmin FROM " . $NPDS_Prefix . "topics WHERE topicid='{$topic}'"); list($topictext, $topicimage, $topicadmin) = sql_fetch_row($result2); if ($radminsuper) { $affiche = true; } else { $topicadminX = explode(',', $topicadmin); for ($i = 0; $i < count($topicadminX); $i++) { if (trim($topicadminX[$i]) == $aid) { $affiche = true; } } } if (!$affiche) { header("location: admin.php?op=autoStory"); } $topiclogo = '<span class="label label-default pull-right"><strong>' . aff_langue($topictext) . '</strong></span>'; include 'header.php'; GraphicAdmin($hlpfile); adminhead($f_meta_nom, $f_titre, $adminimg); echo '<h3>' . adm_translate("Editer l'Article Automatique") . '</h3>'; echo aff_local_langue(adm_translate("Langue de Prévisualisation"), '', 'local_user_language'); echo '<div class="card card-block">'; if ($topicimage !== '') { if (!($imgtmp = theme_image('topics/' . $topicimage))) { $imgtmp = $tipath . $topicimage; } $timage = $imgtmp; if (file_exists($imgtmp)) { $topiclogo = '<img class="img-fluid " src="' . $timage . '" align="right" alt="" />'; } } // $no_img=false; // if ((file_exists("$tipath$topicimage")) and ($topicimage!="")) { // echo "<img src=\"$tipath$topicimage\" border=\"0\" align=\"right\" alt=\"\" />"; // } else { // $no_img=true; // } code_aff('<h3>' . $subject . $topiclogo . '</h3>', '<div class="text-muted">' . $hometext . '</div>', $bodytext, $notes); if ($no_img) { echo "<b>" . aff_langue($topictext) . "</b>"; } echo '<b>' . adm_translate("Utilisateur") . '</b>' . $informant . '<br /><br />'; echo ' </div> <form action="admin.php" method="post" name="adminForm"> <div class="form-group row"> <label class="form-control-label col-sm-4" for="title">' . adm_translate("Titre") . '</label> <div class="col-sm-8"> <input class="form-control" type="text" name="title" size="50" value="' . $titre . '" /> </div> </div> <div class="form-group row"> <label class="form-control-label col-sm-4" for="topic">' . adm_translate("Sujet") . '</label> <div class="col-sm-8"> <select class="c-select form-control" name="topic">'; $toplist = sql_query("SELECT topicid, topictext, topicadmin FROM " . $NPDS_Prefix . "topics ORDER BY topictext"); if ($radminsuper) { echo ' <option value="">' . adm_translate("Tous les Sujets") . '</option>'; } while (list($topicid, $topics, $topicadmin) = sql_fetch_row($toplist)) { $affiche = false; if ($radminsuper) { $affiche = true; } else { $topicadminX = explode(",", $topicadmin); for ($i = 0; $i < count($topicadminX); $i++) { if (trim($topicadminX[$i]) == $aid) { $affiche = true; } } } if ($affiche) { if ($topicid == $topic) { $sel = 'selected="selected" '; } echo "<option {$sel} value=\"{$topicid}\">" . aff_langue($topics) . "</option>\n"; $sel = ''; } } echo ' </select> </div> </div>'; SelectCategory($catid); echo "<br />"; puthome($ihome); echo ' <div class="form-group row"> <label class="form-control-label col-sm-12" for="hometext">' . adm_translate("Texte d'introduction") . '</label> <div class="col-sm-12"> <textarea class="tin form-control" rows="25" name="hometext" >' . $hometext . '</textarea> </div> </div> ' . aff_editeur('hometext', '') . ' <div class="form-group row"> <label class="form-control-label col-sm-12" for="bodytext">' . adm_translate("Texte étendu") . '</label> <div class="col-sm-12"> <textarea class="tin form-control" rows="25" name="bodytext" >' . $bodytext . '</textarea> </div> </div> ' . aff_editeur('bodytext', ''); if ($aid != $informant) { echo ' <div class="form-group row"> <label class="form-control-label col-sm-12" for="notes">' . adm_translate("Notes") . '</label> <div class="col-sm-12"> <textarea class="tin form-control" rows="7" name="notes">' . $notes . '</textarea> </div> </div> ' . aff_editeur('notes', ''); } $deb_day = substr($date_debval, 8, 2); $deb_month = substr($date_debval, 5, 2); $deb_year = substr($date_debval, 0, 4); $deb_hour = substr($date_debval, 11, 2); $deb_min = substr($date_debval, 14, 2); // $fin_day = substr($date_finval, 8, 2); $fin_month = substr($date_finval, 5, 2); $fin_year = substr($date_finval, 0, 4); $fin_hour = substr($date_finval, 11, 2); $fin_min = substr($date_finval, 14, 2); // publication($deb_day, $deb_month, $deb_year, $deb_hour, $deb_min, $fin_day, $fin_month, $fin_year, $fin_hour, $fin_min, $epur); echo ' <div class="form-group row"> <div class="col-sm-12"> <input type="hidden" name="anid" value="' . $anid . '" /> <input type="hidden" name="op" value="autoSaveEdit" /> <input class="btn btn-primary" type="submit" value="' . adm_translate("Sauver les modifications") . '" /> </div> </div> </form>'; adminfoot('fv', '', '', ''); }
/* */ /* Version 1.2 - 22 Avril 2009 */ /* -------------------------- */ /* */ /* Modifié par jpb et phr pour le rendre compatible avec Evolution */ /* */ /* -------------------------- */ /* Version 2.0 - 30/08/2015 by jpb */ /************************************************************************/ if (!stristr($_SERVER['PHP_SELF'], "admin.php")) { Access_Error(); } $f_meta_nom = 'modules'; $f_titre = adm_translate("Gestion, Installation Modules"); //==> controle droit admindroits($aid, $f_meta_nom); //<== controle droit // ***************************** // * Fonctions de l'installeur * // ***************************** function nmig_copyright() { $clspin = ' text-success'; if ($ModInstall == "" && $ModDesinstall != "") { $clspin = ' text-danger'; } $display = ' <br /><div class="text-xs-center"> <i class="fa fa-spinner fa-pulse ' . $clspin . ' "></i> NPDS Module Installer v2.0 </div>'; return $display;
function adminStory() { global $NPDS_Prefix, $hlpfile, $language, $aid, $radminsuper, $adminimg; $f_meta_nom = 'adminStory'; $f_titre = adm_translate("Nouvel Article"); //==> controle droit admindroits($aid, $f_meta_nom); //<== controle droit $hlpfile = "manuels/{$language}/newarticle.html"; include 'header.php'; GraphicAdmin($hlpfile); adminhead($f_meta_nom, $f_titre, $adminimg); echo ' <form action="admin.php" method="post" name="adminForm"> <div class="form-group row"> <label class="col-sm-4 form-control-label" for="subject">' . adm_translate("Titre") . '</label> <div class="col-sm-8"> <input class="form-control" type="text" name="subject" value="" /> </div> </div> <div class="form-group row"> <label class="col-sm-4 form-control-label" for="topic">' . adm_translate("Sujet") . '</label> <div class="col-sm-8"> <select class="c-select form-control" name="topic">'; $toplist = sql_query("SELECT topicid, topictext, topicadmin FROM " . $NPDS_Prefix . "topics ORDER BY topictext"); //probablement ici aussi mettre les droits pour les gestionnaires de topics ?? if ($radminsuper) { echo ' <option value="">' . adm_translate("Sélectionner un Sujet") . '</option>'; } while (list($topicid, $topics, $topicadmin) = sql_fetch_row($toplist)) { $affiche = false; if ($radminsuper) { $affiche = true; } else { $topicadminX = explode(",", $topicadmin); for ($i = 0; $i < count($topicadminX); $i++) { if (trim($topicadminX[$i]) == $aid) { $affiche = true; } } } if ($affiche) { if ($topicid == $topic) { $sel = 'selected="selected"'; } echo '<option ' . $sel . ' value="' . $topicid . '">' . aff_langue($topics) . '</option>'; $sel = ''; } } echo '</select> </div> </div>'; $cat = 0; SelectCategory($cat); puthome($ihome); echo ' <div class="form-group row"> <label class="form-control-label col-xs-12" for="hometext">' . adm_translate("Texte d'introduction") . '</label> <div class="col-xs-12"> <textarea class="tin form-control" rows="25" name="hometext">' . $hometext . '</textarea> </div> </div>'; echo aff_editeur("hometext", "true"); echo ' <div class="form-group row"> <label class="form-control-label col-xs-12" for="bodytext">' . adm_translate("Texte étendu") . '</label> <div class="col-xs-12"> <textarea class="tin form-control" rows="25" name="bodytext" >' . $bodytext . '</textarea> </div> </div>'; echo aff_editeur("bodytext", "true"); publication($deb_day, $deb_month, $deb_year, $deb_hour, $deb_min, $fin_day, $fin_month, $fin_year, $fin_hour, $fin_min, $epur); echo ' <input type="hidden" name="author" value="' . $aid . '" /> <input type="hidden" name="op" value="PreviewAdminStory" /> <div class="form-group row"> <div class="col-sm-offset-4 col-sm-8"> <input class="btn btn-primary" type="submit" name="submit" value="' . adm_translate("Prévisualiser") . '" /> </div> </div> </fieldset> </form>'; adminfoot('', '', '', ''); }