//protected $parameters = [];
/**
+ * Reads a string value and validates it.
+ *
+ * @param string $variableName
+ * @param boolean $allowEmpty
+ * @param string $arrayIndex
* @see AbstractDatabaseObjectAction::readString()
*/
abstract protected function readString($variableName, $allowEmpty = false, $arrayIndex = '');
/**
* Returns relative amount of votes for this option.
*
- * @param Poll
+ * @param Poll $poll
* @return integer
*/
public function getRelativeVotes(Poll $poll) {
return WCF::getPath().$this->smileyPath;
}
+ /**
+ * Returns the url to the 2x version of the smiley.
+ *
+ * @return string
+ */
public function getURL2x() {
return ($this->smileyPath2x) ? WCF::getPath().$this->smileyPath2x : '';
}
return explode("\n", StringUtil::unifyNewlines($this->aliases));
}
+ /**
+ * Returns the height of the smiley.
+ *
+ * @return integer
+ */
public function getHeight() {
if ($this->height === null) {
$this->height = 0;
return $this->height;
}
+ /**
+ * Returns the html code to render the smiley.
+ *
+ * @return string
+ */
public function getHtml() {
$srcset = ($this->smileyPath2x) ? ' srcset="' . StringUtil::encodeHTML($this->getURL2x()) . ' 2x"' : '';
$height = ($this->getHeight()) ? ' height="' . $this->getHeight() . '"' : '';
/**
* Connects to the redis server given by the DSN.
+ *
+ * @param string $dsn
*/
public function __construct($dsn) {
if (!class_exists('Redis')) {
/**
* Passes all method calls down to the underlying Redis connection.
+ *
+ * @param string $name
+ * @param array $arguments
+ * @return mixed
*/
public function __call($name, array $arguments) {
switch ($name) {
}
/**
+ * Sets the email's 'Subject'.
+ *
+ * @param string $subject
* @see Email::setSubject()
*/
public function setSubject($subject) {
return $this->getHtmlInputNodeProcessor()->validate();
}
+ /**
+ * Enforces the maximum depth of nested quotes.
+ *
+ * @param integer $depth
+ */
public function enforceQuoteDepth($depth) {
$this->getHtmlInputNodeProcessor()->enforceQuoteDepth($depth);
}
}
}
+ /**
+ * Replaces image element with attachment metacode element.
+ *
+ * @param \DOMElement $element
+ * @param string $class
+ */
protected function handleAttachment(\DOMElement $element, $class) {
$attachmentID = intval($element->getAttribute('data-attachment-id'));
if (!$attachmentID) {
DOMUtil::replaceElement($element, $newElement, false);
}
+ /**
+ * Replaces image element with media metacode element.
+ *
+ * @param \DOMElement $element
+ * @param string $class
+ */
protected function handleMedium(\DOMElement $element, $class) {
$mediumID = intval($element->getAttribute('data-media-id'));
if (!$mediumID) {
DOMUtil::replaceElement($element, $newElement, false);
}
+ /**
+ * Replaces image element with smiley metacode element.
+ *
+ * @param \DOMElement $element
+ */
protected function handleSmiley(\DOMElement $element) {
$code = $element->getAttribute('alt');
EventHandler::getInstance()->fireAction($this, 'afterProcess');
}
+ /**
+ * Enforces the maximum depth of nested quotes.
+ *
+ * @param integer $depth
+ */
public function enforceQuoteDepth($depth) {
$quotes = [];
/** @var \DOMElement $quote */
return $groups;
}
+ /**
+ * Returns `true` if the given element is inside a code element.
+ *
+ * @param \DOMElement $element
+ * @return boolean
+ */
protected function isInsideCode(\DOMElement $element) {
$parent = $element;
while ($parent = $parent->parentNode) {
abstract protected function getDecoratedCategoryClass();
/**
+ * Returns the link for a page with an object id.
+ *
+ * @param integer $objectID page object id
+ * @return string page url
* @see ILookupPageHandler::getLink()
*/
public function getLink($objectID) {
}
/**
+ * Returns true if provided object id exists and is valid.
+ *
+ * @param integer $objectID page object id
+ * @return boolean true if object id is valid
* @see ILookupPageHandler::isValid()
*/
public function isValid($objectID = null) {
}
/**
+ * Performs a search for pages using a query string, returning an array containing
+ * an `objectID => title` relation.
+ *
+ * @param string $searchString search string
+ * @return string[]
* @see ILookupPageHandler::lookup()
*/
public function lookup($searchString) {
abstract protected function getDecoratedCategoryClass();
/**
+ * Returns false if this page should be hidden from menus, but does not control the accessibility
+ * of the page itself. The visibility can optionally be scoped to the given object id.
+ *
+ * @param integer|null $objectID optional page object id
+ * @return boolean false if the page should be hidden from menus
* @see IMenuPageHandler::isVisible()
*/
public function isVisible($objectID = null) {
abstract protected function getDecoratedCategoryClass();
/**
+ * Returns the textual description if a user is currently online viewing this page.
+ *
+ * @param Page $page visited page
+ * @param UserOnline $user user online object with request data
+ * @return string
* @see IOnlineLocationPageHandler::getOnlineLocation()
*/
public function getOnlineLocation(Page $page, UserOnline $user) {
*/
trait TUserLookupPageHandler {
/**
+ * Returns true if provided object id exists and is valid.
+ *
+ * @param integer $objectID page object id
+ * @return boolean true if object id is valid
* @see ILookupPageHandler::isValid()
*/
public function isValid($objectID) {
}
/**
+ * Performs a search for pages using a query string, returning an array containing
+ * an `objectID => title` relation.
+ *
+ * @param string $searchString search string
+ * @return string[]
* @see ILookupPageHandler::lookup()
*/
public function lookup($searchString) {
use TOnlineLocationPageHandler;
/**
+ * Returns the textual description if a user is currently online viewing this page.
+ *
+ * @param Page $page visited page
+ * @param UserOnline $user user online object with request data
+ * @return string
* @see IOnlineLocationPageHandler::getOnlineLocation()
*/
public function getOnlineLocation(Page $page, UserOnline $user) {
}
/**
+ * Prepares fetching all necessary data for the textual description if a user is currently online
+ * viewing this page.
+ *
+ * @param Page $page visited page
+ * @param UserOnline $user user online object with request data
* @see IOnlineLocationPageHandler::prepareOnlineLocation()
*/
public function prepareOnlineLocation(/** @noinspection PhpUnusedParameterInspection */Page $page, UserOnline $user) {