00001 <?php 00026 require_once "ZendX/JQuery/View/Helper/UiWidget.php"; 00027 00036 class ZendX_JQuery_View_Helper_DialogContainer extends ZendX_JQuery_View_Helper_UiWidget 00037 { 00048 public function dialogContainer($id, $content, $params=array(), $attribs=array()) 00049 { 00050 if (!array_key_exists('id', $attribs)) { 00051 $attribs['id'] = $id; 00052 } 00053 00054 if(count($params) > 0) { 00055 $params = ZendX_JQuery::encodeJson($params); 00056 } else { 00057 $params = "{}"; 00058 } 00059 00060 $js = sprintf('%s("#%s").dialog(%s);', 00061 ZendX_JQuery_View_Helper_JQuery::getJQueryHandler(), 00062 $attribs['id'], 00063 $params 00064 ); 00065 $this->jquery->addOnLoad($js); 00066 00067 $html = '<div' 00068 . $this->_htmlAttribs($attribs) 00069 . '>' 00070 . $content 00071 . '</div>'; 00072 return $html; 00073 } 00074 }