1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-14 17:42:10 +02:00

News comment now showing only when they should, news_categories_menu fix, started final administration changes.

This commit is contained in:
secretr 2009-10-09 15:06:44 +00:00
parent d51de44974
commit 1050c3b94e
5 changed files with 70 additions and 44 deletions

View File

@ -9,8 +9,8 @@
* News Administration
*
* $Source: /cvs_backup/e107_0.8/e107_admin/newspost.php,v $
* $Revision: 1.56 $
* $Date: 2009-10-07 11:05:55 $
* $Revision: 1.57 $
* $Date: 2009-10-09 15:06:44 $
* $Author: secretr $
*/
require_once("../class2.php");
@ -259,19 +259,19 @@ class admin_newspost
$this->fieldpref = varset($user_pref['admin_news_columns'], array('news_id', 'news_title', 'news_author', 'news_render_type', 'options'));
$this->_fields = array(
"checkboxes" => array("title" => "", "forced"=> TRUE, "width" => "3%", "thclass" => "center first", "url" => ""),
"news_id" => array("title" => LAN_NEWS_45, "type"=>"number", "width" => "5%", "thclass" => "center", "url" => e_SELF."?main.news_id.".$this->_sort_link.".".$this->getFrom()),
"news_title" => array("title" => NWSLAN_40, "type"=>"text", "width" => "30%", "thclass" => "", "url" => e_SELF."?main.news_title.".$this->_sort_link.".".$this->getFrom()),
"news_author" => array("title" => LAN_NEWS_50, "type"=>"user", "width" => "10%", "thclass" => "", "url" => ""),
"news_datestamp" => array("title" => LAN_NEWS_32, "type"=>"datestamp", "width" => "15%", "thclass" => "", "url" => ""),
"news_category" => array("title" => NWSLAN_6, "type"=>"dropdown", "width" => "auto", "thclass" => "", "url" => ""),
"news_class" => array("title" => NWSLAN_22, "type"=>"userclass", "width" => "auto", "thclass" => "", "url" => ""),
"news_render_type" => array("title" => LAN_NEWS_49, "type"=>"dropdown", "width" => "auto", "thclass" => "center", "url" => ""),
"news_thumbnail" => array("title" => LAN_NEWS_22, "width" => "auto", "thclass" => "", "url" => ""),
"news_sticky" => array("title" => LAN_NEWS_28, "type"=>"boolean", "width" => "auto", "thclass" => "", "url" => ""),
"news_allow_comments" => array("title" => NWSLAN_15, "type"=>"boolean", "width" => "auto", "thclass" => "", "url" => ""),
"news_comment_total" => array("title" => LAN_NEWS_60, "type"=>"number", "width" => "auto", "thclass" => "", "url" => ""),
"options" => array("title" => LAN_OPTIONS, "width" => "10%", "thclass" => "center last", "url" => "", 'forced'=>TRUE)
'checkboxes' => array('title' => '', 'type' => null, 'width' => '3%', 'thclass' => 'center first', 'class' => null, 'url' => '', 'forced' => TRUE),
'news_id' => array('title' => LAN_NEWS_45, 'type' => 'number', 'width' => '5%', 'thclass' => 'center', 'class' => 'center', 'url' => e_SELF.'?main.news_id.'.$this->_sort_link.'.'.$this->getFrom()),
'news_title' => array('title' => NWSLAN_40, 'type' => 'text', 'width' => '30%', 'thclass' => '', 'class' => null, 'url' => e_SELF.'?main.news_title.'.$this->_sort_link.'.'.$this->getFrom()),
'news_author' => array('title' => LAN_NEWS_50, 'type' => 'user', 'width' => '10%', 'thclass' => '', 'class' => null, 'url' => ''),
'news_datestamp' => array('title' => LAN_NEWS_32, 'type' => 'datestamp', 'width' => '15%', 'thclass' => '', 'class' => null, 'url' => ''),
'news_category' => array('title' => NWSLAN_6, 'type' => 'dropdown', 'width' => 'auto', 'thclass' => '', 'class' => null, 'url' => ''),
'news_class' => array('title' => NWSLAN_22, 'type' => 'userclass', 'width' => 'auto', 'thclass' => '', 'class' => null, 'url' => ''),
'news_render_type' => array('title' => LAN_NEWS_49, 'type' => 'dropdown', 'width' => 'auto', 'thclass' => 'center', 'class' => null, 'url' => ''),
'news_thumbnail' => array('title' => LAN_NEWS_22, 'type' => null, 'width' => 'auto', 'thclass' => '', 'class' => null, 'url' => ''),
'news_sticky' => array('title' => LAN_NEWS_28, 'type' => 'boolean', 'width' => 'auto', 'thclass' => '', 'class' => null, 'url' => ''),
'news_allow_comments' => array('title' => NWSLAN_15, 'type' => 'boolean', 'width' => 'auto', 'thclass' => '', 'class' => null, 'url' => ''),
'news_comment_total' => array('title' => LAN_NEWS_60, 'type' => 'number', 'width' => 'auto', 'thclass' => '', 'class' => null, 'url' => ''),
'options' => array('title' => LAN_OPTIONS, 'width' => '10%', 'width' => null, 'thclass' => 'center last', 'class' => null, 'url' => '', 'forced' => TRUE)
);

View File

