diff --git a/var/Typecho/Widget.php b/var/Typecho/Widget.php index 0ea8a0cb..b154049d 100644 --- a/var/Typecho/Widget.php +++ b/var/Typecho/Widget.php @@ -10,7 +10,11 @@ use Typecho\Widget\Terminal; /** * Typecho组件基类 * - * @package Widget + * @property $sequence + * @property $length + * @property-read $request + * @property-read $response + * @property-read $parameter */ abstract class Widget { @@ -33,14 +37,14 @@ abstract class Widget * * @var WidgetRequest */ - public $request; + protected $request; /** * response对象 * - * @var Response + * @var WidgetResponse */ - public $response; + protected $response; /** * 数据堆栈 @@ -436,4 +440,28 @@ abstract class Widget { return $this->length; } + + /** + * @return WidgetRequest + */ + public function ___request(): WidgetRequest + { + return $this->request; + } + + /** + * @return WidgetRequest + */ + public function ___response(): WidgetRequest + { + return $this->request; + } + + /** + * @return Config + */ + public function ___parameter(): Config + { + return $this->parameter; + } } diff --git a/var/Widget/Comments/Admin.php b/var/Widget/Comments/Admin.php index 590efbc8..c83d46af 100644 --- a/var/Widget/Comments/Admin.php +++ b/var/Widget/Comments/Admin.php @@ -86,10 +86,10 @@ class Admin extends Comments if (!$this->user->pass('editor', true)) { $select->where('table.comments.ownerId = ?', $this->user->uid); } elseif (!isset($this->request->cid)) { - if ('on' == $this->request->_typecho_all_comments) { + if ('on' == $this->request->__typecho_all_comments) { Cookie::set('__typecho_all_comments', 'on'); } else { - if ('off' == $this->request->_typecho_all_comments) { + if ('off' == $this->request->__typecho_all_comments) { Cookie::set('__typecho_all_comments', 'off'); } diff --git a/var/Widget/Contents/Post/Admin.php b/var/Widget/Contents/Post/Admin.php index d463eb9a..51ab899d 100644 --- a/var/Widget/Contents/Post/Admin.php +++ b/var/Widget/Contents/Post/Admin.php @@ -100,10 +100,10 @@ class Admin extends Contents if (!$this->user->pass('editor', true)) { $select->where('table.contents.authorId = ?', $this->user->uid); } else { - if ('on' == $this->request->_typecho_all_posts) { + if ('on' == $this->request->__typecho_all_posts) { Cookie::set('__typecho_all_posts', 'on'); } else { - if ('off' == $this->request->_typecho_all_posts) { + if ('off' == $this->request->__typecho_all_posts) { Cookie::set('__typecho_all_posts', 'off'); }