diff --git a/Xbb/Tags/A.php b/Xbb/Tags/A.php
index 7cf1958..9c71441 100644
--- a/Xbb/Tags/A.php
+++ b/Xbb/Tags/A.php
@@ -22,13 +22,18 @@
******************************************************************************/
// Класс для тегов [a], [anchor] и [url]
-class Xbb_Tags_A extends bbcode {
+class Xbb_Tags_A extends bbcode
+{
public $behaviour = 'a';
- function get_html($tree = null) {
+
+ public function get_html($tree = null)
+ {
$this -> autolinks = false;
$text = '';
foreach ($this -> tree as $val) {
- if ('text' == $val['type']) { $text .= $val['str']; }
+ if ('text' === $val['type']) {
+ $text .= $val['str'];
+ }
}
$href = '';
if (isset($this -> attrib['url'])) {
@@ -40,15 +45,17 @@ function get_html($tree = null) {
if (! $href && isset($this -> attrib['href'])) {
$href = $this -> attrib['href'];
}
- if (! $href && ! isset($this -> attrib['anchor'])) { $href = $text; }
- $href = $this -> checkUrl($href);
+ if (! $href && ! isset($this -> attrib['anchor'])) {
+ $href = $text;
+ }
+ $href = $this -> _checkUrl($href);
$attr = 'class="bb"';
if ($href) {
- $attr .= ' href="'.$href.'"';
+ $attr .= ' href="' . $href . '"';
}
if (isset($this -> attrib['title'])) {
$title = $this -> attrib['title'];
- $attr .= ' title="'.htmlspecialchars($title).'"';
+ $attr .= ' title="' . htmlspecialchars($title) . '"';
}
$id = '';
if (isset($this -> attrib['id'])) {
@@ -62,14 +69,16 @@ function get_html($tree = null) {
if (! $id) { $id = $text; }
}
if ($id) {
- if ($id{0} < 'A' || $id{0} > 'z') { $id = 'bb'.$id; }
- $attr .= ' id="'.htmlspecialchars($id).'"';
+ if ($id{0} < 'A' || $id{0} > 'z') {
+ $id = 'bb' . $id;
+ }
+ $attr .= ' id="' . htmlspecialchars($id) . '"';
}
if (isset($this -> attrib['target'])) {
$target = $this -> attrib['target'];
- $attr .= ' target="'.htmlspecialchars($target).'"';
+ $attr .= ' target="' . htmlspecialchars($target) . '"';
}
- return ''.parent::get_html($this -> tree).'';
+
+ return '' . parent::get_html($this -> tree) . '';
}
}
-?>
diff --git a/Xbb/Tags/Abbr.php b/Xbb/Tags/Abbr.php
index ac64495..dd104d8 100644
--- a/Xbb/Tags/Abbr.php
+++ b/Xbb/Tags/Abbr.php
@@ -22,14 +22,16 @@
******************************************************************************/
// Класс для тега [abbr]
-class Xbb_Tags_Abbr extends bbcode {
+class Xbb_Tags_Abbr extends bbcode
+{
public $behaviour = 'span';
- function get_html($tree = null) {
+
+ public function get_html($tree = null)
+ {
$attrib = 'class="bb"';
if ($this -> attrib['abbr']) {
- $attrib .= ' title="'.htmlspecialchars($this -> attrib['abbr']).'"';
+ $attrib .= ' title="' . htmlspecialchars($this -> attrib['abbr']) . '"';
}
- return ''.parent::get_html($this -> tree).'';
+ return '' . parent::get_html($this -> tree) . '';
}
}
-?>
diff --git a/Xbb/Tags/Acronym.php b/Xbb/Tags/Acronym.php
index 7e38ef9..1d56a06 100644
--- a/Xbb/Tags/Acronym.php
+++ b/Xbb/Tags/Acronym.php
@@ -22,16 +22,19 @@
******************************************************************************/
// Класс для тега [acronym]
-class Xbb_Tags_Acronym extends bbcode {
+class Xbb_Tags_Acronym extends bbcode
+{
public $behaviour = 'span';
- function get_html($tree = null) {
+
+ public function get_html($tree = null)
+ {
$attrib = 'class="bb"';
if ($this -> attrib['acronym']) {
- $attrib .= ' title="'.htmlspecialchars($this -> attrib['acronym'])
- .'"';
+ $attrib .= ' title="' . htmlspecialchars($this -> attrib['acronym'])
+ . '"';
}
- return ''.parent::get_html($this -> tree)
- .'';
+
+ return '' . parent::get_html($this -> tree)
+ . '';
}
}
-?>
diff --git a/Xbb/Tags/Address.php b/Xbb/Tags/Address.php
index f790e44..7484b7c 100644
--- a/Xbb/Tags/Address.php
+++ b/Xbb/Tags/Address.php
@@ -22,11 +22,13 @@
******************************************************************************/
// Класс для тега [address]
-class Xbb_Tags_Address extends bbcode {
+class Xbb_Tags_Address extends bbcode
+{
public $rbr = 1;
- function get_html($tree = null) {
- return '
'.parent::get_html($this -> tree)
- .'';
+
+ public function get_html($tree = null)
+ {
+ return '' . parent::get_html($this -> tree)
+ . '';
}
}
-?>
diff --git a/Xbb/Tags/Align.php b/Xbb/Tags/Align.php
index 2acff8e..e9e990d 100644
--- a/Xbb/Tags/Align.php
+++ b/Xbb/Tags/Align.php
@@ -22,9 +22,12 @@
******************************************************************************/
// Класс для тегов [align], [center], [justify], [left] и [right]
-class Xbb_Tags_Align extends bbcode {
+class Xbb_Tags_Align extends bbcode
+{
public $rbr = 1;
- function get_html($tree = null) {
+
+ public function get_html($tree = null)
+ {
$align = '';
if (isset($this -> attrib['justify'])) { $align = 'justify'; }
if (isset($this -> attrib['left'])) { $align = 'left'; }
@@ -46,8 +49,9 @@ function get_html($tree = null) {
break;
}
}
- return ''
- .parent::get_html($this -> tree).'
';
+
+ return ''
+ . parent::get_html($this -> tree) . '
';
}
}
?>
diff --git a/Xbb/Tags/Bbcode.php b/Xbb/Tags/Bbcode.php
index 18647b9..71d25e7 100644
--- a/Xbb/Tags/Bbcode.php
+++ b/Xbb/Tags/Bbcode.php
@@ -22,12 +22,17 @@
******************************************************************************/
// Класс для тега [bbcode]
-class Xbb_Tags_Bbcode extends bbcode {
- public $behaviour = 'code';
- function get_html($tree = null) {
+class Xbb_Tags_Bbcode extends bbcode
+{
+ public $behaviour = 'code';
+
+ public function get_html($tree = null)
+ {
$str = '';
foreach ($this -> tree as $item) {
- if ('item' == $item['type']) { continue; }
+ if ('item' === $item['type']) {
+ continue;
+ }
$str .= $item['str'];
}
$bb = new bbcode();
@@ -35,7 +40,7 @@ function get_html($tree = null) {
$bb -> mnemonics = $this -> mnemonics;
$bb -> autolinks = $this -> autolinks;
$bb -> parse($str);
- return ''.$bb -> highlight().'
';
+
+ return '' . $bb -> highlight() . '
';
}
}
-?>
diff --git a/Xbb/Tags/Bdo.php b/Xbb/Tags/Bdo.php
index 34dcb28..a059daa 100644
--- a/Xbb/Tags/Bdo.php
+++ b/Xbb/Tags/Bdo.php
@@ -22,9 +22,12 @@
******************************************************************************/
// Класс для тега [bdo]
-class Xbb_Tags_Bdo extends bbcode {
+class Xbb_Tags_Bdo extends bbcode
+{
public $behaviour = 'span';
- function get_html($tree = null) {
+
+ public function get_html($tree = null)
+ {
$dir = '';
switch (strtolower($this->attrib['bdo'])) {
case 'ltr':
@@ -42,7 +45,7 @@ function get_html($tree = null) {
if (isset($this->attrib['lang'])) {
$attr .= ' lang="' . htmlspecialchars($this->attrib['lang']) . '"';
}
+
return '' . parent::get_html() . '';
}
}
-?>
\ No newline at end of file
diff --git a/Xbb/Tags/Br.php b/Xbb/Tags/Br.php
index ef8104d..120c733 100644
--- a/Xbb/Tags/Br.php
+++ b/Xbb/Tags/Br.php
@@ -22,11 +22,13 @@
******************************************************************************/
// Класс для тега [br]
-class Xbb_Tags_Br extends bbcode {
+class Xbb_Tags_Br extends bbcode
+{
public $is_close = true;
public $behaviour = 'span';
- function get_html($tree = null) {
+
+ public function get_html($tree = null)
+ {
return '
' . "\n";
}
}
-?>
\ No newline at end of file
diff --git a/Xbb/Tags/Caption.php b/Xbb/Tags/Caption.php
index eda59cf..89a3e95 100644
--- a/Xbb/Tags/Caption.php
+++ b/Xbb/Tags/Caption.php
@@ -22,11 +22,13 @@
******************************************************************************/
// Класс для тега [caption]
-class Xbb_Tags_Caption extends bbcode {
+class Xbb_Tags_Caption extends bbcode
+{
public $behaviour = 'caption';
- function get_html($tree = null) {
- return ''.parent::get_html($this -> tree)
- .'';
+
+ public function get_html($tree = null)
+ {
+ return '' . parent::get_html($this -> tree)
+ . '';
}
}
-?>
diff --git a/Xbb/Tags/Code.php b/Xbb/Tags/Code.php
index 1f9d86c..2309077 100644
--- a/Xbb/Tags/Code.php
+++ b/Xbb/Tags/Code.php
@@ -22,7 +22,8 @@
******************************************************************************/
/* Класс для тегов подсветки синтаксиса и для тегов [code] и [pre] */
-class Xbb_Tags_Code extends bbcode {
+class Xbb_Tags_Code extends bbcode
+{
/* Число разрывов строк, которые должны быть игнорированы перед тегом */
public $lbr = 0;
/* Число разрывов строк, которые должны быть игнорированы после тега */
@@ -44,18 +45,22 @@ class Xbb_Tags_Code extends bbcode {
);
/* Объект GeSHi */
private $_geshi;
+
/* Конструктор класса */
- function Xbb_Tags_Code() {
+ public function __construct()
+ {
$geshi_path = realpath(
dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR
. '..' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'geshi.php'
);
@include_once $geshi_path;
- @$this->_geshi = new GeSHi('', 'text');
+ $this->_geshi = new GeSHi('', 'text');
$this->_geshi->set_header_type(GESHI_HEADER_NONE);
}
+
/* Описываем конвертацию в HTML */
- function get_html($tree = null) {
+ public function get_html($tree = null)
+ {
// Находим язык подсветки
switch ($this->tag) {
case 'code':
@@ -66,16 +71,19 @@ function get_html($tree = null) {
break;
default:
$language = $this->tag;
+ break;
}
if (! $language) { $language = 'text'; }
if (isset($this->lang_synonym[$language])) {
$language = $this->lang_synonym[$language];
}
- @$this->_geshi->set_language($language);
+ $this->_geshi->set_language($language);
// Находим подсвечиваемый код
$source = '';
foreach ($this->tree as $item) {
- if ('item' == $item['type']) { continue; }
+ if ('item' === $item['type']) {
+ continue;
+ }
$source .= $item['str'];
}
$this->_geshi->set_source($source);
@@ -109,7 +117,7 @@ function get_html($tree = null) {
$result = htmlspecialchars($this->attrib['title'], ENT_NOQUOTES);
}
// Получаем подсвеченный код
- $result = '