本文整理汇总了PHP中sajax_export函数的典型用法代码示例。如果您正苦于以下问题:PHP sajax_export函数的具体用法?PHP sajax_export怎么用?PHP sajax_export使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sajax_export函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
<?php
define("VIRGO_API_DIR", "virgo_api");
require_once "smarty/Smarty.class.php";
require_once VIRGO_API_DIR . "/virgo_api.php";
require "Sajax.php";
require VIRGO_API_DIR . "/ajaxfunctions.php";
sajax_init();
sajax_export("AJAXSynchronizeDB");
sajax_handle_client_request();
$smarty = new Smarty();
$api = new VirgoAPI();
sajax_handle_client_request();
$smarty->assign("synchronizeDB", $api->GetSynchronizeJS());
$smarty->assign("ajax", sajax_show_javascript());
$smarty->display("index.tpl");
示例2: _renderAJAXJavaScript
/**
* Outputs the AJAX-powered JavaScript to the browser. It is meant to be used
* by renderJavaScript()
*
* @access private
*/
function _renderAJAXJavaScript()
{
jpimport('helpers.sajax', true);
sajax_init();
sajax_force_page_ajax();
sajax_export('toggle', 'filepane', 'folderpane');
?>
<script language="JavaScript" type="text/javascript">
/*
* (S)AJAX Library code
*/
<?php
sajax_show_javascript();
?>
sajax_fail_handle = SAJAXTrap;
function SAJAXTrap( myData ) {
alert('Invalid AJAX reponse: ' + myData);
}
var globRoot = '';
function toggle( fileName )
{
x_toggle( fileName, toggle_cb );
}
function toggle_cb( myRet )
{
filepane();
}
function filepane()
{
x_filepane( globRoot, filepane_cb );
}
function filepane_cb( myRet )
{
document.getElementById('filepane').innerHTML = myRet;
}
function folderpane( path )
{
globRoot = path;
document.getElementById('currentdirectory').innerHTML = globRoot;
x_folderpane( globRoot, folderpane_cb );
}
function folderpane_cb( myRet )
{
document.getElementById('folderpane').innerHTML = myRet;
filepane();
}
</script>
<?php
}
示例3: __construct
public function __construct()
{
sajax_init();
sajax_export("AJAXSynchronizeDB");
sajax_export("AJAXSynchronizeOffersCount");
sajax_handle_client_request();
$this->synchronizeDB = $this->GetSynchronizeJS();
$this->synchronizeOffersCount = $this->GetSynchronizeOffersCount();
$this->ajax = sajax_show_javascript();
}
示例4: _renderAJAXJavaScript
/**
* Outputs the AJAX-powered JavaScript to the browser. It is meant to be used
* by renderJavaScript()
*
* @access private
*/
function _renderAJAXJavaScript()
{
jpimport('helpers.sajax', true);
sajax_init();
sajax_force_page_ajax();
sajax_export('toggle', 'tablepane');
?>
<script language="JavaScript" type="text/javascript">
/*
* (S)AJAX Library code
*/
<?php
sajax_show_javascript();
?>
sajax_fail_handle = SAJAXTrap;
function SAJAXTrap( myData ) {
alert('Invalid AJAX reponse: ' + myData);
}
function toggle( table )
{
x_toggle( table, toggle_cb );
}
function toggle_cb( myRet )
{
tablepane();
}
function tablepane()
{
x_tablepane( tablepane_cb );
}
function tablepane_cb( myRet )
{
document.getElementById('tablepane').innerHTML = myRet;
}
</script>
<?php
}
示例5: refresh
echo '<select name="ing">'.$inglist.'</select><input type="button" onclick="add(); return false;">'; */
return $retval;
}
function refresh() {
// parse_str($msg);
// $fname='/tmp/'.metaphone($recipe).'.'.$rindex;
$fname='/tmp/recipe.html';
$lines = file($fname);
// return the last 25 lines
return join("\n", $lines);
}
$sajax_request_type = "GET";
sajax_init();
sajax_export("add_ingredient", "refresh");
sajax_handle_client_request();
?>
<html>
<head>
<script>
<?
sajax_show_javascript();
?>
var check_n = 0;
function refresh_cb(new_data)
{
existing = document.getElementById("inglist").innerHTML;
示例6: mysql_query
$current = $row2[1];
}
if ($current > $all_c) {
$query2 = "update tree_history set th_current=" . $all_c . " where th_u_id=" . $_SESSION['uid'] . " and th_p_id=" . $_SESSION['projects'] . " and th_date>=DATE_SUB(now(), INTERVAL 1 HOUR)";
$tmp .= $query2 . "\n\r";
mysql_query($query2) or die(mysql_error());
}
$query2 = "delete from tree_history where th_u_id=" . $_SESSION['uid'] . " and th_p_id=" . $p_id . " and th_date>=DATE_SUB(now(), INTERVAL 1 HOUR) order by th_id desc limit " . $current;
$tmp .= $query2 . "\n\r";
mysql_query($query2) or die(mysql_error());
$query2 = "update tree_history set th_current=0 where th_u_id=" . $_SESSION['uid'] . " and th_p_id=" . $p_id . " and th_date>=DATE_SUB(now(), INTERVAL 1 HOUR)";
$tmp .= $query2 . "\n\r";
mysql_query($query2) or die(mysql_error());
$query2 = "insert into tree_history (th_r_id,th_u_id,th_p_id,th_parent_old,th_parent_old_pos,th_parent_new,th_parent_new_pos,th_rh_id,th_date,th_current) values (" . $r_id . "," . $_SESSION['uid'] . "," . $_SESSION['projects'] . "," . $r_parent_id_tmp . "," . $r_pos . "," . $r_parent_id_tmp . "," . $tmpPos . "," . $rh_id . ",now(),0)";
$tmp .= $query2 . "\n\r";
mysql_query($query2) or die(mysql_error());
$query2 = "update test set r_id='" . $tmp . "' where t_id=5";
$rs2 = mysql_query($query2) or die(mysql_error());
return $tmp;
}
//include Sajax
require "sajax.php";
//Sajax init
$sajax_request_type = "POST";
$sajax_debug_mode = "0";
sajax_init();
sajax_export("submitOrder");
//register all SITE FUNCTIONS
sajax_export("submitOrder2");
//register all SITE FUNCTIONS
sajax_handle_client_request();
示例7: Copyright
<?php
/*------------------------------------------------------------------------
# com_adagency
# ------------------------------------------------------------------------
# author iJoomla
# copyright Copyright (C) 2013 ijoomla.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.ijoomla.com
# Technical Support: Forum - http://www.ijoomla.com/forum/index/
-------------------------------------------------------------------------*/
// no direct access
defined('_JEXEC') or die('Restricted access');
$sajax_request_type = "POST";
sajax_init();
sajax_export("phpchangeProvince", "phpchangeCity");
sajax_handle_client_request();
示例8: sajax_init
<?php
require "lib/Sajax.php";
sajax_init();
$sajax_debug_mode = 1;
sajax_export("display");
sajax_handle_client_request();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>SAJAX test</title>
<script type="text/javascript">
<?php
sajax_show_javascript();
?>
</script>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/player.js"></script>
<script type="text/javascript" src="lib/mediaplayer/swfobject.js"></script>
</head>
<body>
<div id="playing">
<h3>SAJAX test</h3>
<a href="#" onclick="play(); return false;" title="Play This Playlist Now">play</a>
<div id="jwplayer"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.
<script type="text/javascript">
示例9: defined
<?php
/**
* @package JoomlaPack
* @copyright Copyright (c)2006-2009 JoomlaPack Developers
* @license GNU General Public License version 2, or later
* @version $id$
* @since 1.3
*
* The main page of the JoomlaPack component is where all the fun takes place :)
*/
// Protect from unauthorized access
defined('_JEXEC') or die('Restricted Access');
jpimport('helpers.sajax', true);
sajax_init();
sajax_export('getDefaultOutputDirectory', 'testFTPConnection');
$null = null;
sajax_handle_client_request($null);
function getDefaultOutputDirectory()
{
return JPATH_COMPONENT_ADMINISTRATOR . DS . 'backup';
}
function testFTPConnection($host, $port, $user, $pass, $initdir, $usessl, $passive)
{
jpimport('abstract.enginearchiver');
jpimport('engine.packer.directftp');
jpimport('core.utility.logger');
$config = array('host' => $host, 'port' => $port, 'user' => $user, 'pass' => $pass, 'initdir' => $initdir, 'usessl' => $usessl, 'passive' => $passive);
$test = new JoomlapackPackerDirectftp();
$test->initialize('', '', $config);
$errors = $test->getError();
示例10: defined
<?php
/**
* @package JoomlaPack
* @copyright Copyright (c)2006-2009 JoomlaPack Developers
* @license GNU General Public License version 2, or later
* @version $id$
* @since 1.3
*
* The main page of the JoomlaPack component is where all the fun takes place :)
*/
// Protect from unauthorized access
defined('_JEXEC') or die('Restricted Access');
jpimport('helpers.sajax', true);
sajax_init();
sajax_export('testdatabase');
$null = null;
sajax_handle_client_request($null);
function testdatabase($host, $port, $user, $pass, $database)
{
$JP_Error_Reporting = @error_reporting(E_ERROR | E_PARSE);
$host = $host . ($port != '' ? ":{$port}" : '');
jimport('joomla.database.database');
jimport('joomla.database.table');
$conf =& JFactory::getConfig();
$driver = $conf->getValue('config.dbtype');
$options = array('driver' => $driver, 'host' => $host, 'user' => $user, 'password' => $pass, 'database' => $database, 'prefix' => '');
$database =& JDatabase::getInstance($options);
$result = true;
if (JError::isError($database)) {
$result = false;
示例11: foreach
foreach ($this->profiles as $profile_id => $profile_description) {
$optprofiles[] = JHTML::_('select.option', $profile_id, $profile_description);
}
function echoLabel($labelkey, $tooltipkey = null)
{
if (is_null($tooltipkey)) {
echo JText::_($labelkey);
} else {
echo JHTML::_('tooltip', JText::_($tooltipkey), '', '', JText::_($labelkey));
}
}
// Load SAJAX library
jpimport('helpers.sajax', true);
sajax_init();
sajax_force_page_ajax();
sajax_export('getDefaultURL', 'getDefaultSecret', 'testFTP');
?>
<script type="text/javascript" language="JavaScript">
/*
* (S)AJAX Library code
*/
<?php
sajax_show_javascript();
?>
sajax_fail_handle = SAJAXTrap;
function SAJAXTrap( myData ) {
alert('Invalid AJAX reponse: ' + myData);
}
示例12: return_string
}
function return_string()
{
return "Name: Tom / Age: 26";
}
function return_int()
{
return 26;
}
function return_float()
{
return 26.25;
}
$sajax_request_type = "GET";
sajax_init();
sajax_export("return_array", "return_object", "return_string", "return_int", "return_float");
sajax_handle_client_request();
?>
<html>
<head>
<script>
<?php
sajax_show_javascript();
?>
function display_result(val) {
var repr;
repr = "";
repr += "Type: " + typeof val + "\n";
repr += "Value: ";
if (typeof val == "object" ||
示例13: GarbageCollector
* http://www.mp3act.net
* Copyright (C) 2005 Jon Buda (www.jonbuda.com)
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*************************************************************************/
require_once "modules/music/mp3act_functions.php";
require_once "modules/music/mp3act_sajax.php";
GarbageCollector();
$sajax_remote_uri = 'music/';
$sajax_request_type = 'POST';
sajax_init();
sajax_export("getplaylistnames", "musicLookup", "playlist_rem", "playlist_add", "playlistInfo", "clearPlaylist", "buildBreadcrumb", "play", "playlist_move", "searchMusic", "viewPlaylist", "getDropDown", "savePlaylist", "getRandItems", "randAdd", "deletePlaylist");
sajax_handle_client_request();
$headers[] = '<link rel="Stylesheet" href="' . skin_url . 'music.css" type="text/css">';
require 'modules/_shared/tmpl/' . tmpl . '/header.php';
?>
<script type="text/javascript">
var page = 'search';
var mode = '<?php
echo $_SESSION['sess_playmode'];
?>
';
var bc_parenttype = '';
var bc_parentitem = '';
var bc_childtype = '';
var bc_childitem = '';
示例14: get_highscore
require "Sajax.php";
function get_highscore()
{
$db = new DB_Seminar("SELECT MAX(score) FROM murmeln_highscore");
$db->next_record();
return $db->f(0);
}
function get_highscore_list()
{
$db = new DB_Seminar("SELECT murmeln_highscore.*,username FROM murmeln_highscore LEFT JOIN auth_user_md5 USING(user_id) ORDER BY score DESC LIMIT 20");
$ret = '<ol>';
$maxscore = 0;
while ($db->next_record()) {
$ret .= '<li><b>' . $db->f('score') . '</b> -
' . ($db->f('username') ? '<a href="' . UrlHelper::getLink('about.php?username=' . $db->f('username')) . '">' . htmlReady(get_fullname_from_uname($db->f('username'))) . '</a>' : htmlready($db->f('name'))) . '</li>';
$maxscore = $db->f('score');
}
$ret .= '</ol>';
$db->query("DELETE FROM murmeln_highscore WHERE score < " . $maxscore);
return $ret;
}
function set_highscore($score = 0)
{
$db = new DB_Seminar("INSERT INTO murmeln_highscore (score,user_id,name) VALUES (\n\t\t\t\t\t\t\t{$score}, '" . $GLOBALS['user']->id . "','" . mysql_escape_string(get_fullname()) . "')");
return $db->affected_rows();
}
$GLOBALS['sajax_remote_uri'] = $pluginrelativepath . '/sajax_functions.php';
$GLOBALS['sajax_debug_mode'] = 0;
sajax_init();
sajax_export("get_highscore", "get_highscore_list", "set_highscore");
sajax_handle_client_request();
示例15: sajax_init
$campo = 'Nenhum registro encontrado!';
} else {
$campo .= '</select>';
}
return $campo;
}
$sajax_request_type = "POST";
//forma como os dados serao enviados
$sajax_debug_mode = 0;
sajax_init();
//inicia o SAJAX
sajax_export("busca");
// lista de funcoes a ser exportadas
sajax_export("busca2");
// lista de funcoes a ser exportadas
sajax_export("busca3");
// lista de funcoes a ser exportadas
sajax_handle_client_request();
// serve instancias de clientes
//////////
echo '<script language="JavaScript" type="text/javascript">';
sajax_show_javascript();
//gera o javascript
echo '
function mudaPesquisa(tipo)
{
var indexOption1 = document.getElementById(\'numcontacorrente\').selectedIndex;
var nome = document.getElementById(\'numcontacorrente\').options[indexOption1].text;
var valor = document.getElementById(\'numcontacorrente\').options[indexOption1].value;
document.getElementById(\'tipoc\').value = nome;
var index = nome.indexOf(\'-\')+2;