optimize phpDoc

This commit is contained in:
githubjeka 2017-04-10 14:04:04 +03:00
parent a41cab386b
commit 70eda4292d

View File

@ -8,8 +8,6 @@
namespace humhub\widgets;
use yii\base\Widget;
/**
* AjaxButton is an replacement for Yii1 CHtml::AjaxButton
*
@ -17,29 +15,29 @@ use yii\base\Widget;
*/
class Modal extends JsWidget
{
/*
/**
* @inheritdoc
*/
public $jsWidget = 'ui.modal.Modal';
/**
* Header text
* @var type
* @var string
*/
public $header;
/**
* Modal content
* @var type
* @var string
*/
public $body;
/**
* Modal footer
* @var type
* @var string
*/
public $footer;
/**
* This setting will have impact on on the modal dialog size.
* Possible values:
@ -48,61 +46,61 @@ class Modal extends JsWidget
* - small
* - extra-small
* - medium
* @var string
* @var string
*/
public $size;
/**
* Can be used to add an open animation for the dialog.
* e.g: pulse
*
* @var string
*
* @var string
*/
public $animation;
/**
* Can be set to true to force the x close button to be rendered even if
* there is no headtext available, or set to false if the button should not
* be rendered.
*
* @var type
*
* @var boolean
*/
public $showClose;
/**
* Defines if a click on the modal background should close the modal
* @var type
* @var boolean
*/
public $backdrop = true;
/**
* Defines if the modal can be closed by pressing escape
* @var type
* @var boolean
*/
public $keyboard = true;
/**
* Defines if the modal should be shown at startup
* @var type
* @var boolean
*/
public $show = false;
/**
* Defines if the modal should be shown at startup
* @var type
* @var boolean
*/
public $centerText = false;
/**
* Can be set to false if the modal body should not be initialized with an
* loader animation. Default is true, if no body is provided.
*
* @var type
*
* @var boolean
*/
public $initialLoader;
public function run()
{
{
return $this->render('modal', [
'id' => $this->id,
'options' => $this->getOptions(),
@ -115,32 +113,33 @@ class Modal extends JsWidget
'initialLoader' => $this->initialLoader
]);
}
public function getAttributes()
{
return [
'class' => "modal",
'tabindex' => "-1",
'role' => "dialog",
'tabindex' => "-1",
'role' => "dialog",
'aria-hidden' => "true"
];
}
public function getData()
{
$result = [];
if(!$this->backdrop) {
$result['backdrop'] = 'static';
}
if(!$this->keyboard) {
$result['keyboard'] = 'false';
}
if($this->show) {
$result['show'] = 'true';
}
return $result;
}