1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Featurebox work and other fixes

This commit is contained in:
Cameron 2013-03-08 02:19:18 -08:00
parent bfd095e0c4
commit 3fcd499f9f
11 changed files with 249 additions and 33 deletions

View File

@ -1744,7 +1744,10 @@ class e107
$obj = new $class_name;
if(method_exists($obj, $method_name))
{
$mes->debug('Executing <strong>'.$class_name.' :: '.$method_name.'()</strong>');
if(E107_DBG_INCLUDES)
{
$mes->debug('Executing <strong>'.$class_name.' :: '.$method_name.'()</strong>');
}
return call_user_func(array($obj, $method_name),$param);
}
else

View File

@ -2214,6 +2214,17 @@ class e_form
$attributes['writeParms']['raw'] = true;
$tmp = $this->renderElement($field, '', $attributes);
// Inline Editing. //FIXME!
if(!vartrue($attributes['noedit']) && vartrue($parms['editable']) && !vartrue($parms['link'])) // avoid bad markup, better solution coming up
{
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
$source = str_replace('"',"'",json_encode($wparms));
$value = "<a class='e-tip e-editable editable-click' data-name='".$field."' data-source=\"".$source."\" title=\"".LAN_EDIT." ".$attributes['title']."\" data-type='select' data-pk='".$id."' data-url='".e_SELF."?mode=&amp;action=inline&amp;id={$id}&amp;ajax_used=1' href='#'>".$value."</a>";
}
// $value = $pre.vartrue($tmp[$value]).$post; // FIXME "Fatal error: Only variables can be passed by reference" featurebox list page.
break;

View File

