1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

More featurebox tweaks

This commit is contained in:
CaMer0n 2012-06-06 07:39:42 +00:00
parent 3571186d82
commit 625525304f
7 changed files with 164 additions and 19 deletions

View File

@ -75,7 +75,7 @@ class media_admin extends e_admin_dispatcher
'cat/list' => array('caption'=> 'Media Categories', 'perm' => 'A'),
'cat/create' => array('caption'=> "Create Category", 'perm' => 'A'), // is automatic.
'main/settings' => array('caption'=> LAN_PREFS, 'perm' => 'A'),
// 'main/prefs' => array('caption'=> LAN_PREFS, 'perm' => 'A'),
'main/avatar' => array('caption'=> IMALAN_23, 'perm' => 'A')
);
@ -200,6 +200,44 @@ class media_form_ui extends e_admin_form_ui
}
asort($this->cats);*/
}
function resize_method($curval)
{
$frm = e107::getForm();
$options = array(
'gd1' => 'gd1',
'gd2' => 'gd2',
'ImageMagick' => 'ImageMagick'
);
return $frm->selectbox('resize_method',$options,$curval)."<div class='field-help'>".IMALAN_4."</div>";
}
function resize_dimensions($curval) // ie. never manually resize another image again!
{
$text = "";
$frm = e107::getForm();
$options = array(
"news-image" => "News Images",
"news-bbcode" => "News [img] bbcode",
"page-bbcode" => "Page [img] bbcode",
// "featurebox-image" => "Featurebox Images",
// "featurebox-bbcode" => "Featurebox [img] bbcode",
);
$text .= "<div>Non-functional example (maximum width and maximum height)</div>";
foreach($options as $key=>$title)
{
$text .= "<input type='text' name='resize_dimensions[{$key}]' value='$val' size='7' title='hello' /> ".$title."<br />";
// $text .= $frm->text("resize_dimensions[{$key}]",$val, 5, array('size'=>'5')).$title."<br />";
}
return $text;
}
function options()
{
@ -313,13 +351,75 @@ class media_admin_ui extends e_admin_ui
/*
protected $prefs = array(
'pref_type' => array('title'=> 'type', 'type'=>'text'),
'pref_folder' => array('title'=> 'folder', 'type' => 'boolean'),
'pref_name' => array('title'=> 'name', 'type' => 'text')
);*/
protected $prefs = array(
'image_post' => array('title'=> IMALAN_1, 'type'=>'boolean', 'data'=>'int', 'writeParms'=>'help=IMALAN_2'),
'image_post_class' => array('title'=> IMALAN_10, 'type' => 'userclass', 'data'=>'int', 'writeParms'=>'help=IMALAN_11&classlist=public,guest,nobody,member,admin,main,classes' ),
'image_post_disabled_method' => array('title'=> IMALAN_12, 'type' => 'boolean','writeParms'=>'enabled=IMALAN_15&disabled=IMALAN_14'),
'resize_method' => array('title'=> IMALAN_3, 'type'=>'method', 'data'=>'str'),
'resize_dimensions' => array('title'=> "Resize Dimensions", 'type'=>'method', 'data'=>'str'),
);
/*
<tr>
<td class='label'>
".IMALAN_1."
</td>
<td class='control'>
<div class='auto-toggle-area autocheck'>
".$frm->checkbox('image_post', 1, $pref['image_post'])."
<div class='field-help'>".IMALAN_2."</div>
</div>
</td>
</tr>
<tr>
<td class='label'>
".IMALAN_10."
</td>
<td class='control'>
".r_userclass('image_post_class',$pref['image_post_class'],"off","public,guest,nobody,member,admin,main,classes")."
<div class='field-help'>".IMALAN_11."</div>
</td>
</tr>
<tr>
<td class='label'>
".IMALAN_12."
</td>
<td class='control'>
".$frm->select_open('image_post_disabled_method')."
".$frm->option(IMALAN_14, '0', ($pref['image_post_disabled_method'] == "0"))."
".$frm->option(IMALAN_15, '1', ($pref['image_post_disabled_method'] == "1"))."
".$frm->select_close()."
<div class='field-help'>".IMALAN_13."</div>
</td>
</tr>";
list($img_import_w,$img_import_h) = explode("x",$pref['img_import_resize']);
//TODO LANS
$text .= "
<tr>
<td class='label'>Resize images during media import<div class='label-note'>Leave empty to disable</div></td>
<td class='control'>
".$frm->text('img_import_resize_w', $img_import_w,4)."px X ".$frm->text('img_import_resize_h', $img_import_h,4)."px
</td>
</tr>
<tr>
<td class='label'>".IMALAN_3."<div class='label-note'>".IMALAN_54." {$gd_version}</div></td>
<td class='control'>
".$frm->select_open('resize_method')."
".$frm->option('gd1', 'gd1', ($pref['resize_method'] == "gd1"))."
".$frm->option('gd2', 'gd2', ($pref['resize_method'] == "gd2"))."
".$frm->option('ImageMagick', 'ImageMagick', ($pref['resize_method'] == "ImageMagick"))."
".$frm->select_close()."
<div class='field-help'>".IMALAN_4."</div>
</td>
</tr>";
*/
protected $cats = array();
protected $owner = array();
protected $ownercats = array();

View File

@ -1282,9 +1282,10 @@ $text .= "
// e107 minimum loaded by default once dependency is removed.
$js_types = array(
array('id' => 'prototype', 'name'=> 'Prototype (local)'),
array('id' => 'prototype-cdn', 'name'=> 'Prototype (CDN)'),
array('id' => 'jquery', 'name'=> 'jQuery (CDN)')
array('id' => 'prototype', 'name'=> 'Prototype (local)'),
// array('id' => 'prototype-cdn', 'name'=> 'Prototype (CDN)'),
array('id' => 'jquery', 'name'=> 'jQuery (local)'),
// array('id' => 'jquery-cdn', 'name'=> 'jQuery (CDN)')
);

View File

@ -634,6 +634,7 @@ class e_form
$ret = "
<div class='bbarea {$size}'>
<div class='field-spacer'><!-- --></div>\n";
$ret .= e107::getBB()->renderButtons($template,$help_tagid);
$ret .= $this->textarea($name, $value, $rows, 50, $options, $counter);
@ -1570,7 +1571,8 @@ class e_form
}
$attributes['writeParms']['raw'] = true;
$tmp = $this->renderElement($field, '', $attributes);
$value = $pre.vartrue($tmp[$value]).$post;
// $value = $pre.vartrue($tmp[$value]).$post; // FIXME "Fatal error: Only variables can be passed by reference" featurebox list page.
break;
case 'dropdown':
@ -1928,7 +1930,7 @@ class e_form
case 'bbarea':
$options = array('counter' => varset($parms['counter'], false));
$ret = $this->bbarea($key, $value, vartrue($parms['help']), vartrue($parms['helptag']), vartrue($parms['size'], 'medium'),$options );
$ret = $this->bbarea($key, $value, vartrue($parms['template']), vartrue($parms['helptag']), vartrue($parms['size'], 'medium'),$options );
break;
case 'image': //TODO - thumb, image list shortcode, js tooltip...
@ -2124,6 +2126,10 @@ class e_form
$text .= "<div id='{$k}' class='e-hideme'>".$ret."</div>";
return $text;
}
else
{
$ret .= vartrue($parms['help']) ? '<div class="field-help">'.$tp->toHtml($parms['help'],false,'defs').'</div>' : '';
}
return $ret;
}

