Files
aowow/includes/ajaxHandler/getdescription.class.php
Sarjuuk bffdb9672e Future/Frontend
* create php classes, each mirroring a js object
 * each frontend class implements __toString and json_serialize and as such can be directly used by the template
 * also allows for sane object creation before js screams in agony

 * usage TBD
2025-07-27 16:42:12 +02:00

38 lines
798 B
PHP

<?php
namespace Aowow;
if (!defined('AOWOW_REVISION'))
die('illegal access');
class AjaxGetdescription extends AjaxHandler
{
protected $_post = array(
'description' => [FILTER_CALLBACK, ['options' => 'Aowow\AjaxHandler::checkTextBlob']]
);
public function __construct(array $params)
{
parent::__construct($params);
if (!$params || $params[0]) // should be empty
return;
$this->handler = 'handleDescription';
}
protected function handleDescription() : string
{
$this->contentType = MIME_TYPE_TEXT;
if (!User::canWriteGuide())
return '';
$desc = Markup::stripTags($this->_post['description']);
return Lang::trimTextClean($desc, 120);
}
}
?>