@ -29,6 +29,8 @@ class e_jslib
public function renderHeader($where = 'front', $return = false)
{
$ret = '';
/* DEPRECATED
$ret .= "
<script type=\"text/javascript\">
var e107Path = {
@ -47,6 +49,7 @@ class e_jslib
};
</script>
";
*/
// FIXED: convert e107.js.php to pure e107.js file
// FIXED: 'e_jslib_browser_cache' used by js_manager - add it together with all new prefs (JS management tab, Site preferences area)
// FIXED: option to use external sources (e.g. google) even if JS is combined (script tags for external sources)

View File

@ -43,10 +43,14 @@ class e_media
* @param string $fmask [optional] filetypes eg. .jpg|.gif IMAGES is the default mask.
* @return e_media
*/
public function import($cat='',$epath,$fmask='')
public function import($cat='',$epath,$fmask='',$options=array())
{
if(!vartrue($cat)){ return $this;}
if(is_string($options))
{
parse_str($options,$options);
}
if(!is_readable($epath))
{
@ -72,6 +76,18 @@ class e_media
$count = 0;
foreach($img_array as $f)
{
if(vartrue($options['min-width']) && ($f['img-width'] < $options['min-width']))
{
continue;
}
if(vartrue($options['min-size']) && ($f['fsize'] < $options['min-size']))
{
continue;
}
$fullpath = $tp->createConstants($f['path'].$f['fname'],1);
// echo "<br />cat=".$cat;
$insert = array(

View File

@ -597,8 +597,10 @@ class themeHandler
}
if($mode == 'choose')
{
echo "<div class='left'>".$frm->checkbox("install-demo-content",1)." Install Demo Content if available.</div>";
}
echo "</form>\n</div>\n";
@ -1329,7 +1331,7 @@ class themeHandler
$core->set('sitetheme_deflayout', $deflayout);
$core->set('sitetheme_custompages', $customPages);
$core->set('sitetheme_version', $version);
$core->set('sitetheme_releaseUrl', $this->themeArray[$name]['releaseUrl']);
// $core->set('sitetheme_releaseUrl', $this->themeArray[$name]['releaseUrl']);
$sql->db_Delete("menus", "menu_layout !='' ");
@ -1344,6 +1346,17 @@ class themeHandler
$med = e107::getMedia();
$med->import('_common_image', e_THEME.$name, "^.*?logo.*?(\.png|\.jpeg|\.jpg|\.JPG|\.GIF|\.PNG)$");
$med->import('_common_image', e_THEME.$name, '', 'min-size=20000');
$XMLImportfile = e_THEME.$name."/install/install.xml";
if(vartrue($_POST['install-demo-content']) && is_readable($XMLImportfile))
{
e107::getXml()->e107Import($XMLImportfile, 'replace', true, false); // Overwrite specific core pref and tables entries.
$mes->addDebug('Theme Prefs/Tables (install.xml) imported.');
}
$this->theme_adminlog('01', $name.', style.css');
return TRUE;

View File

@ -69,8 +69,8 @@ class fb_category_ui extends e_admin_ui
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center first'),
'fb_category_id' => array('title'=> LAN_ID, 'type' => 'number', 'data' => 'int', 'width' =>'5%', 'forced'=> TRUE),
'fb_category_icon' => array('title'=> LAN_ICON, 'type' => 'icon', 'data' => 'str', 'width' => '5%', 'thclass' => 'center', 'class'=>'center'),
'fb_category_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'data' => 'str', 'inline'=>true, 'width' => 'auto', 'validate' => 'str', 'rule' => '1-200', 'error' => 'String between 1-200 characters expected', 'help' => 'up to 200 characters', 'thclass' => 'left'),
'fb_category_template' => array('title'=> 'Category template', 'type' => 'layouts', 'data' => 'str', 'width' => 'auto', 'thclass' => 'left', 'writeParms' => 'plugin=featurebox&id=featurebox_category&merge=1', 'filter' => true),
'fb_category_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'data' => 'str', 'inline'=>true, 'width' => 'auto', 'help' => 'up to 200 characters', 'thclass' => 'left'),
'fb_category_template' => array('title'=> 'Category template', 'type' => 'layouts', 'inline'=>true, 'data' => 'str', 'width' => 'auto', 'thclass' => 'left', 'writeParms' => 'plugin=featurebox&id=featurebox_category&merge=1', 'filter' => true),
'fb_category_random' => array('title'=> 'Random', 'type' => 'boolean', 'data' => 'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center', 'batch' => true, 'filter' => true),
'fb_category_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'data' => 'int', 'inline'=>true, 'width' => 'auto', 'filter' => true, 'batch' => true),
'fb_category_limit' => array('title'=> 'Limit', 'type' => 'number', 'data' => 'int', 'width' => '5%', 'thclass' => 'left', 'help' => 'number of items to be shown, 0 - show all'),

View File

@ -149,6 +149,19 @@ class plugin_featurebox_item extends e_model
}
/**
* Returns 'active' for the first-slide. - often used by Bootstrap.
*/
public function sc_featurebox_active()
{
$count = $this->getParam('counter', 1);
return ($count == 1) ? "active" : "";
}
/**
* Item counter number (starting from 1)
*/

View File

@ -1,16 +1,54 @@
<?php
/*
* Copyright (c) e107 Inc 2009 - e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id$
* Copyright (c) e107 Inc 2013 - e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
*
* Featurebox core category templates
*/
// TODO - list of all available shortcodes & schortcode parameters
// avoid PHP warnings
$FEATUREBOX_CATEGORY_TEMPLATE = array();
// v2.x Default - Bootstrap.
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['list_start'] = '
<!-- starts carousel -->
<div class="row animated fadeInDown">
<div class="span12">
<div id="myCarousel" class="carousel slide">
<!-- carousel items -->
<div class="carousel-inner">
';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['list_end'] = '
</div>
<!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
</div><!-- end myCarousel -->
</div><!-- end span12 -->
</div><!-- end row -->
<!-- end carousel -->
';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['col_start'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['col_end'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['item_start'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['item_end'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['item_separator'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['bootstrap_carousel']['item_empty'] = '';
// GENERIC template avoid PHP warnings
/*
* Default Template
* Example call: {FEATUREBOX} or {FEATUREBOX|default}
@ -34,9 +72,10 @@ $FEATUREBOX_CATEGORY_TEMPLATE['default']['item_start'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_end'] = '';
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_separator'] = '<div class="clear"><!-- --></div>';
// empty item - used with col templates, no shortcodes just basic markup
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_empty'] = '';
// no dynamic load support
//$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_start'] = '';
//$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_item'] = '';
@ -48,6 +87,9 @@ $FEATUREBOX_CATEGORY_TEMPLATE['default']['item_empty'] = '';
// inline JS, without <script> tags
//$FEATUREBOX_CATEGORY_TEMPLATE['default']['js_inline'] = '';
/*
* Dynamic Template
* Example call: {FEATUREBOX|dynamic}
@ -247,11 +289,12 @@ $FEATUREBOX_CATEGORY_TEMPLATE['camera']['js_type'] = 'jquery';
* @var array
*/
$FEATUREBOX_CATEGORY_INFO = array(
'tabs' => array('title' => 'Tabs (jquery)' , 'description' => 'Tabbed Feature box items utlizing jQuery UI'),
'camera' => array('title' => 'Image-Slider (jquery)' , 'description' => 'Image transitions using the "Camera" jquery plugin'),
'accordion' => array('title' => 'Accordion (jquery)' , 'description' => 'Accordion utilizing jQuery UI'),
'default' => array('title' => 'Default (prototype.js)', 'description' => 'Flat - show by category limit'),
'dynamic' => array('title' => 'Dynamic (prototype.js)', 'description' => 'Load items on click (AJAX)'),
'tabs-proto' => array('title' => 'Tabs (prototype.js)' , 'description' => 'Tabbed Feature box items')
'bootstrap_carousel' => array('title' => 'Bootstrap Carousel', 'description' => "Bootstrap's Hero slider"),
'tabs' => array('title' => 'Tabs (jquery UI)' , 'description' => 'Tabbed Feature box items utlizing jQuery UI'),
'camera' => array('title' => 'Image-Slider (jquery)' , 'description' => 'Image transitions using the "Camera" jquery plugin'),
'accordion' => array('title' => 'Accordion (jquery)' , 'description' => 'Accordion utilizing jQuery UI'),
'default' => array('title' => 'Default (prototype.js)', 'description' => 'Flat - show by category limit'),
'dynamic' => array('title' => 'Dynamic (prototype.js)', 'description' => 'Load items on click (AJAX)'),
'tabs-proto' => array('title' => 'Tabs (prototype.js)' , 'description' => 'Tabbed Feature box items')
);
?>

View File

@ -8,6 +8,67 @@
global $sc_style;
// e107 v2.x Defaults.
$FEATUREBOX_TEMPLATE['bootstrap_carousel_left'] = '
<!-- slide -->
<div class="{FEATUREBOX_ACTIVE} item slide{FEATUREBOX_COUNTER}">
<div class="row">
<div class="span6">
{FEATUREBOX_IMAGE}
</div>
<div class="span4">
<h1>
{FEATUREBOX_TITLE}
</h1>
{FEATUREBOX_TEXT}
</div>
</div>
</div>
<!-- -->
';
$FEATUREBOX_TEMPLATE['bootstrap_carousel_right'] = '
<div class="{FEATUREBOX_ACTIVE} item slide{FEATUREBOX_COUNTER}">
<div class="row">
<div class="span4 animated fadeInUpBig">
<h1>{FEATUREBOX_TITLE}</h1>
{FEATUREBOX_TEXT}
</div>
<div class="span6 animated fadeInDownBig">
{FEATUREBOX_IMAGE}
</div>
</div>
</div>
';
$FEATUREBOX_TEMPLATE['bootstrap_carousel_image'] = '
<div class="item slide3 animated fadeInUpBig">
{FEATUREBOX_IMAGE}
</div>
';
// ----------------------------
$sc_style['FEATUREBOX_IMAGE|image_left']['pre'] = '<img class="f-left" src="';
$sc_style['FEATUREBOX_IMAGE|image_left']['post'] = '" alt="" />';
$FEATUREBOX_TEMPLATE['default'] = '<!-- Feature box Item -->
<div class="featurebox-item" >
<h3>{FEATUREBOX_TITLE|default}</h3>
@ -16,8 +77,7 @@ $FEATUREBOX_TEMPLATE['default'] = '<!-- Feature box Item -->
';
$sc_style['FEATUREBOX_IMAGE|image_left']['pre'] = '<img class="f-left" src="';
$sc_style['FEATUREBOX_IMAGE|image_left']['post'] = '" alt="" />';
$FEATUREBOX_TEMPLATE['image_left'] = '
<div class="featurebox-item">
{FEATUREBOX_IMAGE|image_left=src}<h3>{FEATUREBOX_TITLE|image_left}</h3>{FEATUREBOX_TEXT|image_left}
@ -77,12 +137,19 @@ $FEATUREBOX_TEMPLATE['tabs'] = '
$FEATUREBOX_INFO = array(
'default' => array('title' => 'Default (core)', 'description' => 'Title and description - no image'),
'image_right' => array('title' => 'Right image (core)', 'description' => 'Right floated image'),
'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'),
'tabs' => array('title' => 'Tab Item', 'description' => 'For use with tabs')
'bootstrap_carousel_default' => array('title' => 'Bootstrap', 'description' => 'Title and Description'),
'bootstrap_carousel_image' => array('title' => 'Bootstrap Carousel (Image-Only)', 'description' => 'Image Only'),
'bootstrap_carousel_left' => array('title' => 'Bootstrap Carousel (Image-left)', 'description' => 'Image aligned left with title and text on the right'),
'bootstrap_carousel_right' => array('title' => 'Bootstrap Carousel (Image-right)', 'description' => 'Image aligned right with title and text on the left'),
'default' => array('title' => 'Generic', 'description' => 'Title and description - no image'),
'image_left' => array('title' => 'Generic - (Image-left)' , 'description' => 'Left floated image'),
'image_right' => array('title' => 'Generic - (Image-right)', 'description' => 'Right 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'),
'tabs' => array('title' => 'Tab Item', 'description' => 'For use with tabs')
);
?>

View File

@ -18,6 +18,8 @@ e107::css('inline',"
.area { border-left: 1px solid rgb(221, 221, 221); border-bottom: 1px solid rgb(221, 221, 221);
background-color: rgb(246, 246, 246); margin-top:-1px
}
span.badge { cursor: pointer }
span.label { cursor: pointer }
");
@ -44,6 +46,16 @@ $(document).ready(function()
tinyMCEPopup.close();
});
$('span.label, span.badge').click(function () {
var cls = $(this).attr('class');
var html = '<span class=\"' + cls + '\">' + $(this).text() + '</span>&nbsp;';
tinyMCEPopup.editor.execCommand('mceInsertContent', false, html);
tinyMCEPopup.close();
});
$('#e-cancel').click(function () {
tinyMCEPopup.close();
@ -58,6 +70,10 @@ $(document).ready(function()
class e_bootstrap
{
private $styleClasses = array(''=>'Default', 'primary'=>"Primary", 'success'=>"Success", 'info'=>"Info", 'warning'=>"Warning",'danger'=>"Danger",'inverse'=>"Inverse");
function init()
{
$ns = e107::getRender();
@ -66,14 +82,14 @@ class e_bootstrap
<ul class="nav nav-tabs">
<li class="active" ><a href="#mbuttons" data-toggle="tab">Buttons</a></li>';
// $text .= '<li><a href="#mprofile" data-toggle="tab">Profile</a></li>';
$text .= '<li><a href="#badges" data-toggle="tab">Labels &amp; Badges</a></li>';
$text .= '</ul>';
$text .= '<div class="tab-content">
<div class="tab-pane active left" id="mbuttons">'.$this->buttonForm().'</div>';
// $text = '<div class="tab-pane" id="mprofile">Wow</div>';
$text .= '<div class="tab-pane left" id="badges">'.$this->badgeForm().'</div>';
$text .= '</div>';
@ -90,9 +106,10 @@ class e_bootstrap
{
$frm = e107::getForm();
$buttonTypes = array(''=>'Default', 'primary'=>"Primary", 'success'=>"Success", 'info'=>"Info", 'warning'=>"Warning",'danger'=>"Danger",'inverse'=>"Inverse");
$buttonSizes = array(''=>'Default', 'btn-mini'=>"Mini", 'btn-small'=>"Small", 'btn-large' => "Large");
$buttonTypes = $this->styleClasses;
$butSelect = "";
$butSelect .= "<div class='form-inline' style='padding:5px'>";
foreach($buttonTypes as $type=>$diz)
@ -147,6 +164,36 @@ class e_bootstrap
}
function badgeForm()
{
unset($this->styleClasses['primary']);
foreach($this->styleClasses as $key=>$type)
{
$classLabel = ($key != '') ? " label-".$key : "";
$classBadge = ($key != '') ? " badge-".$key : "";
$text .= '<div style="padding:10px"><span class="label'.$classLabel.'">'.$type.'</span>&nbsp;';
$text .= '<span class="badge'.$classBadge.'">'.$type.'</span>';
$text .= "</div>";
}
return $text;
}
}

View File

@ -321,9 +321,9 @@ unset($uclist, $bcache);
if(!deftrue('e_POWEREDBY_DISABLE'))
{
// No IDs or Classes - hinder js disable.
echo "<div style='margin:20px; text-align:center;position: display:block; relative; bottom: 90px; z-index:30000; opacity:1.0; color: silver'>Proudly powered by <a style='color:silver' href='http://e107.org/' title='e107 Content Management System'>e107</a></div>";
echo "<div style='margin:20px; text-align:center;position: display:block; position: relative; bottom: 90px; z-index:30000; opacity:1.0; color: silver'>Proudly powered by <a style='color:silver' href='http://e107.org/' title='e107 Content Management System'>e107</a></div>";
}
echo "</body></html>";
echo "\n</body>\n</html>";
//
// I Send the buffered page data, along with appropriate headers