View File

@ -23,6 +23,13 @@ class e_jsmanager
'scriptaculous/scriptaculous.js',
'scriptaculous/effects.js',
'e107.js'),
/*
'jquery' => array(
"jquery/jquery-1.7.2.min.js",
"jquery/jquery-ui-1.8.21.custom.min.js",
"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/base/jquery-ui.css"
),
*/
'jquery' => array(
"http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js",
@ -632,7 +639,14 @@ class e_jsmanager
{
if(strpos($inc,".css"))
{
$this->addJs('other_css', $inc, 'all', '<!-- AutoLoad -->');
if(strpos($inc,"://")) // cdn
{
$this->addJs('other_css', $inc, 'all', '<!-- AutoLoad -->');
}
else
{
$this->addJs('core_css', $inc, 'all', '<!-- AutoLoad -->');
}
}
else
{

View File

@ -177,7 +177,7 @@ class fb_main_ui extends e_admin_ui
'fb_id' => array('title'=> LAN_ID, 'type' => 'number', 'data'=> 'int', 'width' =>'5%', 'forced'=> TRUE),
'fb_category' => array('title'=> LAN_CATEGORY, 'type' => 'dropdown', 'data'=> 'int', 'width' => '5%', 'filter'=>TRUE, 'batch'=>TRUE),
'fb_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left'),
'fb_text' => array('title'=> "Message Text", 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'),
'fb_text' => array('title'=> "Message Text", 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1','writeParms'=>'template=admin'),
//DEPRECATED 'fb_mode' => array('title'=> FBLAN_12, 'type' => 'dropdown', 'data'=> 'int', 'width' => '5%', 'filter'=>TRUE, 'batch'=>TRUE),
//DEPRECATED 'fb_rendertype' => array('title'=> FBLAN_22, 'type' => 'dropdown', 'data'=> 'int', 'width' => 'auto', 'noedit' => TRUE),
'fb_template' => array('title'=> FBLAN_25, 'type' => 'layouts', 'data'=> 'str', 'width' => 'auto', 'writeParms' => 'plugin=featurebox', 'filter' => true, 'batch' => true), // Photo

View File

@ -128,12 +128,25 @@ class plugin_featurebox_item extends e_model
public function sc_featurebox_thumb($parm='')
{
$tp = e107::getParser();
if(!$this->get('fb_image'))
{
return '';
}
$att = ($parm) ?$parm : 'aw=100&ah=60';
return e107::getParser()->thumbUrl($this->get('fb_image'),$att);
parse_str($parm, $parm);
$att = ($parm['aw']) ? "aw=".$parm['aw'] : 'aw=100&ah=60';
$src = e107::getParser()->thumbUrl($this->get('fb_image'),$att);
if(isset($parm['src']))
{
return $src;
}
else
{
return '<img id="featurebox-thumb-'.$this->getId().'" src="'.$src.'" alt="'.$tp->toAttribute($this->get('fb_title')).'" class="featurebox" />';
}
}
/**

View File

@ -38,7 +38,7 @@ $FEATUREBOX_TEMPLATE['image_right'] = '
$FEATUREBOX_TEMPLATE['camera'] = '
<div class="featurebox-item" data-thumb="{FEATUREBOX_THUMB}" data-src="{FEATUREBOX_IMAGE|camera=src}" data-link="{FEATUREBOX_URL}">
<div class="featurebox-item" data-thumb="{FEATUREBOX_THUMB=src}" data-src="{FEATUREBOX_IMAGE|camera=src}" data-link="{FEATUREBOX_URL}">
<div class="featurebox-text camera_effected" style="position:absolute">
<div class="featurebox-title">{FEATUREBOX_TITLE|camera}</div>
<div class="featurebox-text">{FEATUREBOX_TEXT|camera}</div>
@ -49,7 +49,7 @@ $FEATUREBOX_TEMPLATE['camera'] = '
$FEATUREBOX_TEMPLATE['camera_caption'] = '
<div class="featurebox-item" data-thumb="{FEATUREBOX_THUMB}" data-src="{FEATUREBOX_IMAGE|camera=src}" data-link="{FEATUREBOX_URL}">
<div class="featurebox-item" data-thumb="{FEATUREBOX_THUMB=src}" data-src="{FEATUREBOX_IMAGE|camera=src}" data-link="{FEATUREBOX_URL}">
<div class="camera_caption fadeFromBottom">
<h3>{FEATUREBOX_TITLE|camera}</h3>
{FEATUREBOX_TEXT|camera}
@ -60,7 +60,17 @@ $FEATUREBOX_TEMPLATE['camera_caption'] = '
$FEATUREBOX_TEMPLATE['accordion'] = '
<h3 class="featurebox-title-accordion"><a href="#">{FEATUREBOX_TITLE|accordion}</a></h3>
<div class="featurebox-text-accordion" >
{FEATUREBOX_IMAGE|accordion}
{FEATUREBOX_TEXT|accordion}
<div class="clear"><!-- --></div>
</div>
';
$FEATUREBOX_TEMPLATE['tabs'] = '
<div class="featurebox-text-tabs" >
{FEATUREBOX_IMAGE|accordion}
{FEATUREBOX_TEXT|accordion}
<div class="clear"><!-- --></div>
</div>
';
@ -72,6 +82,7 @@ $FEATUREBOX_INFO = array(
'image_left' => array('title' => 'Left image (core)' , 'description' => 'Left floated image'),
'camera' => array('title' => 'Camera item', 'description' => 'For use with the "camera" category'),
'camera_caption' => array('title' => 'Camera item with caption', 'description' => 'For use with the "camera" category'),
'accordion' => array('title' => 'Accordion Item', 'description' => 'For use with accordion')
'accordion' => array('title' => 'Accordion Item', 'description' => 'For use with accordion'),
'tabs' => array('title' => 'Tab Item', 'description' => 'For use with tabs')
);
?>