当前位置: 首页>>代码示例>>PHP>>正文


PHP xajaxResponse::getOutput方法代码示例

本文整理汇总了PHP中xajaxResponse::getOutput方法的典型用法代码示例。如果您正苦于以下问题:PHP xajaxResponse::getOutput方法的具体用法?PHP xajaxResponse::getOutput怎么用?PHP xajaxResponse::getOutput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xajaxResponse的用法示例。


在下文中一共展示了xajaxResponse::getOutput方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showOutput

function showOutput()
{
    $testResponse = new xajaxResponse();
    $testResponse->alert("Hello");
    $testResponse2 = new xajaxResponse();
    $testResponse2->loadCommands($testResponse);
    $testResponse2->replace("this", "is", "a", "replacement]]>");
    $testResponseOutput = htmlspecialchars($testResponse2->getOutput());
    $objResponse = new xajaxResponse();
    $objResponse->assign("submittedDiv", "innerHTML", $testResponseOutput);
    $aValues = array();
    $aValues[] = "Yippie";
    $objResponse->setReturnValue($aValues);
    return $objResponse;
}
开发者ID:silvia-valdez,项目名称:SignalsViewer,代码行数:15,代码来源:xajaxResponseTest.php

示例2: smarty_function_xajax_response

function smarty_function_xajax_response($params, &$smarty)
{
    $return = '';
    if (isset($params['content']) && $params['content'] != '') {
        global $smarty, $ajaxlib;
        include_once 'lib/ajax/xajax.inc.php';
        if ($ajaxlib && $ajaxlib->canProcessRequests()) {
            $objResponse = new xajaxResponse();
            $objResponse->assign('tiki-center', 'innerHTML', $params['content']);
            $return = $objResponse->getOutput();
            unset($objResponse);
        }
    }
    return $return;
}
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:15,代码来源:function.xajax_response.php

示例3: showOutput

function showOutput()
{
    $testResponse = new xajaxResponse();
    $testResponse->alert("Edit this test and uncomment lines in the showOutput() method to test plugin calling");
    // PHP4 & PHP5
    $testResponse->plugin("testPlugin", "testMethod");
    // PHP5 ONLY - Uncomment to test
    //$testResponse->plugin("testPlugin")->testMethod();
    // PHP5 ONLY - Uncomment to test
    //$testResponse->testPlugin->testMethod();
    $testResponseOutput = htmlspecialchars($testResponse->getOutput());
    $objResponse = new xajaxResponse();
    $objResponse->assign("submittedDiv", "innerHTML", $testResponseOutput);
    $objResponse->plugin('testPlugin', 'testMethod');
    return $objResponse;
}
开发者ID:beakid,项目名称:md,代码行数:16,代码来源:basicPluginTest.php

示例4: showOutput

function showOutput()
{
    $testResponse = new xajaxResponse();
    $testResponse->alert("This is the text that would be displayed in an alert box.");
    // PHP4 & PHP5
    if (isset($_GET['methodOne'])) {
        eval('$testResponse->plugin("testPlugin", "testMethod");');
    }
    // PHP5 ONLY - Uncomment to test
    if (isset($_GET['methodTwo'])) {
        eval('$testResponse->plugin("testPlugin")->testMethod();');
    }
    // PHP5 ONLY - Uncomment to test
    if (isset($_GET['methodThree'])) {
        eval('$testResponse->testPlugin->testMethod();');
    }
    $testResponseOutput = '<pre>' . htmlspecialchars(str_replace("><", ">\n<", $testResponse->getOutput())) . '</pre>';
    $objResponse = new xajaxResponse();
    $objResponse->assign("submittedDiv", "innerHTML", $testResponseOutput);
    if (isset($_GET['methodOne'])) {
        eval('$objResponse->plugin("testPlugin", "testMethod");');
    }
    if (isset($_GET['methodTwo'])) {
        eval('$objResponse->plugin("testPlugin")->testMethod();');
    }
    if (isset($_GET['methodThree'])) {
        eval('$objResponse->testPlugin->testMethod();');
    }
    return $objResponse;
}
开发者ID:beakid,项目名称:md,代码行数:30,代码来源:pluginTest.php

