Esempio n. 1
0
 /**
  * @todo 解决和dialog重复的问题
  *
  * @param boolean $show
  * @return string
  */
 public function render($show = true)
 {
     ob_start();
     /**
      * ajax 也要显示显示 Tq消息
      * Tq消息要在 tip 之前
      * ajax不显示消息, 此时消息存在 session 里,下次统一发送
      */
     //echo Tpm_Message_Sender_Tq::getMsgHtml();
     /**
      * 这里显示主体部分
      */
     parent::render(true);
     $out = ob_get_clean();
     if ($show) {
         echo $out;
     }
     //如果输出debug信息, Ajax会不爽
     Watt_Debug::getDefaultDebug()->clearDebugInfo();
     return $out;
 }
Esempio n. 2
0
 /**
  * 职责变了,这个方法没有用了
  *
  * @param boolean $show
  * @return string
  */
 public function render($show = true)
 {
     /**
      * 是否输出主体
      */
     $outputBody = true;
     ob_start();
     //echo "Html Header";
     //echo "Body Header";
     if ($this->_header && is_array($this->_header)) {
         //这里展开了 sys_title 和 tpm_css
         extract($this->_header);
     }
     include $this->_getAbsViewPathFilename("inc/header.dailog.html.php");
     /**
      * 这里显示 Tq消息
      * Tq消息要在 tip 之前
      */
     echo Tpm_Message_Sender_Tq::getMsgHtml();
     /**
      * 处理在 ctrl 里设置的tip提示信息
      */
     if (is_array($this->_header) && key_exists(Watt_Controller_Action::HEADER_TIP, $this->_header)) {
         $tip = $this->_header[Watt_Controller_Action::HEADER_TIP];
         echo "<script>";
         $msg = $tip[Watt_Controller_Action::HEADER_TIP_MSG];
         if ($nextUrl = $tip[Watt_Controller_Action::HEADER_TIP_URL]) {
             $matchs = null;
             if (preg_match("/^javascript:(.*)/", $nextUrl, $matchs)) {
                 //						echo "function onloadTip(){Ext.Msg.alert('TPM', '".addslashes($tip[Watt_Controller_Action::HEADER_TIP_MSG])."', function(){{$matchs[1]};return false;});}";
                 echo "function onloadTip() {" . ($msg ? "alert('" . addslashes($msg) . "');" : '') . "{$matchs[1]}}";
             } else {
                 //						echo "function onloadTip(){Ext.Msg.alert('TPM', '".addslashes($tip[Watt_Controller_Action::HEADER_TIP_MSG])."', function(){location.href='".$nextUrl."';return false;});}";
                 echo "function onloadTip() {" . ($msg ? "alert('" . addslashes($msg) . "');" : '') . "location.href='" . $nextUrl . "'}";
             }
             //如果有转向,则不输出主体
             $outputBody = false;
         } else {
             //					echo "function onloadTip(){Ext.Msg.alert('TPM', '".addslashes($tip[Watt_Controller_Action::HEADER_TIP_MSG])."');}";
             echo "function onloadTip() {" . ($msg ? "alert('" . addslashes($msg) . "');" : '') . "}";
         }
         echo "window.onload = onloadTip;";
         echo "</script>";
     }
     if ($outputBody) {
         //没有设置不显示主体
         //这里显示菜单 有true 是因为 菜单数据目前是在Watt_View_Helper_Menu里的
         //			if( isset( $this->_header["menu"] ) )
         //			{
         //				//var_dump( $this->_header );
         //				$menu = new Watt_View_Helper_Menu();
         //				$menu->buildMenu( $this->_header["menu"] );
         //				//$menu->buildMenu( null );
         //			}
         /**
          * 这里显示主体部分
          */
         parent::render(true);
     }
     /**
      * 这里显示底部
      */
     //echo "Body Footer";
     include $this->_getAbsViewPathFilename("inc/footer.dailog.html.php");
     $out = ob_get_clean();
     if ($show) {
         echo $out;
     }
     return $out;
 }