@ -9,9 +9,9 @@
* Form Handler
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
* $Revision: 1.46 $
* $Date: 2009-09-28 07:17:52 $
* $Author: e107coders $
* $Revision: 1.47 $
* $Date: 2009-10-09 15:06:44 $
* $Author: secretr $
*
*/
@ -642,47 +642,65 @@ class e_form
function columnSelector($columnsArray,$columnsDefault='',$id='column_options')
function columnSelector($columnsArray, $columnsDefault = '', $id = 'column_options')
{
$columnsArray = array_filter($columnsArray);
$text = "<div style='position:relative;float:right;'>
<a href='#".$id."' class='e-show-if-js e-expandit' title='Click to select columns to display'>
<img class='middle' src='".e_IMAGE_ABS."admin_images/select_columns_16.png' alt='select columns' /></a>
$text = "
<div style='position:relative;float:right;'>
<a href='#".$id."' class='e-show-if-js e-expandit' title='Click to select columns to display'>"
."<img class='icon' src='".e_IMAGE_ABS."admin_images/select_columns_16.png' alt='select columns' />"
."</a>
<div id='".$id."' class='e-show-if-js e-hideme col-selection'>
";
unset($columnsArray['options'], $columnsArray['checkboxes']);
<div id='".$id."' class='e-show-if-js e-hideme col-selection'>\n";
unset($columnsArray['options'],$columnsArray['checkboxes']);
foreach($columnsArray as $key=>$fld)
foreach($columnsArray as $key => $fld)
{
if(!varset($fld['forced']))
{
$checked = (in_array($key,$columnsDefault)) ? TRUE : FALSE;
$text .= $this->checkbox('e-columns[]', $key, $checked). varset($fld['title'])."<br />\n";
$text .= "
<div class='field-spacer'>
".$this->checkbox_label(varset($fld['title'], $key), 'e-columns[]', $key, $checked)."
</div>
";
}
}
$text .= "<div id='button' style='text-align:right'>\n"; // has issues with the checkboxes.
$text .= $this->admin_button('submit-e-columns','Save','Save');
// has issues with the checkboxes.
$text .= "
<div id='{$id}-button' class='right'>
".$this->admin_button('submit-e-columns', LAN_SAVE, 'update')."
</div>
</div>
</div>
";
$text .= "</div>\n";
$text .= "</div></div>";
$text .= "";
return $text;
}
function colGroup($fieldarray,$columnPref='')
function colGroup($fieldarray, $columnPref = '')
{
$text = "";
$count = 0;
foreach($fieldarray as $key=>$val)
{
if(in_array($key,$columnPref) || $key=='options' || varsettrue($val['forced']))
if(in_array($key, $columnPref) || $key=='options' || varsettrue($val['forced']))
{
$text .= "\n<col style='width: ".$val['width'].";'></col>";
$class = vartrue($val['class']) ? ' class="'.$val['class'].'"' : '';
$text .= '
<col style="width: '.$val['width'].';"'.$class.'></col>
';
$count++;
}
}
return "<colgroup span='".$count."'>\n".$text."\n</colgroup>\n";
return '
<colgroup span="'.$count.'">
'.$text.'
</colgroup>
';
}
function thead($fieldarray,$columnPref='',$querypattern = '')
@ -744,7 +762,11 @@ class e_form
}
}
return "<thead>\n<tr>\n".$text."\n</tr>\n</thead>\n\n";
return "
<thead>
<tr>".$text."</tr>
</thead>
";
}

View File

@ -9,8 +9,8 @@
* News handler
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/news_class.php,v $
* $Revision: 1.24 $
* $Date: 2009-09-25 20:13:47 $
* $Revision: 1.25 $
* $Date: 2009-10-09 15:06:43 $
* $Author: secretr $
*/
@ -1253,8 +1253,9 @@ class e_news_category_tree extends e_model
if($tablerender)
{
$caption = true === $tablerender ? 'News Categories' : defset($caption, $caption); //TODO lan
return e107::getRender()->tablerender($caption, $ret, varset($parms['mode'], 'news_categories_menu'), $return);
$caption = vartrue($parms['caption']) ? defset($parms['caption'], $parms['caption']) : LAN_NEWSCAT_MENU_TITLE; // found in plugins/news/languages/English.php
$mod = true === $tablerender ? 'news_categories_menu' : $tablerender;
return e107::getRender()->tablerender($caption, $ret, varset($parms['mode'], $mod), $return);
}
if($return) return $ret;

View File

@ -4,13 +4,14 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/news/languages/English.php,v $
| $Revision: 1.1 $
| $Date: 2009-09-19 21:48:52 $
| $Author: e107coders $
| $Revision: 1.2 $
| $Date: 2009-10-09 15:06:44 $
| $Author: secretr $
+----------------------------------------------------------------------------+
*/
define("TD_MENU_L1", "Other News");
define("TD_MENU_L2", "Other News");
define("LAN_NEWSCAT_MENU_TITLE", "News Categories");
?>

View File

@ -6,6 +6,8 @@ $cacheString = 'nq_news_categories_menu_'.preg_replace('#[^\w]#', '', $parm);
$cached = e107::getCache()->retrieve($cacheString);
if(false === $cached)
{
e107::includeLan(e_PLUGIN.'news/languages'.e_LANGUAGE.'.php');
parse_str($parm, $parms);
$ctree = e107::getObject('e_news_category_tree', null, e_HANDLER.'news_class.php');