Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CJuiAccordion
  • CJuiAutoComplete
  • CJuiButton
  • CJuiDatePicker
  • CJuiDialog
  • CJuiDraggable
  • CJuiDroppable
  • CJuiInputWidget
  • CJuiProgressBar
  • CJuiResizable
  • CJuiSelectable
  • CJuiSlider
  • CJuiSliderInput
  • CJuiSortable
  • CJuiTabs
  • CJuiWidget
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * CJuiDialog class file.
 4:  *
 5:  * @author Sebastian Thierer <sebathi@gmail.com>
 6:  * @link http://www.yiiframework.com/
 7:  * @copyright 2008-2013 Yii Software LLC
 8:  * @license http://www.yiiframework.com/license/
 9:  */
10: 
11: Yii::import('zii.widgets.jui.CJuiWidget');
12: 
13: /**
14:  * CJuiDialog displays a dialog widget.
15:  *
16:  * CJuiDialog encapsulates the {@link http://jqueryui.com/dialog/ JUI Dialog}
17:  * plugin.
18:  *
19:  * To use this widget, you may insert the following code in a view:
20:  * <pre>
21:  * $this->beginWidget('zii.widgets.jui.CJuiDialog',array(
22:  *     'id'=>'mydialog',
23:  *     // additional javascript options for the dialog plugin
24:  *     'options'=>array(
25:  *         'title'=>'Dialog box 1',
26:  *         'autoOpen'=>false,
27:  *     ),
28:  * ));
29:  *
30:  *     echo 'dialog content here';
31:  *
32:  * $this->endWidget('zii.widgets.jui.CJuiDialog');
33:  *
34:  * // the link that may open the dialog
35:  * echo CHtml::link('open dialog', '#', array(
36:  *    'onclick'=>'$("#mydialog").dialog("open"); return false;',
37:  * ));
38:  * </pre>
39:  *
40:  * By configuring the {@link options} property, you may specify the options
41:  * that need to be passed to the JUI dialog plugin. Please refer to
42:  * the {@link http://api.jqueryui.com/dialog/ JUI Dialog API} documentation
43:  * for possible options (name-value pairs) and
44:  * {@link http://jqueryui.com/dialog/ JUI Dialog page} for general description
45:  * and demo.
46:  *
47:  * @author Sebastian Thierer <sebathi@gmail.com>
48:  * @package zii.widgets.jui
49:  * @since 1.1
50:  */
51: class CJuiDialog extends CJuiWidget
52: {
53:     /**
54:      * @var string the name of the container element that contains all panels. Defaults to 'div'.
55:      */
56:     public $tagName='div';
57: 
58:     /**
59:      * Renders the open tag of the dialog.
60:      * This method also registers the necessary javascript code.
61:      */
62:     public function init()
63:     {
64:         parent::init();
65: 
66:         $id=$this->getId();
67:         if(isset($this->htmlOptions['id']))
68:             $id=$this->htmlOptions['id'];
69:         else
70:             $this->htmlOptions['id']=$id;
71: 
72:         $options=CJavaScript::encode($this->options);
73:         Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$id,"jQuery('#{$id}').dialog($options);");
74: 
75:         echo CHtml::openTag($this->tagName,$this->htmlOptions)."\n";
76:     }
77: 
78:     /**
79:      * Renders the close tag of the dialog.
80:      */
81:     public function run()
82:     {
83:         echo CHtml::closeTag($this->tagName);
84:     }
85: }
API documentation generated by ApiGen 2.8.0