1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 22:57:14 +02:00

Issue #435 - start of Bootstrap 3 core support. Enable by adding the following to your theme.php file:

define("BOOTSTRAP", 3);
define("FONTAWESOME", 4); // optional

e107::js("url", "//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js");
e107::css('url', '//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css');
e107::css('url', "//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"); // optional
This commit is contained in:
Cameron
2013-12-17 11:12:42 -08:00
parent ba18155c34
commit 7874cd1060
10 changed files with 47 additions and 16 deletions

View File

@@ -313,7 +313,7 @@ $text .= "<div class='field-spacer'>".$tp->parseTemplate("{IMAGESELECTOR={$parms
$sLogo = siteinfo_shortcodes::sc_logo();
*/
$text .= $frm->imagepicker('sitebutton',$pref['sitebutton'],'_common','help=Used by Facebook and others. Should be a square image.');
$text .= $frm->imagepicker('sitebutton',$pref['sitebutton'],'_common','help=Used by Facebook and others. Should be a square image of at least 144px in width and height.');
$text .= "
</td>

View File

@@ -375,12 +375,12 @@ class news_shortcodes extends e_shortcode
break;
case 'tag':
return "<img class='news_image' src='".$src."' alt='' style='".$this->param['thumbnail']."' />";
return "<img class='news_image news-image' src='".$src."' alt='' style='".$this->param['thumbnail']."' />";
break;
case 'url':
default:
return "<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'><img class='news_image img-rounded' src='".$src."' alt='' style='".$this->param['thumbnail']."' /></a>";
return "<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'><img class='news_image news-image img-rounded' src='".$src."' alt='' style='".$this->param['thumbnail']."' /></a>";
break;
}
}

View File

@@ -217,6 +217,15 @@ if (is_array($pref['e_meta_list']))
unset($ret);
}
// -------- Generate Apple Touch Icon ---------
if(isset($pref['sitebutton']))
{
$appleIcon = $tp->thumbUrl($pref['sitebutton'],'w=144&h=144&crop=1',true);
echo "<link rel='apple-touch-icon' href='".$appleIcon."' />\n";
unset($appleIcon);
}
// Register Plugin specific CSS

View File

@@ -42,7 +42,7 @@ $NEXTPREV_TEMPLATE['default_separator'] = '&nbsp;';
/* ****************** Default when Bootstrap is enabled ************** */
$NEXTPREV_TEMPLATE['bootstrap_start'] = "<!-- Start of Next/Prev -->\n<div class='pagination'>\n<ul>";
$NEXTPREV_TEMPLATE['bootstrap_start'] = "<!-- Start of Next/Prev -->\n<div class='pagination'>\n<ul class='pagination'>";
$NEXTPREV_TEMPLATE['bootstrap_end'] = "</ul></div><!-- End of Next/Prev -->";
$NEXTPREV_TEMPLATE['bootstrap_nav_caption'] = '';

View File

@@ -2662,7 +2662,7 @@ class e_parser
* Parse xxxxx.glyph file to bootstrap glyph format.
* @return FALSE if not a glyph file or if bootstrap is not found.
*/
public function toGlyph($text)
public function toGlyph($text, $space=" ")
{
if(!deftrue('BOOTSTRAP'))
{
@@ -2672,7 +2672,16 @@ class e_parser
if(substr($text,-6) == '.glyph') // Bootstrap or Font-Awesome.
{
list($cls,$tmp) = explode('.glyph',$text);
return "<i class='".$cls."'></i> "; // retain space.
if(deftrue('FONTAWESOME') == 4) // Convert FontAwesome 3 to 4.
{
$cls = str_replace('icon-', 'fa fa-', $cls);
}
$text = (deftrue('BOOTSTRAP') == 3) ? "<span class='".$cls."'></span>" : "<i class='".$cls."'></i>"; // retain space.
$text .= ($space !== false) ? $space : "";
return $text;
}
return false;

View File

@@ -1599,7 +1599,10 @@ class e_form
$opt = array();
$opt[] = "<a href='".e_HTTP."'><i class='icon-home'></i></a>"; // Add Site-Pref to disable?
$homeIcon = e107::getParser()->toGlyph('icon-home.glyph',false);
$opt[] = "<a href='".e_HTTP."'>".$homeIcon."</a>"; // Add Site-Pref to disable?
$text = '<ul class="breadcrumb">
<li>';
@@ -1617,9 +1620,13 @@ class e_form
}
}
$text .= implode("<span class='divider'>/</span></li><li>",$opt);
$sep = (deftrue('BOOTSTRAP') == 3) ? "" : "<span class='divider'>/</span>";
$text .= implode($sep."</li><li>",$opt);
$text .= "</li></ul>";
// return print_a($opt,true);
return $text;

View File

@@ -9,7 +9,7 @@
define("PRFLAN_1", "Site Information");
define("PRFLAN_2", "Site Name");
define("PRFLAN_3", "Site URL");
define("PRFLAN_4", "Site Link Button");
define("PRFLAN_4", "Site Link Icon/Button");
define("PRFLAN_5", "Site Tagline");
define("PRFLAN_6", "Site Description");
define("PRFLAN_7", "Main site admin");

View File

@@ -34,7 +34,7 @@ if (!e107::isInstalled('download'))
if(deftrue('BOOTSTRAP'))
{
define("IMAGE_DOWNLOAD", (file_exists(THEME."images/download.png") ? THEME."images/download.png" : e_IMAGE."generic/download.png"));
define("IMAGE_NEW", (file_exists(THEME."images/new.png") ? THEME."images/new.png" : '<i class="icon-star"></i>'));
define("IMAGE_NEW", (file_exists(THEME."images/new.png") ? THEME."images/new.png" : e107::getParser()->toGlyph('icon-star',false)));
}
else
{

View File

@@ -349,6 +349,7 @@ if(!isset($DOWNLOAD_MIRROR_END))
$DOWNLOAD_TEMPLATE['categories']['start'] = "
<div class='table-responsive'>
<table id='download' class='table table-striped fborder'>
<colgroup>
<col style='width:3%'/>
@@ -416,10 +417,11 @@ $DOWNLOAD_TEMPLATE['categories']['subchild'] = "
$DOWNLOAD_TEMPLATE['categories']['end'] = "
</tbody>
</table>
<div class='clearfix'>
<div class='pull-left'><small>{DOWNLOAD_CAT_NEWDOWNLOAD_TEXT}</small></div>
</div>
<div class='clearfix'>
<div class='pull-left'><small>{DOWNLOAD_CAT_NEWDOWNLOAD_TEXT}</small></div>
<div class='pull-right'>{DOWNLOAD_CAT_SEARCH}</div>
</div>";
</div>";
// ##### ------------------------------------------------------------------------------------------
@@ -518,7 +520,8 @@ $DOWNLOAD_TEMPLATE['view']['nextprev'] = '
// ##### ------------------------------------------------------------------------------------------
$DOWNLOAD_TEMPLATE['list']['start'] = "
<form method='post' action='".e_SELF."?".e_QUERY."'>
<form method='post' action='".e_SELF."?".e_QUERY."'>
<div class='table-responsive'>
<table id='download' class='table table-striped'>\n
<colgroup>
<col style='width:35%;'/>
@@ -573,7 +576,8 @@ $DOWNLOAD_TEMPLATE['list']['end'] = "
<td colspan='7' style='text-align:right;'><small class='muted text-muted'>{DOWNLOAD_LIST_TOTAL_AMOUNT} {DOWNLOAD_LIST_TOTAL_FILES}</small></td>
</tr>
</table>
</form>
</div>
</form>
\n";
@@ -595,6 +599,7 @@ $sc_style['DOWNLOAD_LIST_NEXTPREV']['post'] = " </div>";
$DOWNLOAD_TEMPLATE['mirror']['start'] = "
<div class='table-responsive'>
<table id='download' class='table table-striped'>
<colgroup>
<col style='width:1%'/>
@@ -636,6 +641,7 @@ $DOWNLOAD_TEMPLATE['mirror']['item'] = "
$DOWNLOAD_TEMPLATE['mirror']['end'] = "
</table>
</div>
";

View File

@@ -292,7 +292,7 @@ if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag']))
$NEWSLISTTITLE = str_replace("{NEWSCATEGORY}",$tp->toHTML($category_name,FALSE,'TITLE'),$NEWSLISTTITLE);
}
$text .= "<div class='center news-list-footer'><a class='btn' href='".e_REQUEST_SELF."'>".LAN_NEWS_84."</a></div>";
$text .= "<div class='center news-list-footer'><a class='btn btn-default' href='".e_REQUEST_SELF."'>".LAN_NEWS_84."</a></div>";
ob_start();
$ns->tablerender($NEWSLISTTITLE, $text, 'news');