-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#652 Support BB Code at feed news display
- Loading branch information
1 parent
0e91e50
commit 78d0bb8
Showing
48 changed files
with
4,850 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
/** | ||
* @copyright 2006-2014, Miles Johnson - http://milesj.me | ||
* @license https://github.com/milesj/decoda/blob/master/license.md | ||
* @link http://milesj.me/code/php/decoda | ||
*/ | ||
|
||
namespace Decoda; | ||
|
||
/** | ||
* Defines the methods for all Components to implement. | ||
*/ | ||
interface Component { | ||
|
||
/** | ||
* Add a loader. | ||
* | ||
* @param \Decoda\Loader $loader | ||
* @return \Decoda\Component | ||
*/ | ||
public function addLoader(Loader $loader); | ||
|
||
/** | ||
* Method called immediately after the constructor. | ||
* | ||
* @return void | ||
*/ | ||
public function construct(); | ||
|
||
/** | ||
* Return a specific configuration key value. | ||
* | ||
* @param string $key | ||
* @return mixed | ||
*/ | ||
public function getConfig($key); | ||
|
||
/** | ||
* Return all the Loaders. | ||
* | ||
* @return \Decoda\Loader[] | ||
*/ | ||
public function getLoaders(); | ||
|
||
/** | ||
* Return the Decoda parser. | ||
* | ||
* @return \Decoda\Decoda | ||
*/ | ||
public function getParser(); | ||
|
||
/** | ||
* Return a message string from the parser. | ||
* | ||
* @param string $key | ||
* @param array $vars | ||
* @return string | ||
*/ | ||
public function message($key, array $vars = array()); | ||
|
||
/** | ||
* Modify configuration. | ||
* | ||
* @param array $config | ||
* @return \Decoda\Component | ||
*/ | ||
public function setConfig(array $config); | ||
|
||
/** | ||
* Set the Decoda parser. | ||
* | ||
* @param \Decoda\Decoda $parser | ||
* @return \Decoda\Component | ||
*/ | ||
public function setParser(Decoda $parser); | ||
|
||
} |
112 changes: 112 additions & 0 deletions
112
web/third_party/Decoda/Decoda/Component/AbstractComponent.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<?php | ||
/** | ||
* @copyright 2006-2014, Miles Johnson - http://milesj.me | ||
* @license https://github.com/milesj/decoda/blob/master/license.md | ||
* @link http://milesj.me/code/php/decoda | ||
*/ | ||
|
||
namespace Decoda\Component; | ||
|
||
use Decoda\Decoda; | ||
use Decoda\Component; | ||
use Decoda\Loader; | ||
|
||
/** | ||
* Provides default shared functionality for Filters, Hooks and Engines. | ||
*/ | ||
abstract class AbstractComponent implements Component { | ||
|
||
/** | ||
* Configuration. | ||
* | ||
* @type array | ||
*/ | ||
protected $_config = array(); | ||
|
||
/** | ||
* List of Loaders. | ||
* | ||
* @type \Decoda\Loader[] | ||
*/ | ||
protected $_loaders = array(); | ||
|
||
/** | ||
* Decoda object. | ||
* | ||
* @type \Decoda\Decoda | ||
*/ | ||
protected $_parser; | ||
|
||
/** | ||
* Apply configuration. | ||
* | ||
* @param array $config | ||
*/ | ||
public function __construct(array $config = array()) { | ||
$this->setConfig($config); | ||
$this->construct(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function addLoader(Loader $loader) { | ||
$this->_loaders[] = $loader; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function construct() { | ||
return; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getConfig($key) { | ||
return isset($this->_config[$key]) ? $this->_config[$key] : null; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getLoaders() { | ||
return $this->_loaders; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getParser() { | ||
return $this->_parser; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function message($key, array $vars = array()) { | ||
return $this->getParser()->message($key, $vars); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function setConfig(array $config) { | ||
$this->_config = $config + $this->_config; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function setParser(Decoda $parser) { | ||
$this->_parser = $parser; | ||
|
||
return $this; | ||
} | ||
|
||
} |
Oops, something went wrong.