From 9be83188f796a650f372bd9c5aeeb19ef7a3ceed Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Fri, 24 May 2013 16:53:18 +0400 Subject: [PATCH] jQuery UI dialog widget --- framework/yii/jui/Dialog.php | 53 ++++++++++++++++++++++++++++++++++++++++++++ framework/yii/jui/assets.php | 4 ++-- 2 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 framework/yii/jui/Dialog.php diff --git a/framework/yii/jui/Dialog.php b/framework/yii/jui/Dialog.php new file mode 100644 index 0000000..921758e --- /dev/null +++ b/framework/yii/jui/Dialog.php @@ -0,0 +1,53 @@ + array( + * 'modal' => true, + * ), + * )); + * + * echo 'Dialog contents here...'; + * + * Dialog::end(); + * ``` + * + * @see http://api.jqueryui.com/dialog/ + * @author Alexander Kochetov + * @since 2.0 + */ +class Dialog extends Widget +{ + /** + * Initializes the widget. + */ + public function init() + { + parent::init(); + echo Html::beginTag('div', $this->options) . "\n"; + } + + /** + * Renders the widget. + */ + public function run() + { + echo Html::endTag('div') . "\n"; + $this->registerWidget('dialog'); + } +} diff --git a/framework/yii/jui/assets.php b/framework/yii/jui/assets.php index 285026c..d2d8f7c 100644 --- a/framework/yii/jui/assets.php +++ b/framework/yii/jui/assets.php @@ -559,7 +559,7 @@ return array( 'js' => array( 'jquery.ui.dialog.js', ), - 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/button', 'yii/jui/draggable', 'yii/jui/mouse', 'yii/jui/position', 'yii/jui/resizeable', 'yii/jui/effect/all'), + 'depends' => array('yii/jui/core', 'yii/jui/widget', 'yii/jui/button', 'yii/jui/draggable', 'yii/jui/mouse', 'yii/jui/position', 'yii/jui/resizable', 'yii/jui/effect/all'), ), 'yii/jui/draggable' => array( 'sourcePath' => __DIR__ . '/assets', @@ -803,7 +803,7 @@ return array( 'css' => array( 'themes/base/jquery.ui.dialog.css', ), - 'depends' => array('yii/jui/theme/base/core', 'yii/jui/theme/base/button', 'yii/jui/theme/base/resizeable'), + 'depends' => array('yii/jui/theme/base/core', 'yii/jui/theme/base/button', 'yii/jui/theme/base/resizable'), ), 'yii/jui/theme/base/menu' => array( 'sourcePath' => __DIR__ . '/assets',