mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 05:37:32 +02:00
Bugfixe - corrects menu/page mixup in custom-pages. News-posts labelled correctly now and default field columns added.
This commit is contained in:
@@ -112,7 +112,13 @@ class page_admin extends e_admin_dispatcher
|
|||||||
{
|
{
|
||||||
|
|
||||||
protected $modes = array(
|
protected $modes = array(
|
||||||
'main' => array(
|
'page' => array(
|
||||||
|
'controller' => 'page_admin_ui',
|
||||||
|
'path' => null,
|
||||||
|
'ui' => 'page_admin_form_ui',
|
||||||
|
'uipath' => null
|
||||||
|
),
|
||||||
|
'menu' => array(
|
||||||
'controller' => 'page_admin_ui',
|
'controller' => 'page_admin_ui',
|
||||||
'path' => null,
|
'path' => null,
|
||||||
'ui' => 'page_admin_form_ui',
|
'ui' => 'page_admin_form_ui',
|
||||||
@@ -120,18 +126,18 @@ class page_admin extends e_admin_dispatcher
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
protected $adminMenu = array(
|
protected $adminMenu = array(
|
||||||
'main/list' => array('caption'=> CUSLAN_48, 'perm' => '5'),
|
'page/list' => array('caption'=> CUSLAN_48, 'perm' => '5'),
|
||||||
'main/menus' => array('caption'=> CUSLAN_49, 'perm' => 'J'),
|
'menu/list' => array('caption'=> CUSLAN_49, 'perm' => 'J'),
|
||||||
'main/create' => array('caption'=> CUSLAN_12, 'perm' => '5'),
|
'page/create' => array('caption'=> CUSLAN_12, 'perm' => '5'),
|
||||||
'main/createem' => array('caption'=> CUSLAN_31, 'perm' => 'J'),
|
'menu/create' => array('caption'=> CUSLAN_31, 'perm' => 'J'),
|
||||||
'main/options' => array('caption'=> LAN_OPTIONS, 'perm' => '0')
|
'page/options' => array('caption'=> LAN_OPTIONS, 'perm' => '0')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
protected $adminMenuAliases = array(
|
protected $adminMenuAliases = array(
|
||||||
'main/edit' => 'main/list'
|
'page/edit' => 'page/list',
|
||||||
|
'menu/edit' => 'menu/list'
|
||||||
);
|
);
|
||||||
|
|
||||||
protected $menuTitle = 'Custom Pages';
|
protected $menuTitle = 'Custom Pages';
|
||||||
@@ -209,8 +215,8 @@ class page_admin_ui extends e_admin_ui
|
|||||||
|
|
||||||
function init()
|
function init()
|
||||||
{
|
{
|
||||||
//FIX ME - mode not retained after using drop-down 'filter' or 'search'.
|
//FIXME - mode not retained after using drop-down 'filter' or 'search'.
|
||||||
if($_GET['mode'] =='main' && $_GET['action'] =='menus')
|
if($_GET['mode'] =='menu')
|
||||||
{
|
{
|
||||||
$this->listQry = "SELECT p.*,u.user_id,u.user_name FROM #page AS p LEFT JOIN #user AS u ON p.page_author = u.user_id WHERE p.page_theme != '' "; // without any Order or Limit.
|
$this->listQry = "SELECT p.*,u.user_id,u.user_name FROM #page AS p LEFT JOIN #user AS u ON p.page_author = u.user_id WHERE p.page_theme != '' "; // without any Order or Limit.
|
||||||
}
|
}
|
||||||
@@ -266,7 +272,10 @@ class page_admin_ui extends e_admin_ui
|
|||||||
function createPage($mode=FALSE)
|
function createPage($mode=FALSE)
|
||||||
{
|
{
|
||||||
/* mode: FALSE == page, mode: TRUE == menu */
|
/* mode: FALSE == page, mode: TRUE == menu */
|
||||||
|
if($_GET['mode'] =='menu')
|
||||||
|
{
|
||||||
|
$mode = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
global $e107, $e_userclass, $e_event;
|
global $e107, $e_userclass, $e_event;
|
||||||
@@ -283,7 +292,7 @@ class page_admin_ui extends e_admin_ui
|
|||||||
$edit = ($sub_action == 'edit');
|
$edit = ($sub_action == 'edit');
|
||||||
$caption =(!$mode ? ($edit ? CUSLAN_23 : CUSLAN_24) : ($edit ? CUSLAN_25 : CUSLAN_26));
|
$caption =(!$mode ? ($edit ? CUSLAN_23 : CUSLAN_24) : ($edit ? CUSLAN_25 : CUSLAN_26));
|
||||||
|
|
||||||
if ($sub_action == "edit" && !isset($_POST['preview']) && !isset($_POST['submit']))
|
if ($_GET['action'] == "edit" && !isset($_POST['preview']) && !isset($_POST['submit']))
|
||||||
{
|
{
|
||||||
|
|
||||||
//$url = e107::getUrl()->sc('page/view', $row, 'allow=page_id,page_title,page_sef');
|
//$url = e107::getUrl()->sc('page/view', $row, 'allow=page_id,page_title,page_sef');
|
||||||
@@ -403,7 +412,7 @@ class page_admin_ui extends e_admin_ui
|
|||||||
// $text .= "<textarea class='e-wysiwyg tbox' tabindex='".$frm->getNext()."' id='data' name='data' cols='80'{$insertjs}>".(strstr($data, "[img]http") ? $data : str_replace("[img]../", "[img]", $data))."</textarea>";
|
// $text .= "<textarea class='e-wysiwyg tbox' tabindex='".$frm->getNext()."' id='data' name='data' cols='80'{$insertjs}>".(strstr($data, "[img]http") ? $data : str_replace("[img]../", "[img]", $data))."</textarea>";
|
||||||
// <br />".display_help('cpage-help', 'cpage')."
|
// <br />".display_help('cpage-help', 'cpage')."
|
||||||
|
|
||||||
|
/*
|
||||||
$text .= "</td>
|
$text .= "</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -413,7 +422,7 @@ class page_admin_ui extends e_admin_ui
|
|||||||
|
|
||||||
|
|
||||||
";
|
";
|
||||||
|
*/
|
||||||
if(!$mode)
|
if(!$mode)
|
||||||
{
|
{
|
||||||
$text .= "
|
$text .= "
|
||||||
|
@@ -283,19 +283,19 @@ class news_sub_form_ui extends e_admin_form_ui
|
|||||||
|
|
||||||
class news_admin_ui extends e_admin_ui
|
class news_admin_ui extends e_admin_ui
|
||||||
{
|
{
|
||||||
protected $pluginTitle = 'Media Categories';
|
protected $pluginTitle = ADLAN_0; // "News"
|
||||||
protected $pluginName = 'core';
|
protected $pluginName = 'core';
|
||||||
protected $table = "news";
|
protected $table = "news";
|
||||||
protected $pid = "news_id";
|
protected $pid = "news_id";
|
||||||
protected $perPage = 20; //no limit
|
protected $perPage = 20; //no limit
|
||||||
protected $batchDelete = true;
|
protected $batchDelete = true;
|
||||||
protected $batchCopy = true;
|
protected $batchCopy = true;
|
||||||
protected $listOrder = "news_id desc";
|
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 $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(
|
protected $fields = array(
|
||||||
'checkboxes' => array('title' => '', 'type' => null, 'width' => '3%', 'thclass' => 'center first', 'class' => 'center', 'nosort' => true, 'toggle' => 'news_selected', 'forced' => TRUE),
|
'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_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_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),
|
||||||
@@ -319,7 +319,9 @@ class news_admin_ui extends e_admin_ui
|
|||||||
'news_comment_total' => array('title' => LAN_NEWS_60, 'type' => 'number', 'width' => '10%', 'thclass' => '', 'class' => null, '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)
|
'options' => array('title' => LAN_OPTIONS, 'type' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center', 'nosort' => true, 'forced' => TRUE)
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
protected $fieldpref = array('checkboxes','news_id', 'news_thumbnail', 'news_title', 'news_datestamp', 'news_category', 'options');
|
||||||
|
|
||||||
|
|
||||||
protected $cats = array();
|
protected $cats = array();
|
||||||
|
Reference in New Issue
Block a user