Commit 8903af31 authored by Erase's avatar Erase
Browse files

Add input for specify title and description of general RSS feed

parent c211f069
......@@ -50,9 +50,9 @@
$rssfeed = '<?xml version="1.0" encoding="UTF-8"?>';
$rssfeed .= '<rss version="2.0">';
$rssfeed .= '<channel>';
$rssfeed .= '<title>Flux personnalisé RSS Fusion</title>';
$rssfeed .= '<link>https://framagit.org/Erase/RSS-Fusion-demo</link>';
$rssfeed .= '<description>Flux généré avec RSS Fusion</description>';
$rssfeed .= '<title>'.($oConf->title && !empty($oConf->title) ? $oConf->title : 'Flux personnalisé RSS Fusion').'</title>';
$rssfeed .= '<link>'.($oConf->link && !empty($oConf->link) ? $oConf->link : 'https://framagit.org/Erase/RSS-Fusion-demo').'</link>';
$rssfeed .= '<description>'.($oConf->description && !empty($oConf->description) ? $oConf->description : 'Flux généré avec RSS Fusion').'</description>';
if(count($_items)){
foreach ($_items as $item){
......
......@@ -70,12 +70,30 @@
$oFeeds = new FeedReader($_links);
if(!is_null($oFeeds->objParseFeed)){
//~ Set <link> RSS
$rss_link = ($_SERVER['SSL'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
//~ Set <title> RSS
$rss_title = "";
if(array_key_exists('titre', $_POST) && !empty($_POST['titre'])){
$rss_title = htmlspecialchars($_POST['titre'], ENT_QUOTES, Config::get('characterSet'));
}
//~ Set <description> RSS
$rss_description = "";
if(array_key_exists('desc', $_POST) && !empty($_POST['desc'])){
$rss_description = htmlspecialchars($_POST['desc'], ENT_QUOTES, Config::get('characterSet'));
}
//~ Config is ok ! Storage
$conf_storage = json_encode(array(
'flux' => $_links,
'where' => \Config::get('where'),
'_starWords' => \Config::get('_starWords'),
'_badWords' => \Config::get('_badWords')
'flux' => $_links,
'link' => $rss_link,
'title' => $rss_title,
'description' => $rss_description,
'where' => \Config::get('where'),
'_starWords' => \Config::get('_starWords'),
'_badWords' => \Config::get('_badWords')
));
$conf_name = str_replace('.', '', uniqid(mt_rand(), true));
......
......@@ -54,15 +54,15 @@
</header>
<div class="sectionorange">
<section id="contact">
<section id="xmlœ">
<div class="separator">
<div class="line"></div>
<h2>Créer un flux personnalisé</h2>
<div class="line"></div>
</div>
<div class="clear"></div>
<div class="contact-form shadow" id="form">
<form id="contact_form" method="POST" action="" accept-charset="UTF-8">
<div class="xml-form shadow" id="form">
<form id="xml_form" method="POST" action="" accept-charset="UTF-8">
<fieldset class="full-form">
<label for="flux">URL des flux RSS à fusionner (un lien par ligne)</label>
<textarea id="flux" name="flux"></textarea>
......@@ -78,7 +78,7 @@
<option value="show">afficher</option>
<option value="hide">masquer</option>
</select>
<span>les items contenant le(s) mot(s) clés (*) : </span>
<span>les items contenant le(s) mot(s) clés (séparer chaque mot clé par une virgule) : </span>
<input type="text" name="words" value="" id="words">
<span>en effectuant ma recherche sur</span>
<select name="where" id="where">
......@@ -86,12 +86,20 @@
<option value="description">la description</option>
<option value="all">le titre et la description</option>
</select>
<br />
<span class="note tright">
(*) Séparer chaque mot clé par une virgule. Exemple : motclé1, mot clé 2
</span>
</fieldset>
<div class="clear"></div>
<div class="bottom-shadow"></div>
<div class="no-shadow hidden"></div>
<div class="clear"></div>
<fieldset>
<label for="titre">Titre du flux général</label>
<input type="text" name="titre" value="" id="titre">
</fieldset>
<fieldset>
<label for="desc">Description du flux général</label>
<input type="text" name="desc" value="" id="desc">
</fieldset>
<div class="clear"></div>
<fieldset class="fsubmit full-form">
<div id="ajax-message"></div>
......@@ -100,7 +108,6 @@
<div class="clear"></div>
<div id="rss-lk"></div>
</fieldset>
</form>
</div>
</section>
......
......@@ -14,7 +14,7 @@ $(document).ready(function(){
$.ajax({
type: 'POST',
url: 'generate.php',
data: $('#contact_form').serialize()+'&isAjax=true&t='+$('meta[name="csrf-token"]').attr('content'),
data: $('#xml_form').serialize()+'&isAjax=true&t='+$('meta[name="csrf-token"]').attr('content'),
headers : {
'CsrfToken': $('meta[name="csrf-token"]').attr('content')
},
......
......@@ -461,7 +461,7 @@ section article a {
.sectionh3 { font-size:20px; margin-top:40px; margin-bottom:20px;}
.contact-form {
.xml-form {
width: 86.8%;
background: #fdfdf7;
margin: 0 auto;
......@@ -487,27 +487,27 @@ section article a {
display:none;
}
.contact-form:before, .contact-form:after {
.xml-form:before, .xml-form:after {
content: "";
display: table;
}
.contact-form:after {
.xml-form:after {
clear: both;
}
.contact-form fieldset {
.xml-form fieldset {
width: 42%;
float: left;
margin-left: 5%;
display:block;
}
.contact-form fieldset.full-form {
.xml-form fieldset.full-form {
width: 94%;
float: left;
margin-left: 3%;
margin-right: 3%;
display:block;
}
.contact-form fieldset label {
.xml-form fieldset label {
font-family: 'Source Sans Pro', sans-serif;
font-size: 16px;
color: #323232;
......@@ -516,7 +516,7 @@ section article a {
width: 97%;
text-align: left;
}
.contact-form fieldset span {
.xml-form fieldset span {
font-family: 'Source Sans Pro', sans-serif;
font-size: 14px;
color: #323232;
......@@ -525,8 +525,8 @@ section article a {
width: 97%;
}
.contact-form fieldset input,
.contact-form fieldset select {
.xml-form fieldset input,
.xml-form fieldset select {
font-size: 18px;
color: #323232;
border-color: #bdbcbd;
......@@ -537,7 +537,7 @@ section article a {
height: 38px;
text-indent: 10px;
}
.contact-form fieldset textarea {
.xml-form fieldset textarea {
font-size: 18px;
line-height: 24px;
color: #323232;
......@@ -552,8 +552,8 @@ section article a {
height: 195px;
}
.contact-form fieldset input[type="submit"],
.contact-form fieldset a.link {
.xml-form fieldset input[type="submit"],
.xml-form fieldset a.link {
border-style: solid;
border-width: 1px;
border-color: #ffcf47;
......@@ -578,8 +578,8 @@ section article a {
margin-top: 32px;
cursor: pointer;
}
.contact-form fieldset input[type="submit"]:hover,
.contact-form fieldset a.link:hover {
.xml-form fieldset input[type="submit"]:hover,
.xml-form fieldset a.link:hover {
background-image: -moz-linear-gradient(-6% -174% -90deg, #ffc533 0%, #ffc533 100%);
background-image: -webkit-gradient(linear, -6% -174%, -6% -49%, color-stop(0, #ffc533), color-stop(1, #ffc533));
background-image: -webkit-linear-gradient(-90deg, #ffc533 0%, #ffc533 100%);
......@@ -588,7 +588,7 @@ section article a {
background-image: linear-gradient(-90deg, #ffc533 0%, #ffc533 100%);
}
.contact-form #question span{
.xml-form #question span{
font-family: 'Source Sans Pro', sans-serif;
font-size: 16px;
color: #323232;
......@@ -738,8 +738,8 @@ section article a {
width: 13.690476190476192%;
margin: 0 1.488095238095238%;
}
.contact-form fieldset input[type="submit"],
.contact-form fieldset a.link{
.xml-form fieldset input[type="submit"],
.xml-form fieldset a.link{
width:45%;
}
#ajax-message{
......@@ -832,7 +832,7 @@ section article a {
.grid3 .col:nth-of-type(3){
margin-bottom:0;
}
.contact-form {
.xml-form {
padding: 15px 10px 40px;
}
#form h1 {
......@@ -850,8 +850,8 @@ section article a {
margin-left:0;
}
.contact-form fieldset input[type="submit"],
.contact-form fieldset a.link {
.xml-form fieldset input[type="submit"],
.xml-form fieldset a.link {
width: 100%;
float: left;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment