Skip to content

Commit

Permalink
Fixed all unchecked usages of possibly undefined constant BOOTSTRAP
Browse files Browse the repository at this point in the history
  • Loading branch information
Deltik committed Nov 28, 2020
1 parent 88254d2 commit 668ab7f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion e107_core/shortcodes/batch/bbcode_shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function bb_format($id)
);


if(BOOTSTRAP)
if(defined('BOOTSTRAP') && BOOTSTRAP)
{
$text = '<div class="btn-group">';
$text .= '<a class="btn btn-default btn-secondary dropdown-toggle" data-toggle="dropdown" href="#" title="">';
Expand Down
2 changes: 1 addition & 1 deletion e107_handlers/comment_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ function compose_comment($table, $action, $id, $width, $subject, $rate = FALSE,
}
else
{
if(BOOTSTRAP)
if(defined('BOOTSTRAP') && BOOTSTRAP)
{
$comment = e107::getMessage()->addInfo(COMLAN_328)->render();
}
Expand Down
2 changes: 1 addition & 1 deletion e107_handlers/form_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2103,7 +2103,7 @@ public function pagination($url='', $total=0, $from=0, $perPage=10, $options=arr
return '';
}

if(BOOTSTRAP === 4)
if(defined('BOOTSTRAP') && BOOTSTRAP === 4)
{
return '<a class="pager-button btn btn-primary" href="'.$url.'">'.$total.'</a>';
}
Expand Down
4 changes: 2 additions & 2 deletions e107_plugins/forum/shortcodes/batch/view_shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ function sc_postoptions()
<button class="btn btn-default btn-secondary btn-sm btn-small dropdown-toggle" data-toggle="dropdown">
' . LAN_FORUM_8013 . '
';
if(BOOTSTRAP !== 4)
if(defined('BOOTSTRAP') && BOOTSTRAP !== 4)
{
$text .= '<span class="caret"></span>';
}
Expand Down Expand Up @@ -1144,7 +1144,7 @@ function sc_buttonsx()
' . $replyUrl . '
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
';
if(BOOTSTRAP !== 4)
if(defined('BOOTSTRAP') && BOOTSTRAP !== 4)
{
$text .= '<span class="caret"></span>';
}
Expand Down
5 changes: 3 additions & 2 deletions e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ function sc_newthreadbutton()

function sc_newthreadbuttonx()
{
$bootstrap = defined('BOOTSTRAP') ? BOOTSTRAP : false;

if(!BOOTSTRAP)
if(!$bootstrap)
{
return $this->sc_newthreadbutton();
}
Expand Down Expand Up @@ -103,7 +104,7 @@ function sc_newthreadbuttonx()
'.($this->var['ntUrl'] ?"":"<span>&nbsp;</span>").'
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
';
if(BOOTSTRAP !== 4)
if($bootstrap !== 4)
{
$text .= '<span class="caret"></span>';
}
Expand Down
2 changes: 1 addition & 1 deletion e107_plugins/news/news.php
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ private function renderComments($news)
// Only show message if global comments are enabled, but current news item comments are disabled
if(e107::getPref('comments_disabled') == 0 && $news['news_allow_comments'] == 1)
{
if(BOOTSTRAP)
if(defined('BOOTSTRAP') && BOOTSTRAP)
{
return e107::getMessage()->addInfo(LAN_NEWS_13)->render();
}
Expand Down
2 changes: 1 addition & 1 deletion search.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function sc_search_main($parm = '')
<button class='btn btn-primary dropdown-toggle' tabindex='-1' data-toggle='dropdown' type='button'>
";

if(BOOTSTRAP !== 4)
if(defined('BOOTSTRAP') && BOOTSTRAP !== 4)
{
$text .= "<span class='caret'></span></button>";
}
Expand Down

0 comments on commit 668ab7f

Please sign in to comment.