示例5: htmlspecialchars

 function sql_error($query, $values, $result)
 {
     global $ADODB_LASTDB, $smarty, $prefs, $ajaxlib;
     trigger_error($ADODB_LASTDB . " error:  " . htmlspecialchars($this->db->ErrorMsg()) . " in query:<br /><pre>\n" . htmlspecialchars($query) . "\n</pre><br />", E_USER_WARNING);
     // only for debugging.
     //trigger_error($ADODB_LASTDB . " error:  " . $this->db->ErrorMsg(). " in query:<br />" . $query . "<br />", E_USER_WARNING);
     $outp = "<div class='simplebox'><b>" . htmlspecialchars(tra("An error occured in a database query!")) . "</b></div>";
     $outp .= "<br /><table class='form'>";
     $outp .= "<tr class='heading'><td colspan='2'>Context:</td></tr>";
     $outp .= "<tr class='formcolor'><td>File</td><td>" . htmlspecialchars(basename($_SERVER['SCRIPT_NAME'])) . "</td></tr>";
     $outp .= "<tr class='formcolor'><td>Url</td><td>" . htmlspecialchars(basename($_SERVER['REQUEST_URI'])) . "</td></tr>";
     $outp .= "<tr class='heading'><td colspan='2'>Query:</td></tr>";
     $outp .= "<tr class='formcolor'><td colspan='2'><tt>" . htmlspecialchars($query) . "</tt></td></tr>";
     $outp .= "<tr class='heading'><td colspan='2'>Values:</td></tr>";
     foreach ($values as $k => $v) {
         if (is_null($v)) {
             $v = '<i>NULL</i>';
         } else {
             $v = htmlspecialchars($v);
         }
         $outp .= "<tr class='formcolor'><td>" . htmlspecialchars($k) . "</td><td>{$v}</td></tr>";
     }
     $outp .= "<tr class='heading'><td colspan='2'>Message:</td></tr><tr class='formcolor'><td colspan='2'>" . htmlspecialchars($this->db->ErrorMsg()) . "</td></tr>\n";
     $q = $query;
     foreach ($values as $v) {
         if (is_null($v)) {
             $v = 'NULL';
         } else {
             $v = "'" . addslashes($v) . "'";
         }
         $pos = strpos($q, '?');
         if ($pos !== FALSE) {
             $q = substr($q, 0, $pos) . "{$v}" . substr($q, $pos + 1);
         }
     }
     $outp .= "<tr class='heading'><td colspan='2'>Built query was probably:</td></tr><tr class='formcolor'><td colspan='2'>" . htmlspecialchars($q) . "</td></tr>\n";
     if (function_exists('xdebug_get_function_stack')) {
         function mydumpstack($stack)
         {
             $o = '';
             foreach ($stack as $line) {
                 $o .= '* ' . $line['file'] . " : " . $line['line'] . " -> " . $line['function'] . "(" . var_export($line['params'], true) . ")<br />";
             }
             return $o;
         }
         $outp .= "<tr class='heading'><th>Stack Trace</th><td>" . mydumpstack(xdebug_get_function_stack()) . "</td></tr>";
     }
     $outp .= "</table>";
     //if($result===false) echo "<br>\$result is false";
     //if($result===null) echo "<br>\$result is null";
     //if(empty($result)) echo "<br>\$result is empty";
     $showviaajax = false;
     if ($prefs['feature_ajax'] == 'y') {
         global $ajaxlib;
         include_once 'lib/ajax/xajax.inc.php';
         if ($ajaxlib && $ajaxlib->canProcessRequests()) {
             // this was a xajax request -> return a xajax answer
             $objResponse = new xajaxResponse();
             $page = "<html><head>";
             $page .= " <title>Tiki SQL Error (xajax)</title>";
             $page .= " <link rel='stylesheet' href='styles/tikineat.css' type='text/css' />";
             $page .= "</head><body>{$outp}</body></html>";
             $page = addslashes(str_replace(array("\n", "\r"), array(' ', ' '), $page));
             $objResponse->addScript("bugwin=window.open('', 'tikierror', 'width=760,height=500,scrollbars=1,resizable=1');" . "bugwin.document.write('{$page}');");
             echo $objResponse->getOutput();
             die;
         }
     }
     if (!isset($_SESSION['fatal_error'])) {
         // Do not show the error if an error has already occured during the same script execution (error.tpl already called),
         //   because tiki should have died before another error.
         // This happens when error.tpl is called by tiki.sql... and tiki.sql is also called again in error.tpl, entering in an infinite loop.
         require_once 'tiki-setup.php';
         if ($smarty) {
             $smarty->assign('msg', $outp);
             $_SESSION['fatal_error'] = 'y';
             $smarty->display('error.tpl');
             unset($_SESSION['fatal_error']);
         } else {
             echo $outp;
         }
         die;
     }
 }
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:84,代码来源:tikidblib.php


注:本文中的xajaxResponse::getOutput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。