mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Feature box bugfixes and improvements
This commit is contained in:
@@ -41,6 +41,7 @@ class plugin_featurebox_item extends e_model
|
||||
* Parameter list (GET string format):
|
||||
* - alt: return title as tag attribute text
|
||||
* - url: add url tag to the output (only if 'fb_imageurl' is available)
|
||||
* - rel: rel tag attribute
|
||||
*
|
||||
* @param string $parm
|
||||
* @return string
|
||||
@@ -57,12 +58,38 @@ class plugin_featurebox_item extends e_model
|
||||
$ret = $tp->toHTML($this->get('fb_title'), false, 'TITLE');
|
||||
if(isset($parm['url']) && $this->get('fb_imageurl'))
|
||||
{
|
||||
return '<a id="featurebox-titleurl-'.$this->getId().'" href="'.$tp->replaceConstants($this->get('fb_imageurl'), 'full').'" title="'.$tp->toAttribute($this->get('fb_title')).'" rel="'.$tp->toAttribute(vartrue($parm['rel'], 'external')).'">'.$ret.'</a>';
|
||||
return '<a id="featurebox-titleurl-'.$this->getId().'" href="'.$tp->replaceConstants($this->get('fb_imageurl'), 'full').'" title="'.$tp->toAttribute($this->get('fb_title')).'" rel="'.$tp->toAttribute(vartrue($parm['rel'], '')).'">'.$ret.'</a>';
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameter list (GET string format):
|
||||
* - text: used if href is true
|
||||
* - href (1/0): return only URL if false, else return tag
|
||||
* - rel: rel tag attribute
|
||||
*
|
||||
* @param string $parm
|
||||
* @return string
|
||||
*/
|
||||
public function sc_featurebox_url($parm = '')
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
$url = $tp->replaceConstants($this->get('fb_imageurl'), 'full');
|
||||
if(empty($url)) return '';
|
||||
|
||||
parse_str($parm, $parm);
|
||||
if(!vartrue($parm['href']))
|
||||
{
|
||||
return $tp->replaceConstants($url);
|
||||
}
|
||||
|
||||
$title = vartrue($parm['text']) ? defset($parm['text']) : FBLAN_02;
|
||||
$alt = $tp->toAttribute($this->get('fb_title'), false, 'TITLE');
|
||||
return '<a id="featurebox-url-'.$this->getId().'" href="'.$url.'" title="'.$alt.'" rel="'.$tp->toAttribute(vartrue($parm['rel'], '')).'">'.$title.'</a>';
|
||||
}
|
||||
|
||||
public function sc_featurebox_text()
|
||||
{
|
||||
return e107::getParser()->toHTML($this->get('fb_text'), true, 'BODY');
|
||||
|
@@ -7,4 +7,5 @@
|
||||
*/
|
||||
|
||||
define("FBLAN_01", "Feature Box");
|
||||
define("FBLAN_02", "read more");
|
||||
?>
|
@@ -116,7 +116,7 @@ $FEATUREBOX_CATEGORY_TEMPLATE['tabs']['item_separator'] = '<div class="clear"><!
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['tabs']['item_empty'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['tabs']['nav_start'] = '<div class="tabs"><ul class="e-tabs clear" id="front-tabs">';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['tabs']['nav_item'] = '<li id="featurebox-tab-{FEATUREBOX_NAV_COUNTER}"><a href="#tab-{FEATUREBOX_NAV_COUNTER}-activate"><span>{FEATUREBOX_TITLE}</span></a></li>';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['tabs']['nav_item'] = '<li id="featurebox-tab-{FEATUREBOX_COUNTER}"><a href="#tab-{FEATUREBOX_COUNTER}-activate"><span>{FEATUREBOX_TITLE}</span></a></li>';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['tabs']['nav_end'] = '</ul></div>';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['tabs']['nav_separator'] = '';
|
||||
|
||||
|
Reference in New Issue
Block a user