1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Minor tweaks.

This commit is contained in:
Cameron 2019-06-05 21:59:03 -07:00
parent 32c20a7453
commit 60b7f3ae6d
4 changed files with 19 additions and 11 deletions

View File

@ -704,7 +704,7 @@ class page_admin_ui extends e_admin_ui
if($this->getMode() === 'menu' && ($this->getAction() == 'list' || $this->getAction() == 'inline' || $this->getAction() == 'grid'))
{
$this->listQry = "SELECT SQL_CALC_FOUND_ROWS 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.menu_name != '' OR p.menu_image != '' OR p.menu_icon !='') "; // without any Order or Limit.
$this->listQry = "SELECT SQL_CALC_FOUND_ROWS 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.menu_title != '' OR p.menu_name != '' OR p.menu_image != '' OR p.menu_icon !='') "; // without any Order or Limit.
// $this->gridQry = $this->listQry;
$this->listOrder = 'p.page_order asc'; // 'p.page_id desc';

View File

@ -3247,8 +3247,8 @@ class e_db_mysql
/**
* Backwards compatibility
*//*
*/
class db extends e_db_mysql
{
}*/
}

View File

@ -161,6 +161,8 @@ class faq_cat_form_ui extends e_admin_form_ui
{
// TODO - catlist combo without current cat ID in write mode, parents only for batch/filter
// Get UI instance
/** @var faq_cat_ui $controller */
$controller = $this->getController();
switch($mode)
{
@ -188,18 +190,17 @@ class faq_main_ui extends e_admin_ui
protected $eventName = 'faqs';
protected $table = "faqs";
// without any Order or Limit.
//FIXME JOIN should occur automatically. We have all the data necessary to build the query.
// ie. faq_author is a 'user' field.
protected $listQry = "SELECT f.*, u.* FROM #faqs AS f LEFT JOIN #user AS u ON f.faq_author = u.user_id "; // Should not be necessary.
protected $editQry = "SELECT * FROM #faqs WHERE faq_id = {ID}";
protected $pid = "faq_id";
protected $perPage = 10;
protected $perPage = 15;
protected $batchDelete = true;
protected $batchCopy = true;
protected $batchExport = true;
protected $listOrder = 'faq_order ASC';
protected $sortField = 'faq_order';
protected $tabs = array(LANA_FAQ_QUESTION, LAN_DETAILS); // Simpler method than 'fieldsets'. Allows for easy moving of fields between tabs and works as required by 'news' and 'custom pages'.
@ -354,22 +355,24 @@ class faq_admin_form_ui extends e_admin_form_ui
function faq_parent($curVal,$mode)
{
// Get UI instance
/** @var faq_cat_ui $controller */
$controller = $this->getController();
switch($mode)
{
case 'read':
return e107::getParser()->toHTML($controller->getFaqCategory($curVal), false, 'TITLE');
return e107::getParser()->toHTML($controller->getFaqCategoryTree($curVal), false, 'TITLE');
break;
case 'write':
return $this->selectbox('faq_parent', $controller->getFaqCategory(), $curVal).$this->hidden('pending', $pending);
return $this->selectbox('faq_parent', $controller->getFaqCategoryTree(), $curVal).$this->hidden('pending', $pending);
break;
case 'filter':
case 'batch':
return $controller->getFaqCategory();
return $controller->getFaqCategoryTree();
break;
}
}

View File

@ -1591,28 +1591,33 @@ class news_front
// v2.1.7 load the category template if found.
if(!empty($this->templateKey)) // predefined by NEWS_LAYOUT;
{
$this->addDebug("Template Mode",'NEWS_LAYOUT constant');
$tmpl = $layout[$this->templateKey];
$param['template_key'] = 'news/'.$this->templateKey;
}
elseif(!empty($newsAr[1]['category_template']) && !empty($layout[$catTemplate])) // defined by news_category field.
{
$this->addDebug("Template Mode",'news_category database field');
$this->templateKey = $catTemplate;
$tmpl = $layout[$this->templateKey];
$param['template_key'] = 'news/'.$this->templateKey;
}
elseif($this->action === 'list' && isset($layout['category']) && !isset($layout['category']['body'])) // make sure it's not old news_categories.sc
{
$this->addDebug("Template Mode","'category' key defined in template file");
$tmpl = $layout['category'];
$this->templateKey = 'category';
$param['template_key'] = 'news/category';
}
elseif(!empty($layout[$this->defaultTemplate])) // defined by default template 'news' pref. (newspost.php?mode=main&action=settings)
{
$this->addDebug("Template Mode",'News Preferences: Default template');
$tmpl = $layout[$this->defaultTemplate];
$this->templateKey = $this->defaultTemplate;
}
else // fallback.
{
$this->addDebug("Template Mode",'Fallback');
$tmpl = $layout['default'] ;
$this->defaultTemplate = 'default';
$this->templateKey = 'default';