1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

Allow for more than 2 default news layout options. (work in progress)

This commit is contained in:
Cameron
2017-09-26 12:32:55 -07:00
parent 8fc80c545b
commit a8a49f5aad
3 changed files with 49 additions and 6 deletions

View File

@@ -1098,9 +1098,21 @@ class news_admin_ui extends e_admin_ui
$sefbaseDiz = str_replace(array("[br]","[","]"), array("<br />","<a href='".e_ADMIN_ABS."eurl.php'>","</a>"), NWSLAN_128 ); $sefbaseDiz = str_replace(array("[br]","[","]"), array("<br />","<a href='".e_ADMIN_ABS."eurl.php'>","</a>"), NWSLAN_128 );
$pingOpt = array('placeholder'=>LAN_NEWS_87); $pingOpt = array('placeholder'=>LAN_NEWS_87);
$pingVal = (!empty($pref['news_ping_services'])) ? implode("\n",$pref['news_ping_services']) : ''; $pingVal = (!empty($pref['news_ping_services'])) ? implode("\n",$pref['news_ping_services']) : '';
$newsTemplates = array('default'=>LAN_DEFAULT, 'list'=>LAN_LIST); //TODO 'category'=>'Categories'? research 'Use non-standard template for news layout' and integrate here.
$newsTemplates = array();
if($newInfo = e107::getTemplateInfo('news', 'news')) //TODO 'category'=>'Categories'? research 'Use non-standard template for news layout' and integrate here.
{
foreach($newInfo as $k=>$val)
{
$newsTemplates[$k] = $val['title'];
}
}
else
{
$newsTemplates = array('default'=>LAN_DEFAULT, 'list'=>LAN_LIST);
}
$text = " $text = "
<form method='post' action='".e_REQUEST_URI."' id='core-newspost-settings-form'>"; <form method='post' action='".e_REQUEST_URI."' id='core-newspost-settings-form'>";

View File

@@ -1161,8 +1161,6 @@ class news_front
$tp = e107::getParser(); $tp = e107::getParser();
$sql = e107::getDb(); $sql = e107::getDb();
$interval = $this->pref['newsposts']; $interval = $this->pref['newsposts'];
global $NEWSSTYLE; global $NEWSSTYLE;
@@ -1500,7 +1498,18 @@ class news_front
else // v2.x else // v2.x
{ {
$layout = e107::getTemplate('news', 'news'); $layout = e107::getTemplate('news', 'news');
$tmpl = $layout['default']; // default - we show the full items, except for the 'extended' part.. if(!empty($layout[$this->defaultTemplate]))
{
$tmpl = $layout[$this->defaultTemplate];
$this->addDebug('Template key',$this->defaultTemplate);
}
else
{
$tmpl = $layout['default'] ;
$this->addDebug('Template key','default');
}
// $tmpl = !empty($layout[$this->defaultTemplate]) ? $layout[$this->defaultTemplate] : $layout['default'] ; // default - we show the full items, except for the 'extended' part..
$template = $tmpl['item']; $template = $tmpl['item'];
// unset($tmp); // unset($tmp);
} }

View File

@@ -14,10 +14,21 @@ global $sc_style;
//$NEWS_MENU_TEMPLATE['list']['start'] = '<ul class="nav nav-list news-menu-months">'; //$NEWS_MENU_TEMPLATE['list']['start'] = '<ul class="nav nav-list news-menu-months">';
//$NEWS_MENU_TEMPLATE['list']['end'] = '</ul>'; //$NEWS_MENU_TEMPLATE['list']['end'] = '</ul>';
$NEWS_TEMPLATE = array();
$NEWS_MENU_TEMPLATE['list']['start'] = '<div class="thumbnails">'; $NEWS_MENU_TEMPLATE['list']['start'] = '<div class="thumbnails">';
$NEWS_MENU_TEMPLATE['list']['end'] = '</div>'; $NEWS_MENU_TEMPLATE['list']['end'] = '</div>';
$NEWS_INFO = array(
'default' => array('title' => LAN_DEFAULT, 'description' => 'unused'),
'list' => array('title' => LAN_LIST, 'description' => 'unused'),
// '2-column' => array('title' => "2 Column", 'description' => 'unused'), //@todo more default listing options.
);
// XXX The ListStyle template offers a listed summary of items with a minimum of 10 items per page. // XXX The ListStyle template offers a listed summary of items with a minimum of 10 items per page.
// As displayed by news.php?cat.1 OR news.php?all // As displayed by news.php?cat.1 OR news.php?all
// {NEWSBODY} should not appear in the LISTSTYLE as it is NOT the same as what would appear on news.php (no query) // {NEWSBODY} should not appear in the LISTSTYLE as it is NOT the same as what would appear on news.php (no query)
@@ -121,8 +132,19 @@ $NEWS_TEMPLATE['default']['end'] = '';
$NEWS_TEMPLATE['category'] = $NEWS_TEMPLATE['default']; $NEWS_TEMPLATE['category'] = $NEWS_TEMPLATE['default'];
$NEWS_TEMPLATE['category']['start'] = '<!-- Category News Template -->'; $NEWS_TEMPLATE['category']['start'] = '<!-- Category News Template -->';
/**
* @todo
*/
$NEWS_TEMPLATE['2-column']['caption'] = '';
$NEWS_TEMPLATE['2-column']['start'] = '<div class="row">';
$NEWS_TEMPLATE['2-column']['item'] = '<div class="item col-md-6">
{SETIMAGE: w=400&h=400&crop=1}
{NEWSTHUMBNAIL=placeholder}
<h3>{NEWS_TITLE}</h3>
<p>{NEWS_SUMMARY}</p>
<p class="text-right"><a class="btn btn-primary btn-othernews" href="{NEWSURL}">' . LAN_READ_MORE . '</a></p>
</div>';
$NEWS_TEMPLATE['2-column']['end'] = '</div>';
###### Default view item (temporary) ###### ###### Default view item (temporary) ######