1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 19:44:09 +02:00

Submit-news working again. Admin Newspost re-work (needs testing), additional JS for dialogs etc.

This commit is contained in:
CaMer0n
2012-05-17 09:19:44 +00:00
parent f8b32d89ce
commit 6b6701f900
10 changed files with 928 additions and 51 deletions

View File

@@ -19,6 +19,12 @@ require_once('../class2.php');
//TODO - marj prepare language reorganisation
//include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
if($_GET['iframe'] == 1)
{
define('e_IFRAME', true);
}
$e_sub_cat = 'main';
require_once('auth.php');
require_once(e_HANDLER.'admin_handler.php');

View File

@@ -245,10 +245,6 @@ class media_admin_ui extends e_admin_ui
// //protected $editQry = "SELECT * FROM #comments WHERE comment_id = {ID}";
// protected $tableJoin = array(
// 'u.user' => array('leftField' => 'media_author', 'rightField' => 'user_id', 'fields' => 'user_id,user_loginname,user_name')
// );
protected $pid = "media_id";
protected $perPage = 10;
protected $batchDelete = true;
@@ -673,7 +669,7 @@ class media_admin_ui extends e_admin_ui
{
if(!$sc_path) return array();
$path = e107::getParser()->replaceConstants($sc_path);
$info = e107::getFile()->get_file_info($path);
$info = e107::getFile()->get_file_info($path,true);
return array(
'media_type' => $info['mime'],
'media_datestamp' => time(),

View File

@@ -202,7 +202,15 @@ $text .= render_infopanel_options();
$text .= "</form>";
$text .= "</div>";
$ns->tablerender(ADLAN_47." ".ADMINNAME, $emessage->render().$text);
if($_GET['mode'] != 'customize')
{
$ns->tablerender(ADLAN_47." ".ADMINNAME, $emessage->render().$text);
}
else
{
echo render_infopanel_options(true);
}
@@ -223,12 +231,21 @@ function render_info_panel($caption, $text)
// ------------------
function render_infopanel_options()
function render_infopanel_options($render = false)
{
$frm = e107::getSingleton('e_form');
$start = "<div>To customize this page, please <a href='#customize_icons' class='e-expandit'>click here</a>.</div>
<div class='e-hideme' id='customize_icons' style='border:1px solid silver;margin:10px'>";
$text2 = "<h2>Icons</h2>";
// $frm = e107::getSingleton('e_form');
$frm = e107::getForm();
$mes = e107::getMessage();
$start = "<div>
To customize this page, please <a title = 'Customize Admin' href='".e_SELF."?mode=customize&iframe=1' class='e-modal-iframe'>click here</a>.
</div>
";
if($render == false){ return $start; }
$text2 = "<div id='customize_icons' class='forumheader3' style='border:0px;margin:0px'>
<form method='post' 'id='e-modal-form' action='".e_SELF."?".e_QUERY."'>
<h2>Icons</h2>";
$text2 .= render_infopanel_icons();
$text2 .= "<div class='clear'>&nbsp;</div>";
$text2 .= "<h2>Menus</h2>";
@@ -236,10 +253,11 @@ function render_infopanel_options()
$text2 .= "<div class='clear'>&nbsp;</div>";
$text2 .= "<div id='button' class='buttons-bar center'>";
$text2 .= $frm->admin_button('submit-mye107', 'Save', 'Save');
$text2 .= "</div>";
$text2 .= "</div></form></div>";
$end = "</div>";
return $start.render_info_panel("Customize", $text2).$end;
return $mes->render().$text2.$end;
}

View File

@@ -41,6 +41,477 @@ if($newspost->ajax_observer()) exit;
e107::js('core','core/admin.js','prototype');
//e107::getJs()->requireCoreLib('core/admin.js');
class news_admin extends e_admin_dispatcher
{
protected $modes = array(
'main' => array(
'controller' => 'news_admin_ui',
'path' => null,
'ui' => 'news_form_ui',
'uipath' => null
),
'cat' => array(
'controller' => 'news_cat_ui',
'path' => null,
'ui' => 'news_cat_form_ui',
'uipath' => null
),
'sub' => array(
'controller' => 'news_sub_ui',
'path' => null,
'ui' => 'news_sub_form_ui',
'uipath' => null
)
);
protected $adminMenu = array(
'main/list' => array('caption'=> NWSLAN_44, 'perm' => 'H'),
'main/create' => array('caption'=> NWSLAN_45, 'perm' => 'H'), // Create/Edit News Item
// 'cat/list' => array('caption'=> NWSLAN_46, 'perm' => '7'), // Category List
'cat/list' => array('caption'=> NWSLAN_46, 'perm' => '7'), // Create Category.
'cat/create' => array('caption'=> "Create Category", 'perm' => '7'), // Category List
'main/settings' => array('caption'=> LAN_PREFS, 'perm' => '0'), // Preferences
'main/submitted' => array('caption'=> "Old Submitted ", 'perm' => 'N'), // Submitted News
'sub/list' => array('caption'=> NWSLAN_47, 'perm' => 'N'), // Submitted News
// 'main/maint' => array('caption'=> LAN_NEWS_55, 'perm' => '0') // Maintenance
);
protected $adminMenuAliases = array(
'main/edit' => 'main/list',
'cat/edit' => 'cat/list'
);
protected $menuTitle = "News";
}
class news_cat_ui extends e_admin_ui
{
protected $pluginTitle = 'News Categories';
protected $pluginName = 'core';
protected $table = "news_category";
protected $pid = "category_id";
protected $perPage = 0; //no limit
protected $batchDelete = false;
protected $fields = array(
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
'category_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE, 'readonly'=>TRUE),
'category_icon' => array('title'=> LAN_ICON, 'type' => 'icon', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>FALSE, 'batch' => FALSE, 'filter'=>FALSE),
'category_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
'category_meta_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'readonly'=>FALSE),
'category_meta_keywords' => array('title'=> "Meta Keywords", 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
'category_sef' => array('title'=> "SEF Url String", 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE), // Display name
'category_manager' => array('title'=> "Manage Permissions",'type' => 'userclass', 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE),
'category_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => 'auto', 'thclass' => 'right', 'class'=> 'right' ),
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center')
);
protected $fieldpref = array('checkboxes', 'category_icon', 'category_id', 'category_name', 'category_description','category_manager', 'category_order', 'options');
protected $newspost;
function init()
{
$this->newspost = new admin_newspost;
}
// function createPage()
// {
// $this->newspost->show_categories();
// }
public function beforeCreate($new_data)
{
}
public function beforeUpdate($new_data, $old_data, $id)
{
}
}
class news_cat_form_ui extends e_admin_form_ui
{
}
// Submitted News Area.
class news_sub_ui extends e_admin_ui
{
protected $pluginTitle = NWSLAN_47;
protected $pluginName = 'core';
protected $table = "submitnews";
protected $pid = "submitnews_id";
protected $perPage = 20; //no limit
protected $batchDelete = true;
protected $formQuery = "mode=main&amp;action=create";
protected $listOrder = "submitnews_id desc";
// submitnews_id submitnews_name submitnews_email submitnews_title submitnews_category submitnews_item submitnews_datestamp submitnews_ip submitnews_auth submitnews_file
protected $fields = array(
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
'submitnews_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE, 'readonly'=>TRUE),
'submitnews_title' => array('title'=> LAN_TITLE, 'type' => 'method', 'width' => '65%', 'thclass' => 'left', 'readonly'=>TRUE),
'submitnews_datestamp' => array('title' => LAN_NEWS_32, 'type' => 'date', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'parms' => 'mask=%A %d %B %Y'),
'submitnews_category' => array('title'=> LAN_CATEGORY, 'type' => 'dropdown', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
// 'submitnews_item' => array('title'=> LAN_DESCRIPTION, 'type' => 'method', 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'readonly'=>TRUE),
'submitnews_name' => array('title'=> LAN_AUTHOR, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>TRUE),
'submitnews_ip' => array('title'=> "IP", 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>TRUE),
'submitnews_auth' => array('title'=> "User", 'type' => 'user', 'width' => 'auto', 'thclass' => 'right', 'class'=> 'right' ),
'options' => array('title'=> LAN_OPTIONS, 'type' => "method", 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center')
);
protected $fieldpref = array('checkboxes', 'submitnews_id', 'submitnews_title', 'submitnews_category', 'options');
protected $newspost;
protected $cats;
function init()
{
$sql = e107::getDb();
$sql->db_Select_gen("SELECT category_id,category_name FROM #news_category");
while($row = $sql->db_Fetch())
{
$cat = $row['category_id'];
$this->cats[$cat] = $row['category_name'];
}
asort($this->cats);
$this->fields['submitnews_category']['writeParms'] = $this->cats;
$this->newspost = new admin_newspost;
}
// function createPage()
// {
// $this->newspost->show_categories();
// }
public function beforeCreate($new_data)
{
}
public function beforeUpdate($new_data, $old_data, $id)
{
}
}
class news_sub_form_ui extends e_admin_form_ui
{
function submitnews_title($cur,$val)
{
$tp = e107::getParser();
$row = $this->getController()->getListModel();
$submitnews_id = $row->get('submitnews_id');
$submitnews_title = $row->get('submitnews_title');
$submitnews_file = $row->get('submitnews_file');
$submitnews_item = $row->get('submitnews_item');
$text .= "<a href='#submitted_".$submitnews_id."' class='e-modal' >";
$text .= $tp->toHTML($submitnews_title,FALSE,'emotes_off, no_make_clickable');
$text .= '</a>';
$text .= "<div id='submitted_".$submitnews_id."' title='".$tp->toAttribute($submitnews_title)."' style='display:none'>".$tp->toHTML($submitnews_item,TRUE);
if($submitnews_file)
{
$tmp = explode(',',$submitnews_file);
$text .= "<br />";
foreach($tmp as $imgfile)
{
$text .= "<br /><img src='".e_UPLOAD.$imgfile."' alt='".$imgfile."' />";
}
}
$text .= "\n</div>";
return $text;
}
// Override the default Options field.
function options($parms, $value, $id, $attributes)
{
if($attributes['mode'] == 'read')
{
$approved = $this->getController()->getListModel()->get('submitnews_auth'); // approved;
if($approved == 0)
{
$text = $this->submit_image('submitnews['.$id.']', 1, 'execute', NWSLAN_58);
// NWSLAN_103;
}
else // Already submitted;
{
}
$text .= $this->submit_image('etrigger_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete'.$delcls));
return $text;
}
}
}
// Main News Area.
class news_admin_ui extends e_admin_ui
{
protected $pluginTitle = 'Media Categories';
protected $pluginName = 'core';
protected $table = "news";
protected $pid = "news_id";
protected $perPage = 20; //no limit
protected $batchDelete = true;
protected $batchCopy = true;
protected $listOrder = "news_id desc";
protected $listQry = "SELECT n.*,u.user_id,u.user_name FROM #news AS n LEFT JOIN #user AS u ON n.news_author = u.user_id "; // without any Order or Limit.
protected $fields = array(
'checkboxes' => array('title' => '', 'type' => null, 'width' => '3%', 'thclass' => 'center first', 'class' => 'center', 'nosort' => true, 'toggle' => 'news_selected', 'forced' => TRUE),
'news_id' => array('title' => LAN_NEWS_45, 'type' => 'number', 'width' => '5%', 'thclass' => 'center', 'class' => 'center', 'nosort' => false),
'news_thumbnail' => array('title' => NWSLAN_67, 'type' => 'image', 'width' => '110px', 'thclass' => 'center', 'class' => "center", 'nosort' => false, 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','writeParams' => 'path={e_MEDIA}','readonly'=>false),
'news_title' => array('title' => NWSLAN_40, 'type' => 'text', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false),
'news_summary' => array('title' => LAN_NEWS_27, 'type' => 'text', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false),
'news_meta_keywords' => array('title' => LAN_KEYWORDS, 'type' => 'text', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false),
'news_meta_description' => array('title' => LAN_DESCRIPTION,'type' => 'text', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false),
'news_sef' => array('title' => 'SEF URL', 'type' => 'text', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false),
'user_name' => array('title' => LAN_NEWS_50, 'type' => 'text', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false),
'news_datestamp' => array('title' => LAN_NEWS_32, 'type' => 'datestamp', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'parms' => 'mask=%A %d %B %Y'),
'news_category' => array('title' => NWSLAN_6, 'type' => 'dropdown', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'batch'=>true, 'filter'=>true),
'news_start' => array('title' => "Start", 'type' => 'datestamp', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'parms' => 'mask=%A %d %B %Y'),
'news_end' => array('title' => "End", 'type' => 'datestamp', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'parms' => 'mask=%A %d %B %Y'),
'news_class' => array('title' => NWSLAN_22, 'type' => 'userclass', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'batch'=>true, 'filter'=>true),
'news_render_type' => array('title' => LAN_NEWS_49, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'thclass' => 'center', 'class' => null, 'nosort' => false, 'batch'=>true, 'filter'=>true),
'news_sticky' => array('title' => LAN_NEWS_28, 'type' => 'boolean', 'width' => 'auto', 'thclass' => 'center', 'class' => 'center', 'nosort' => false, 'batch'=>true, 'filter'=>true),
'news_allow_comments' => array('title' => NWSLAN_15, 'type' => 'boolean', 'width' => 'auto', 'thclass' => 'center', 'class' => 'center', 'nosort' => false),
'news_comment_total' => array('title' => LAN_NEWS_60, 'type' => 'number', 'width' => '10%', 'thclass' => '', 'class' => null, 'nosort' => false),
'options' => array('title' => LAN_OPTIONS, 'type' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center', 'nosort' => true, 'forced' => TRUE)
);
protected $cats = array();
protected $newspost;
function init()
{
$sql = e107::getDb();
$sql->db_Select_gen("SELECT category_id,category_name FROM #news_category");
while($row = $sql->db_Fetch())
{
$cat = $row['category_id'];
$this->cats[$cat] = $row['category_name'];
}
asort($this->cats);
$this->fields['news_category']['writeParms'] = $this->cats;
$this->fields['news_render_type']['writeParms'] = array(NWSLAN_75,NWSLAN_76,NWSLAN_77,NWSLAN_77." 2");
$this->newspost = new admin_newspost;
$this->newspost->observer();
}
function createPage()
{
// print_a($_POST);
if(isset($_POST['submitnews']))
{
$id = key($_POST['submitnews']);
$this->loadSubmitted($id);
}
else
{
$this->preCreate();
}
$this->newspost->show_create_item();
}
function categoryPage()
{
if(!getperms('0|7'))
{
$this->noPermissions();
}
$this->newspost->show_categories();
// $newspost->show_create_item();
}
function submittedPage()
{
$this->newspost->show_submitted_news();
}
function maintPage()
{
}
function settingsPage()
{
$this->newspost->show_news_prefs();
}
function noPermissions($qry = '')
{
$url = e_SELF.($qry ? '?'.$qry : '');
if($qry !== e_QUERY)
{
$mes = e107::getMessage();
$this->show_message('Insufficient permissions!', E_MESSAGE_ERROR, true);
session_write_close();
header('Location: '.$url);
}
exit;
}
function loadSubmitted($id)
{
$sql = e107::getDb();
$tp = e107::getParser();
if ($sql->db_Select("submitnews", "*", "submitnews_id=".intval($id), TRUE))
{
//list($id, $submitnews_name, $submitnews_email, $_POST['news_title'], $submitnews_category, $_POST['news_body'], $submitnews_datestamp, $submitnews_ip, $submitnews_auth, $submitnews_file) = $sql->db_Fetch();
$row = $sql->db_Fetch();
$_POST['news_title'] = $row['submitnews_title'];
$_POST['news_body'] = $row['submitnews_item'];
$_POST['cat_id'] = $row['submitnews_category'];
if (defsettrue('e_WYSIWYG'))
{
if (substr($_POST['news_body'],-7,7) == '[/html]') $_POST['news_body'] = substr($_POST['news_body'],0,-7);
if (substr($_POST['news_body'],0,6) == '[html]') $_POST['news_body'] = substr($_POST['news_body'],6);
$_POST['news_body'] .= "<br /><b>".NWSLAN_49." {$row['submitnews_name']}</b>";
$_POST['news_body'] .= ($row['submitnews_file'])? "<br /><br /><img src='{e_NEWSIMAGE}{$row['submitnews_file']}' class='f-right' />": '';
}
else
{
$_POST['news_body'] .= "\n[[b]".NWSLAN_49." {$row['submitnews_name']}[/b]]";
if($row['submitnews_file'])
{
$files = explode(",",$row['submitnews_file']);
foreach($files as $f)
{
if($bbpath = e107::getMedia()->importFile($f,'news'))
{
$_POST['news_body'] .= "\n\n[img]".$bbpath."[/img]";
}
}
}
}
$_POST['data'] = $tp->dataFilter($_POST['data']); // Filter any nasties
$_POST['news_title'] = $tp->dataFilter($_POST['news_title']);
}
}
function preCreate()
{
if($_GET['action'] == "edit" && !$_POST['preview'])
{
if(!isset($_POST['submit_news']))
{
if(e107::getDb()->db_Select('news', '*', 'news_id='.intval($_GET['id'])))
{
$row = e107::getDb()->db_Fetch();
// if(!isset($this->news_categories[$row['news_category']]))
{
// $this->noPermissions();
}
$_POST['news_title'] = $row['news_title'];
$_POST['news_sef'] = $row['news_sef'];
$_POST['news_body'] = $row['news_body'];
$_POST['news_author'] = $row['news_author'];
$_POST['news_extended'] = $row['news_extended'];
$_POST['news_allow_comments'] = $row['news_allow_comments'];
$_POST['news_class'] = $row['news_class'];
$_POST['news_summary'] = $row['news_summary'];
$_POST['news_sticky'] = $row['news_sticky'];
$_POST['news_datestamp'] = ($_POST['news_datestamp']) ? $_POST['news_datestamp'] : $row['news_datestamp'];
$_POST['cat_id'] = $row['news_category'];
$_POST['news_start'] = $row['news_start'];
$_POST['news_end'] = $row['news_end'];
$_POST['comment_total'] = e107::getDb()->db_Count("comments", "(*)", " WHERE comment_item_id={$row['news_id']} AND comment_type='0'");
$_POST['news_render_type'] = $row['news_render_type'];
$_POST['news_thumbnail'] = $row['news_thumbnail'];
$_POST['news_meta_keywords'] = $row['news_meta_keywords'];
$_POST['news_meta_description'] = $row['news_meta_description'];
}
}
}
}
}
class news_form_ui extends e_admin_form_ui
{
}
new news_admin();
require_once(e_ADMIN."auth.php");
e107::getAdminUI()->runPage();
if(!e_AJAX_REQUEST) require_once("footer.php");
exit;
function headerjs()
{
@@ -1768,7 +2239,8 @@ class admin_newspost
";
$emessage = eMessage::getInstance();
$e107->ns->tablerender($this->getSubAction() == 'edit' ? NWSLAN_29a : NWSLAN_29, $emessage->render().$text);
echo $emessage->render().$text;
// $e107->ns->tablerender($this->getSubAction() == 'edit' ? NWSLAN_29a : NWSLAN_29, $emessage->render().$text);
}
@@ -2056,8 +2528,9 @@ class admin_newspost
";
e107::getRender()->tablerender(NWSLAN_46a, e107::getMessage()->render().$text);
echo e107::getMessage()->render().$text;
// e107::getRender()->tablerender(NWSLAN_46a, e107::getMessage()->render().$text);
}
function show_categoriy_list()
@@ -2110,8 +2583,15 @@ class admin_newspost
<td class='center middle'>{$icon}</td>
<td class='middle'>{$url}</td>
<td class='middle'>".$frm->uc_select('multi_category_manager['.$category['category_id'].']', vartrue($category['category_manager'], e_UC_ADMIN), 'main,admin,classes')."</td>
<td class='center middle'>
<a class='action' id='core-news-catedit-{$category['category_id']}' href='".e_SELF."?cat.edit.{$category['category_id']}' tabindex='".$frm->getNext()."'>".defset('ADMIN_EDIT_ICON', '<img src="'.e_IMAGE_ABS.'admin_images/edit_16.png" alt="Edit" />')."</a>
<td class='center middle'>";
$text .= "<a class='action' id='core-news-catedit-{$category['category_id']}' href='".e_SELF."?mode=cat&amp;action=edit&amp;id={$category['category_id']}' tabindex='".$frm->getNext()."'>".defset('ADMIN_EDIT_ICON', '<img src="'.e_IMAGE_ABS.'admin_images/edit_16.png" alt="Edit" />')."</a>";
// $text .= "<a class='action' id='core-news-catedit-{$category['category_id']}' href='".e_SELF."?cat.edit.{$category['category_id']}' tabindex='".$frm->getNext()."'>".defset('ADMIN_EDIT_ICON', '<img src="'.e_IMAGE_ABS.'admin_images/edit_16.png" alt="Edit" />')."</a>";
$text .= "
".$frm->submit_image("delete[category_{$category['category_id']}]", $category['category_id'], 'delete', e107::getParser()->toJS(NWSLAN_37." [ID: {$category['category_id']} ]"))."
</td>
<td class='middle center'>".$frm->text('multi_category_order['.$category['category_id'].']', $category['category_order'], 3, 'size=2&tabindex='.$tindex)."</td>
@@ -2292,7 +2772,8 @@ class admin_newspost
</fieldset>
</form>
";
e107::getRender()->tablerender(NWSLAN_90, e107::getMessage()->render().$text);
echo e107::getMessage()->render().$text;
// e107::getRender()->tablerender(NWSLAN_90, e107::getMessage()->render().$text);
}

View File

@@ -1102,6 +1102,54 @@ $text .= "
</fieldset>
";
// File Uploads
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_upload.php");
$text .= "
<fieldset class='e-hideme' id='core-prefs-uploads'>
<legend>File Uploading</legend>
<table class='adminform'>
<colgroup>
<col class='col-label' />
<col class='col-control' />
</colgroup>
<tbody>
<tr>
<td class='label'>".UPLLAN_25."</td>
<td class='control'>".
$frm->radio_switch('upload_enabled', $pref['upload_enabled'], LAN_YES, LAN_NO)
."
<div class='field-help'>".UPLLAN_26."</div>
</td>
</tr>
<tr>
<td class='label'>".UPLLAN_33."<br />
</td>
<td class='control'>".
$frm->text('upload_maxfilesize', $pref['upload_maxfilesize'], 10)
."
<div class='field-help'>".UPLLAN_34." (upload_max_filesize = ".ini_get('upload_max_filesize').", post_max_size = ".ini_get('post_max_size')." )</div>
</td>
</tr>
<tr>
<td class='label'>".UPLLAN_37."</td>
<td class='control'>".r_userclass("upload_class", $pref['upload_class'],"off","nobody,public,guest,member,admin,classes")."
<div class='field-help'>".UPLLAN_38."</div>
</td>
</tr>
</tbody>
</table>
".pref_submit('uploads')."
</fieldset>";
// Javascript Control
//TODO LANS
$text .= "
@@ -1353,6 +1401,7 @@ function prefs_adminmenu()
$var['core-prefs-textpost']['text'] = PRFLAN_101;
$var['core-prefs-security']['text'] = PRFLAN_47;
$var['core-prefs-comments']['text'] = PRFLAN_210;
$var['core-prefs-uploads']['text'] = "File Uploading"; // TODO LAN
$var['core-prefs-javascript']['text'] = "Javascript Framework"; // TODO LAN
$var['core-prefs-advanced']['text'] = PRFLAN_149;
e_admin_menu(LAN_OPTIONS.'--id--prev_nav', 'core-prefs-main', $var);

View File

@@ -445,7 +445,7 @@ CREATE TABLE submitnews (
submitnews_datestamp int(10) unsigned NOT NULL default '0',
submitnews_ip varchar(45) NOT NULL default '',
submitnews_auth tinyint(3) unsigned NOT NULL default '0',
submitnews_file varchar(100) NOT NULL default '',
submitnews_file text NOT NULL,
PRIMARY KEY (submitnews_id)
) ENGINE=MyISAM;
# --------------------------------------------------------