mirror of
https://github.com/e107inc/e107.git
synced 2025-08-08 07:36:32 +02:00
Minor tweaks.
This commit is contained in:
@@ -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'))
|
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->gridQry = $this->listQry;
|
||||||
$this->listOrder = 'p.page_order asc'; // 'p.page_id desc';
|
$this->listOrder = 'p.page_order asc'; // 'p.page_id desc';
|
||||||
|
|
||||||
|
@@ -3247,8 +3247,8 @@ class e_db_mysql
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Backwards compatibility
|
* Backwards compatibility
|
||||||
*//*
|
*/
|
||||||
class db extends e_db_mysql
|
class db extends e_db_mysql
|
||||||
{
|
{
|
||||||
|
|
||||||
}*/
|
}
|
||||||
|
@@ -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
|
// TODO - catlist combo without current cat ID in write mode, parents only for batch/filter
|
||||||
// Get UI instance
|
// Get UI instance
|
||||||
|
|
||||||
|
/** @var faq_cat_ui $controller */
|
||||||
$controller = $this->getController();
|
$controller = $this->getController();
|
||||||
switch($mode)
|
switch($mode)
|
||||||
{
|
{
|
||||||
@@ -189,17 +191,16 @@ class faq_main_ui extends e_admin_ui
|
|||||||
protected $table = "faqs";
|
protected $table = "faqs";
|
||||||
// without any Order or Limit.
|
// 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 $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 $editQry = "SELECT * FROM #faqs WHERE faq_id = {ID}";
|
||||||
|
|
||||||
protected $pid = "faq_id";
|
protected $pid = "faq_id";
|
||||||
protected $perPage = 10;
|
protected $perPage = 15;
|
||||||
protected $batchDelete = true;
|
protected $batchDelete = true;
|
||||||
protected $batchCopy = true;
|
protected $batchCopy = true;
|
||||||
|
protected $batchExport = true;
|
||||||
|
|
||||||
protected $listOrder = 'faq_order ASC';
|
protected $listOrder = 'faq_order ASC';
|
||||||
protected $sortField = 'faq_order';
|
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'.
|
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)
|
function faq_parent($curVal,$mode)
|
||||||
{
|
{
|
||||||
// Get UI instance
|
// Get UI instance
|
||||||
|
|
||||||
|
/** @var faq_cat_ui $controller */
|
||||||
$controller = $this->getController();
|
$controller = $this->getController();
|
||||||
|
|
||||||
switch($mode)
|
switch($mode)
|
||||||
{
|
{
|
||||||
case 'read':
|
case 'read':
|
||||||
return e107::getParser()->toHTML($controller->getFaqCategory($curVal), false, 'TITLE');
|
return e107::getParser()->toHTML($controller->getFaqCategoryTree($curVal), false, 'TITLE');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'write':
|
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;
|
break;
|
||||||
|
|
||||||
case 'filter':
|
case 'filter':
|
||||||
case 'batch':
|
case 'batch':
|
||||||
return $controller->getFaqCategory();
|
return $controller->getFaqCategoryTree();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1591,28 +1591,33 @@ class news_front
|
|||||||
// v2.1.7 load the category template if found.
|
// v2.1.7 load the category template if found.
|
||||||
if(!empty($this->templateKey)) // predefined by NEWS_LAYOUT;
|
if(!empty($this->templateKey)) // predefined by NEWS_LAYOUT;
|
||||||
{
|
{
|
||||||
|
$this->addDebug("Template Mode",'NEWS_LAYOUT constant');
|
||||||
$tmpl = $layout[$this->templateKey];
|
$tmpl = $layout[$this->templateKey];
|
||||||
$param['template_key'] = 'news/'.$this->templateKey;
|
$param['template_key'] = 'news/'.$this->templateKey;
|
||||||
}
|
}
|
||||||
elseif(!empty($newsAr[1]['category_template']) && !empty($layout[$catTemplate])) // defined by news_category field.
|
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;
|
$this->templateKey = $catTemplate;
|
||||||
$tmpl = $layout[$this->templateKey];
|
$tmpl = $layout[$this->templateKey];
|
||||||
$param['template_key'] = 'news/'.$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
|
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'];
|
$tmpl = $layout['category'];
|
||||||
$this->templateKey = 'category';
|
$this->templateKey = 'category';
|
||||||
$param['template_key'] = 'news/category';
|
$param['template_key'] = 'news/category';
|
||||||
}
|
}
|
||||||
elseif(!empty($layout[$this->defaultTemplate])) // defined by default template 'news' pref. (newspost.php?mode=main&action=settings)
|
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];
|
$tmpl = $layout[$this->defaultTemplate];
|
||||||
$this->templateKey = $this->defaultTemplate;
|
$this->templateKey = $this->defaultTemplate;
|
||||||
}
|
}
|
||||||
else // fallback.
|
else // fallback.
|
||||||
{
|
{
|
||||||
|
$this->addDebug("Template Mode",'Fallback');
|
||||||
$tmpl = $layout['default'] ;
|
$tmpl = $layout['default'] ;
|
||||||
$this->defaultTemplate = 'default';
|
$this->defaultTemplate = 'default';
|
||||||
$this->templateKey = 'default';
|
$this->templateKey = 'default';
|
||||||
|
Reference in New Issue
Block a user