forked from Wavyzz/dolibarr
FIX logo and escape in RSS
This commit is contained in:
@@ -224,7 +224,9 @@ print '<input type="hidden" name="norss" value="'.($lastexternalrss + 1).'">';
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
print '<span class="opacitymedium">'.$langs->trans('RssNote').'</span> - <a href="'.DOL_MAIN_URL_ROOT.'/admin/boxes.php">'.$langs->trans('JumpToBoxes').'</a>';
|
print '<span class="opacitymedium">'.$langs->trans('RssNote').'</span>';
|
||||||
|
print ' - ';
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/admin/boxes.php?backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.$langs->trans('JumpToBoxes').'</a>';
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
$sql = "SELECT rowid, file, note FROM ".MAIN_DB_PREFIX."boxes_def";
|
$sql = "SELECT rowid, file, note FROM ".MAIN_DB_PREFIX."boxes_def";
|
||||||
@@ -282,7 +284,7 @@ if ($resql) {
|
|||||||
print "<td>".$langs->trans("Status")."</td>";
|
print "<td>".$langs->trans("Status")."</td>";
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if ($result > 0 && empty($rssparser->error)) {
|
if ($result > 0 && empty($rssparser->error)) {
|
||||||
print '<span class="ok">'.$langs->trans("Online").'</div>';
|
print '<span class="ok">'.img_picto($langs->trans("Online"), 'tick', 'class="pictofixedwidth"').$langs->trans("Online").'</div>';
|
||||||
} else {
|
} else {
|
||||||
print '<span class="error">'.$langs->trans("Offline");
|
print '<span class="error">'.$langs->trans("Offline");
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
@@ -321,7 +323,11 @@ if ($resql) {
|
|||||||
$active = _isInBoxList($idrss, $boxlist) ? 'yes' : 'no';
|
$active = _isInBoxList($idrss, $boxlist) ? 'yes' : 'no';
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans('WidgetAvailable').'</td>';
|
print '<td>'.$langs->trans('WidgetAvailable').'</td>';
|
||||||
print '<td>'.yn($active).'</td>';
|
print '<td>'.yn($active);
|
||||||
|
print ' - <a href="'.DOL_URL_ROOT.'/admin/boxes.php?backtopage='.urlencode($_SERVER["PHP_SELF"]).'">';
|
||||||
|
print $langs->trans("JumpToBoxes");
|
||||||
|
print '</a>';
|
||||||
|
print '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
|||||||
@@ -1743,7 +1743,7 @@ function dol_escape_js($stringtoescape, $mode = 0, $noescapebackslashn = 0)
|
|||||||
* Returns text escaped for inclusion into javascript code
|
* Returns text escaped for inclusion into javascript code
|
||||||
*
|
*
|
||||||
* @param string $stringtoescape String to escape
|
* @param string $stringtoescape String to escape
|
||||||
* @return string Escaped string for json content.
|
* @return string Escaped string for JSON content.
|
||||||
*/
|
*/
|
||||||
function dol_escape_json($stringtoescape)
|
function dol_escape_json($stringtoescape)
|
||||||
{
|
{
|
||||||
@@ -1755,7 +1755,7 @@ function dol_escape_json($stringtoescape)
|
|||||||
*
|
*
|
||||||
* @param string $stringtoescape String to escape
|
* @param string $stringtoescape String to escape
|
||||||
* @param int<1,2> $stringforquotes 2=String for doublequotes, 1=String for simple quotes
|
* @param int<1,2> $stringforquotes 2=String for doublequotes, 1=String for simple quotes
|
||||||
* @return string Escaped string for json content.
|
* @return string Escaped string for PHP content.
|
||||||
*/
|
*/
|
||||||
function dol_escape_php($stringtoescape, $stringforquotes = 2)
|
function dol_escape_php($stringtoescape, $stringforquotes = 2)
|
||||||
{
|
{
|
||||||
@@ -1778,6 +1778,17 @@ function dol_escape_php($stringtoescape, $stringforquotes = 2)
|
|||||||
return 'Bad parameter for stringforquotes in dol_escape_php';
|
return 'Bad parameter for stringforquotes in dol_escape_php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns text escaped for inclusion into a XML string
|
||||||
|
*
|
||||||
|
* @param string $stringtoescape String to escape
|
||||||
|
* @return string Escaped string for XML content.
|
||||||
|
*/
|
||||||
|
function dol_escape_xml($stringtoescape)
|
||||||
|
{
|
||||||
|
return $stringtoescape;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a string label (so on 1 line only and that should not contains any HTML) ready to be output on HTML page
|
* Return a string label (so on 1 line only and that should not contains any HTML) ready to be output on HTML page
|
||||||
* To use text that is not HTML content inside an attribute, use can simply only dol_escape_htmltag(). In doubt, use dolPrintHTMLForAttribute().
|
* To use text that is not HTML content inside an attribute, use can simply only dol_escape_htmltag(). In doubt, use dolPrintHTMLForAttribute().
|
||||||
@@ -4712,7 +4723,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco
|
|||||||
'margin', 'map-marker-alt', 'member', 'meeting', 'minus', 'money-bill-alt', 'movement', 'mrp', 'note', 'next',
|
'margin', 'map-marker-alt', 'member', 'meeting', 'minus', 'money-bill-alt', 'movement', 'mrp', 'note', 'next',
|
||||||
'off', 'on', 'order',
|
'off', 'on', 'order',
|
||||||
'paiment', 'paragraph', 'play', 'pdf', 'phone', 'phoning', 'phoning_mobile', 'phoning_fax', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'proposal', 'puce',
|
'paiment', 'paragraph', 'play', 'pdf', 'phone', 'phoning', 'phoning_mobile', 'phoning_fax', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'proposal', 'puce',
|
||||||
'stock', 'resize', 'service', 'stats', 'trip',
|
'stock', 'resize', 'service', 'stats',
|
||||||
'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'switch_on_warning', 'switch_on_red', 'tools', 'unlink', 'uparrow', 'user', 'user-tie', 'vcard', 'wrench',
|
'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'switch_on_warning', 'switch_on_red', 'tools', 'unlink', 'uparrow', 'user', 'user-tie', 'vcard', 'wrench',
|
||||||
'github', 'google', 'jabber', 'microsoft', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
|
'github', 'google', 'jabber', 'microsoft', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
|
||||||
'generic', 'home', 'hrm', 'members', 'products', 'invoicing',
|
'generic', 'home', 'hrm', 'members', 'products', 'invoicing',
|
||||||
@@ -4722,7 +4733,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco
|
|||||||
'error', 'warning',
|
'error', 'warning',
|
||||||
'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'replacement', 'resource', 'recurring','rss',
|
'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'replacement', 'resource', 'recurring','rss',
|
||||||
'shapes', 'skill', 'square', 'sort-numeric-down', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
|
'shapes', 'skill', 'square', 'sort-numeric-down', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
|
||||||
'terminal', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
|
'terminal', 'tick', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', 'trip',
|
||||||
'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private',
|
'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private',
|
||||||
'conferenceorbooth', 'eventorganization',
|
'conferenceorbooth', 'eventorganization',
|
||||||
'stamp', 'signature',
|
'stamp', 'signature',
|
||||||
@@ -4774,8 +4785,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco
|
|||||||
'refresh' => 'redo', 'region' => 'map-marked', 'replacement' => 'exchange-alt', 'resource' => 'laptop-house', 'recurring' => 'history',
|
'refresh' => 'redo', 'region' => 'map-marked', 'replacement' => 'exchange-alt', 'resource' => 'laptop-house', 'recurring' => 'history',
|
||||||
'service' => 'concierge-bell',
|
'service' => 'concierge-bell',
|
||||||
'skill' => 'shapes', 'state' => 'map-marked-alt', 'security' => 'key', 'salary' => 'wallet', 'shipment' => 'dolly', 'stock' => 'box-open', 'stats' => 'chart-bar', 'split' => 'code-branch', 'stripe' => 'stripe-s',
|
'skill' => 'shapes', 'state' => 'map-marked-alt', 'security' => 'key', 'salary' => 'wallet', 'shipment' => 'dolly', 'stock' => 'box-open', 'stats' => 'chart-bar', 'split' => 'code-branch', 'stripe' => 'stripe-s',
|
||||||
'supplier' => 'building', 'technic' => 'cogs',
|
'supplier' => 'building',
|
||||||
'timespent' => 'clock', 'title_setup' => 'tools', 'title_accountancy' => 'money-check-alt', 'title_bank' => 'university', 'title_hrm' => 'umbrella-beach',
|
'technic' => 'cogs', 'tick' => 'check', 'timespent' => 'clock', 'title_setup' => 'tools', 'title_accountancy' => 'money-check-alt', 'title_bank' => 'university', 'title_hrm' => 'umbrella-beach',
|
||||||
'title_agenda' => 'calendar-alt',
|
'title_agenda' => 'calendar-alt',
|
||||||
'uncheck' => 'times', 'uparrow' => 'share', 'url' => 'external-link-alt', 'vat' => 'money-check-alt', 'vcard' => 'arrow-alt-circle-down',
|
'uncheck' => 'times', 'uparrow' => 'share', 'url' => 'external-link-alt', 'vat' => 'money-check-alt', 'vcard' => 'arrow-alt-circle-down',
|
||||||
'jabber' => 'comment-o',
|
'jabber' => 'comment-o',
|
||||||
@@ -4884,7 +4895,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco
|
|||||||
'other' => '#ddd', 'world' => '#986c6a',
|
'other' => '#ddd', 'world' => '#986c6a',
|
||||||
'partnership' => '#6c6aa8', 'playdisabled' => '#ccc', 'printer' => '#444', 'projectpub' => '#986c6a', 'reception' => '#a69944', 'resize' => '#444', 'rss' => '#cba',
|
'partnership' => '#6c6aa8', 'playdisabled' => '#ccc', 'printer' => '#444', 'projectpub' => '#986c6a', 'reception' => '#a69944', 'resize' => '#444', 'rss' => '#cba',
|
||||||
//'shipment'=>'#a69944',
|
//'shipment'=>'#a69944',
|
||||||
'security' => '#999', 'square' => '#888', 'stop-circle' => '#888', 'stats' => '#444', 'switch_off' => '#999', 'technic' => '#999', 'timespent' => '#555',
|
'security' => '#999', 'square' => '#888', 'stop-circle' => '#888', 'stats' => '#444', 'switch_off' => '#999',
|
||||||
|
'technic' => '#999', 'tick' => '#282', 'timespent' => '#555',
|
||||||
'uncheck' => '#800', 'uparrow' => '#555', 'user-cog' => '#999', 'country' => '#aaa', 'globe-americas' => '#aaa', 'region' => '#aaa', 'state' => '#aaa',
|
'uncheck' => '#800', 'uparrow' => '#555', 'user-cog' => '#999', 'country' => '#aaa', 'globe-americas' => '#aaa', 'region' => '#aaa', 'state' => '#aaa',
|
||||||
'website' => '#304', 'workstation' => '#a69944'
|
'website' => '#304', 'workstation' => '#a69944'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -347,9 +347,9 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
|
|||||||
fwrite($fichier, "\n");
|
fwrite($fichier, "\n");
|
||||||
|
|
||||||
fwrite($fichier, "<channel>\n");
|
fwrite($fichier, "<channel>\n");
|
||||||
fwrite($fichier, "<title>".$title."</title>\n");
|
fwrite($fichier, "<title>".dol_escape_xml($title)."</title>\n");
|
||||||
if ($langcode) {
|
if ($langcode) {
|
||||||
fwrite($fichier, "<language>".$langcode."</language>\n");
|
fwrite($fichier, "<language>".dol_escape_xml($langcode)."</language>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define $urlwithroot
|
// Define $urlwithroot
|
||||||
@@ -365,7 +365,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt
|
|||||||
|
|
||||||
// Image
|
// Image
|
||||||
if (!empty($mysoc->logo_squarred_small)) {
|
if (!empty($mysoc->logo_squarred_small)) {
|
||||||
$urlimage = $urlwithroot.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($mysoc->logo_squarred_small);
|
$urlimage = $urlwithroot.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_small);
|
||||||
if ($urlimage) {
|
if ($urlimage) {
|
||||||
fwrite($fichier, "<image><url><![CDATA[".$urlimage."]]></url><title>'.$title.</title></image>\n");
|
fwrite($fichier, "<image><url><![CDATA[".$urlimage."]]></url><title>'.$title.</title></image>\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user