|
Server IP : 127.0.0.1 / Your IP : 127.0.0.1 Web Server : Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3 System : Windows NT WIN-R7LTCC7BPLI 6.3 build 9200 (Windows Server 2012 R2 Datacenter Edition) i586 User : GerbangSIPAD ( 0) PHP Version : 5.6.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF Directory (0777) : C:/xampp5/htdocs/bhumie/upload/../protected/extensions/EUpdateDialog/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
/**
* EUpdateDialog class file.
*
* @author Andrew M. <andrew2mar@gmail.com>
* @copyright Copyright © 2011 Andrew M.
* @license Licensed under MIT license.
* @version 1.0
*/
/**
* EUpdateDialog allows to create/update/delete model entry from JUI Dialog.
*
* @author Andrew M. <andrew2mar@gmail.com>
*/
class EUpdateDialog extends CWidget
{
/**
* @var int the height of the dialog.
*/
public $height = 'auto';
/**
* @var bool if set to true, the dialog will be resizable.
*/
public $resizable = false;
/**
* @var string the title of the dialog.
*/
public $title = 'Dialog';
/**
* @var string the id of the dialog.
*/
public $id= 'update-dialog';
/**
* @var int the width of the dialog.
*/
public $width = 500;
/**
* Add the update dialog to current page.
*/
public function run()
{
$this->beginWidget( 'zii.widgets.jui.CJuiDialog', array(
'id' => $this->id,
'theme'=>'sunny',
'themeUrl'=>Yii::app()->request->baseUrl.'/css/themes/',
'options' => array(
'autoOpen' => false,
'height' => $this->height,
'modal' => true,
'resizable' => $this->resizable,
'title' => $this->title,
'width' => $this->width,
),
)); ?>
<div class="update-dialog-content"></div>
<?php $this->endWidget();
$assets = Yii::app()->getAssetManager()->publish( Yii::getPathOfAlias(
'ext.EUpdateDialog' ) . '/assets' );
$cs = Yii::app()->getClientScript();
$cs->registerScriptFile( $assets . '/eUpdateDialog.js' );
// Add cookie script and csrf cookie if using CSRF validation.
if( Yii::app()->request->enableCsrfValidation )
{
$cs->registerScriptFile( $assets . '/jquery.cookie.js' );
Yii::app()->request->getCsrfToken();
}
}
}
?>