mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
Fix for legacy rss feed url and news post 'visibility' form element.
This commit is contained in:
parent
114cede50c
commit
c7675f616a
@ -376,7 +376,7 @@ class news_admin_ui extends e_admin_ui
|
||||
'news_category' => array('title' => NWSLAN_6, 'type' => 'dropdown', 'tab'=>0, 'data' => 'int', 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'batch'=>true, 'filter'=>true),
|
||||
'news_start' => array('title' => "Starting", 'type' => 'datestamp', 'tab'=>2, 'writeParms'=>'type=datetime', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'parms' => 'mask=%A %d %B %Y'),
|
||||
'news_end' => array('title' => "Ending", 'type' => 'datestamp', 'tab'=>2, 'writeParms'=>'type=datetime', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'parms' => 'mask=%A %d %B %Y'),
|
||||
'news_class' => array('title' => LAN_VISIBILITY, 'type' => 'userclasses','tab'=>2, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'batch'=>true, 'filter'=>true),
|
||||
'news_class' => array('title' => LAN_VISIBILITY, 'type' => 'userclasses','tab'=>2, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'batch'=>true, 'filter'=>true),
|
||||
'news_render_type' => array('title' => LAN_TEMPLATE, 'type' => 'dropdown', 'tab'=>0, 'data'=> 'str', 'inline'=>false, 'width' => 'auto', 'thclass' => 'left', 'class' => 'left', 'nosort' => false, 'batch'=>true, 'filter'=>true),
|
||||
'news_sticky' => array('title' => LAN_NEWS_28, 'type' => 'boolean', 'tab'=>2, 'data' => 'int' , 'width' => 'auto', 'thclass' => 'center', 'class' => 'center', 'nosort' => false, 'batch'=>true, 'filter'=>true),
|
||||
'news_allow_comments' => array('title' => NWSLAN_15, 'type' => 'boolean', 'tab'=>2, 'writeParms'=>'inverse=1', 'data' => 'int', 'width' => 'auto', 'thclass' => 'center', 'class' => 'center', 'nosort' => false,'batch'=>true, 'filter'=>true,'readParms'=>'reverse=1','writeParms'=>'inverse=1'),
|
||||
@ -455,6 +455,7 @@ class news_admin_ui extends e_admin_ui
|
||||
|
||||
public function afterCreate($new_data, $old_data, $id)
|
||||
{
|
||||
$this->processPings();
|
||||
e107::getEvent()->trigger('newspost',$new_data);
|
||||
e107::getEvent()->trigger('admin_news_created',$new_data);
|
||||
$evdata = array('method'=>'create', 'table'=>'news', 'id'=>$id, 'plugin'=>'news', 'function'=>'submit_item');
|
||||
@ -466,6 +467,8 @@ class news_admin_ui extends e_admin_ui
|
||||
|
||||
public function afterUpdate($new_data, $old_data, $id)
|
||||
{
|
||||
$this->processPings();
|
||||
e107::getMessage()->addInfo(print_a($new_data,true));
|
||||
e107::getEvent()->trigger('newsupd', $new_data);
|
||||
e107::getEvent()->trigger('admin_news_updated',$new_data);
|
||||
|
||||
@ -580,6 +583,9 @@ class news_admin_ui extends e_admin_ui
|
||||
$this->saveSettings();
|
||||
}
|
||||
|
||||
|
||||
// e107::getMessage()->addDebug(print_a($_POST,true));
|
||||
|
||||
if($this->getAction() == 'create' || $this->getAction() == 'edit')
|
||||
{
|
||||
uksort($this->fields, array($this, 'ukfield'));
|
||||
@ -594,12 +600,14 @@ class news_admin_ui extends e_admin_ui
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// $mod = $this->getModel();
|
||||
// $info = print_a($mod, true);
|
||||
|
||||
// e107::getMessage()->addInfo($info);
|
||||
|
||||
$this->processPings();
|
||||
|
||||
|
||||
|
||||
$sql = e107::getDb();
|
||||
@ -667,7 +675,9 @@ class news_admin_ui extends e_admin_ui
|
||||
|
||||
$mes = e107::getMessage();
|
||||
|
||||
if(vartrue($_POST['news_ping'],false) && (count($pingServices)>0) && in_array(e_UC_PUBLIC, $_POST['news_userclass']))
|
||||
$mes->addDebug("Checking for Ping Status",'default',true);
|
||||
|
||||
if(!empty($_POST['news_ping']) && (count($pingServices)>0) && (in_array(e_UC_PUBLIC, $_POST['news_class'])))
|
||||
{
|
||||
$mes->addDebug("Initiating ping",'default',true);
|
||||
|
||||
@ -694,13 +704,23 @@ class news_admin_ui extends e_admin_ui
|
||||
|
||||
if($this->ping($server, $port, $path, $weblog_name, $weblog_url, $changes_url, $cat_or_rss, $extended))
|
||||
{
|
||||
e107::getMessage()->addDebug("Successfully Pinged: ".$server .' with '.$changes_url , 'default', true);
|
||||
e107::getMessage()->addInfo("Successfully Pinged: ".$server .' with:<br />url: '.$changes_url .'<br />rss: '.$cat_or_rss , 'default', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
e107::getMessage()->addDebug("Ping failed!: ".$server .' with '.$changes_url , 'default', true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// $mes->addDebug("Ping not triggerred",'default',true);
|
||||
// $mes->addDebug("Services: ".print_a($pingServices, true),'default', true);
|
||||
// $mes->addDebug("Userclass: ".print_a($_POST['news_class'],true),'default', true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -468,8 +468,8 @@ class e_form
|
||||
function iconpreview($id, $default, $width='', $height='') // FIXME
|
||||
{
|
||||
// XXX - $name ?!
|
||||
$parms = $name."|".$width."|".$height."|".$id;
|
||||
$sc_parameters .= 'mode=preview&default='.$default.'&id='.$id;
|
||||
// $parms = $name."|".$width."|".$height."|".$id;
|
||||
$sc_parameters = 'mode=preview&default='.$default.'&id='.$id;
|
||||
return e107::getParser()->parseTemplate("{ICONPICKER=".$sc_parameters."}");
|
||||
}
|
||||
|
||||
@ -812,7 +812,9 @@ class e_form
|
||||
}
|
||||
|
||||
$cat = vartrue($sc_parameters['media']) ? $tp->toDB($sc_parameters['media']) : "_common_file";
|
||||
|
||||
|
||||
$ret = '';
|
||||
|
||||
if($sc_parameters['data'] === 'array')
|
||||
{
|
||||
// Do not use $this->hidden() method - as it will break 'id' value.
|
||||
@ -903,7 +905,7 @@ class e_form
|
||||
if(vartrue($options['inline']))
|
||||
{
|
||||
$text .= "<div class='{$class}' id='inline-{$id}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}' ></div>
|
||||
<input type='hidden' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}' />
|
||||
<input type='hidden' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}' />
|
||||
";
|
||||
}
|
||||
else
|
||||
@ -1155,13 +1157,14 @@ class e_form
|
||||
|
||||
|
||||
/**
|
||||
* Textarea Element
|
||||
* Textarea Element
|
||||
* @param $name
|
||||
* @param $value
|
||||
* @param $rows
|
||||
* @param $cols
|
||||
* @param $options
|
||||
* @param $count
|
||||
* @return string
|
||||
*/
|
||||
function textarea($name, $value, $rows = 10, $cols = 80, $options = array(), $counter = false)
|
||||
{
|
||||
@ -1772,6 +1775,12 @@ class e_form
|
||||
|
||||
function uc_select($name, $current_value, $uc_options, $select_options = array(), $opt_options = array())
|
||||
{
|
||||
|
||||
if(!empty($select_options['multiple']) && substr($name,-1) != ']')
|
||||
{
|
||||
$name .= '[]';
|
||||
}
|
||||
|
||||
return $this->select_open($name, $select_options)."\n".$this->_uc->vetted_tree($name, array($this, '_uc_select_cb'), $current_value, $uc_options, $opt_options)."\n".$this->select_close();
|
||||
}
|
||||
|
||||
@ -3916,9 +3925,9 @@ class e_form
|
||||
case 'userclasses':
|
||||
$uc_options = vartrue($parms['classlist'], 'public,guest,nobody,member,admin,main,classes'); // defaults to 'public,guest,nobody,member,classes' (userclass handler)
|
||||
unset($parms['classlist']);
|
||||
$method = ($attributes['type'] == 'userclass') ? 'uc_select' : 'uc_select';
|
||||
if(vartrue($atrributes['type']) == 'userclasses'){ $parms['multiple'] = true; }
|
||||
$ret = $this->$method($key, $value, $uc_options, vartrue($parms, array()));
|
||||
// $method = ($attributes['type'] == 'userclass') ? 'uc_select' : 'uc_select';
|
||||
if(vartrue($attributes['type']) == 'userclasses'){ $parms['multiple'] = true; }
|
||||
$ret = $this->uc_select($key, $value, $uc_options, vartrue($parms, array()));
|
||||
break;
|
||||
|
||||
/*case 'user_name':
|
||||
|
@ -60,26 +60,34 @@ else
|
||||
}
|
||||
|
||||
// Query handler
|
||||
if(!empty($_GET))
|
||||
if(!empty($_GET['type']))
|
||||
{
|
||||
$content_type = $tp->toDB($_GET['cat']);
|
||||
$rss_type = intval(varset($_GET['type'],0));
|
||||
$topic_id = $tp->toDB($_GET['topic'],'');
|
||||
|
||||
}
|
||||
elseif (e_QUERY)
|
||||
elseif(e_QUERY)
|
||||
{
|
||||
$tmp = explode('.', e_QUERY);
|
||||
|
||||
$content_type = $tp->toDB($tmp[0]);
|
||||
$rss_type = intval(varset($tmp[1],0));
|
||||
$topic_id = $tp->toDB($tmp[2],'');
|
||||
}
|
||||
else
|
||||
{
|
||||
$content_type = false;
|
||||
$topic_id = false;
|
||||
}
|
||||
|
||||
|
||||
// List available rss feeds
|
||||
if (empty($rss_type))
|
||||
{ // Display list of all feeds
|
||||
|
||||
require_once(HEADERF);
|
||||
|
||||
// require_once(e_PLUGIN.'rss_menu/rss_template.php'); Already loaded
|
||||
|
||||
if(!$sql->select('rss', '*', "`rss_class`=0 AND `rss_limit`>0 AND `rss_topicid` NOT REGEXP ('\\\*') ORDER BY `rss_name`"))
|
||||
|
@ -94,7 +94,7 @@ class e107TinyMceParser
|
||||
|
||||
if(!empty($content) && E107_DEBUG_LEVEL > 0)
|
||||
{
|
||||
$content = "-- DEBUG MODE ACTIVE -- \n".$content;
|
||||
// $content = "-- DEBUG MODE ACTIVE -- \n".$content;
|
||||
// echo htmlentities($content)."\n";
|
||||
// echo "<pre>".$content."</pre>";
|
||||
$text = $content;
|
||||
|
@ -38,10 +38,10 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
// Emoticons
|
||||
ed.addButton('e107-emotes', {
|
||||
text: '',
|
||||
ed.addButton('e107-bbcode', {
|
||||
text: 'bbcode',
|
||||
icon: 'emoticons',
|
||||
onclick: function() {
|
||||
// Open window
|
||||
@ -49,7 +49,8 @@
|
||||
ed.windowManager.open({
|
||||
title: 'Example plugin',
|
||||
body: [
|
||||
{type: 'textbox', name: 'title', label: 'Title'}
|
||||
{type: 'textbox', name: 'code', label: 'BbCode'},
|
||||
{type: 'textbox', name: 'parm', label: 'Parameters'}
|
||||
],
|
||||
onsubmit: function(e) {
|
||||
// Insert content when the window form is submitted
|
||||
@ -59,7 +60,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
*/
|
||||
// Media Manager Button
|
||||
ed.addButton('e107-image', {
|
||||
text: '',
|
||||
|
@ -3,7 +3,7 @@
|
||||
<plugins>advlist autolink autosave lists link image charmap print preview hr anchor pagebreak searchreplace wordcount visualblocks visualchars code fullscreen
|
||||
insertdatetime media nonbreaking save table contextmenu directionality emoticons template paste textcolor emoticons </plugins>
|
||||
<menubar>edit view format insert table tools</menubar>
|
||||
<toolbar1>undo redo | removeformat | styleselect | bold italic underline forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image template | e107-image e107-video fontawesome smileys | preview</toolbar1>
|
||||
<toolbar1>undo redo | removeformat | styleselect | bold italic underline forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image template | e107-image e107-video e107-bbcode smileys | preview</toolbar1>
|
||||
<external_plugins>e107 example compat3x</external_plugins>
|
||||
<image_advtab>true</image_advtab>
|
||||
<extended_valid_elements>i[*], object[*],embed[*],bbcode[*]</extended_valid_elements>
|
||||
|
@ -463,6 +463,9 @@ class wysiwyg
|
||||
]";
|
||||
|
||||
|
||||
// https://github.com/valtlfelipe/TinyMCE-LocalAutoSave
|
||||
|
||||
|
||||
/*
|
||||
$ret['setup'] = "function(ed) {
|
||||
ed.addMenuItem('test', {
|
||||
@ -475,8 +478,45 @@ class wysiwyg
|
||||
});
|
||||
}";
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
// e107 Bbcodes.
|
||||
/*
|
||||
|
||||
$ret['setup'] = "function(ed) {
|
||||
ed.addButton('e107-bbcode', {
|
||||
text: 'bbcode',
|
||||
icon: 'emoticons',
|
||||
onclick: function() {
|
||||
// Open window
|
||||
|
||||
ed.windowManager.open({
|
||||
title: 'Example plugin',
|
||||
body: [
|
||||
{type: 'listbox', name: 'code', label: 'BbCode', values: [
|
||||
{text: 'Left', value: 'left'},
|
||||
{text: 'Right', value: 'right'},
|
||||
{text: 'Center', value: 'center'}
|
||||
]},
|
||||
{type: 'textbox', name: 'parm', label: 'Parameters'}
|
||||
],
|
||||
onsubmit: function(e) {
|
||||
|
||||
var selected = ed.selection.getContent({format : 'text'});
|
||||
|
||||
// alert(selected);
|
||||
// Insert content when the window form is submitted
|
||||
ed.insertContent('[' + e.data.code + ']' + selected + '[/' + e.data.code + ']');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}";
|
||||
*/
|
||||
|
||||
|
||||
// Emoticon Support @see //https://github.com/nhammadi/Smileys
|
||||
if(e107::pref('core','smiley_activate',false))
|
||||
|
Loading…
x
Reference in New Issue
Block a user