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

Feature box bugfixes and improvements

This commit is contained in:
secretr 2011-06-21 15:43:33 +00:00
parent 6c9275a0e7
commit f2d57ac05d
3 changed files with 33 additions and 5 deletions

View File

@ -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');

View File

@ -7,4 +7,5 @@
*/
define("FBLAN_01", "Feature Box");
define("FBLAN_02", "read more");
?>

View File

@ -90,7 +90,7 @@ $FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['js_inline'] = 'new Featurebox(\'featur
//TODO - tabs template.
//TODO - tabs template.
$FEATUREBOX_CATEGORY_TEMPLATE['tabs']['list_start'] = '
<div class="box featurebox admintabs" id="featurebox-tab-container">
{FEATUREBOX_NAVIGATION|tabs=loop&uselimit}
@ -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'] = '';
@ -126,12 +126,12 @@ $FEATUREBOX_CATEGORY_TEMPLATE['tabs']['js'] = '{e_FILE}jslib/core/tabs.js';
$FEATUREBOX_CATEGORY_TEMPLATE['tabs']['js_inline'] = 'new e107Widgets.Tabs("featurebox-tab-container", { bookmarkFix: false });';
/**
* Template information.
* Template information.
* Allowed keys:
* - title: Dropdown title (language constants are accepted e.g. 'MY_LAN')
* - [optional] description: Template description (language constants are accepted e.g. 'MY_LAN') - UNDER CONSTRUCTION
* - [optional] image: Template image preview (path constants are accepted e.g. '{e_PLUGIN}myplug/images/mytemplate_preview.png') - UNDER CONSTRUCTION
*
*
* @var array
*/
$FEATUREBOX_CATEGORY_INFO = array(