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


PHP xajaxResponse::addScript方法代码示例

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


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

示例1: BlockPlayer

function BlockPlayer($check, $sid, $num, $type, $length)
{
    $objResponse = new xajaxResponse();
    global $userbank, $username;
    $sid = (int) $sid;
    $length = (int) $length;
    if (!$userbank->HasAccess(ADMIN_OWNER | ADMIN_ADD_BAN)) {
        $objResponse->redirect("index.php?p=login&m=no_access", 0);
        $log = new CSystemLog("w", "Hacking Attempt", $username . " tried to process a playerblock, but doesnt have access.");
        return $objResponse;
    }
    //get the server data
    $sdata = $GLOBALS['db']->GetRow("SELECT ip, port, rcon FROM " . DB_PREFIX . "_servers WHERE sid = '" . $sid . "';");
    //test if server is online
    if ($test = @fsockopen($sdata['ip'], $sdata['port'], $errno, $errstr, 2)) {
        @fclose($test);
        require_once INCLUDES_PATH . "/CServerRcon.php";
        $r = new CServerRcon($sdata['ip'], $sdata['port'], $sdata['rcon']);
        if (!$r->Auth()) {
            $GLOBALS['db']->Execute("UPDATE " . DB_PREFIX . "_servers SET rcon = '' WHERE sid = '" . $sid . "' LIMIT 1;");
            $objResponse->addAssign("srv_{$num}", "innerHTML", "<font color='red' size='1'>Wrong RCON Password, please change!</font>");
            $objResponse->addScript('set_counter(1);');
            return $objResponse;
        }
        $ret = $r->rconCommand("status");
        // show hostname instead of the ip, but leave the ip in the title
        require_once "../includes/system-functions.php";
        $hostsearch = preg_match_all('/hostname:[ ]*(.+)/', $ret, $hostname, PREG_PATTERN_ORDER);
        $hostname = trunc(htmlspecialchars($hostname[1][0]), 25, false);
        if (!empty($hostname)) {
            $objResponse->addAssign("srvip_{$num}", "innerHTML", "<font size='1'><span title='" . $sdata['ip'] . ":" . $sdata['port'] . "'>" . $hostname . "</span></font>");
        }
        $gothim = false;
        $search = preg_match_all(STATUS_PARSE, $ret, $matches, PREG_PATTERN_ORDER);
        //search for the steamid on the server
        foreach ($matches[3] as $match) {
            if (substr($match, 8) == substr($check, 8)) {
                // gotcha!!! kick him!
                $gothim = true;
                $GLOBALS['db']->Execute("UPDATE `" . DB_PREFIX . "_comms` SET sid = '" . $sid . "' WHERE authid = '" . $check . "' AND RemovedBy IS NULL;");
                $requri = substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], "pages/admin.blockit.php"));
                $kick = $r->sendCommand("sc_fw_block " . $type . " " . $length . " " . $match);
                $objResponse->addAssign("srv_{$num}", "innerHTML", "<font color='green' size='1'><b><u>Player Found & blocked!!!</u></b></font>");
                $objResponse->addScript("set_counter('-1');");
                return $objResponse;
            }
        }
        if (!$gothim) {
            $objResponse->addAssign("srv_{$num}", "innerHTML", "<font size='1'>Player not found.</font>");
            $objResponse->addScript('set_counter(1);');
            return $objResponse;
        }
    } else {
        $objResponse->addAssign("srv_{$num}", "innerHTML", "<font color='red' size='1'><i>Can't connect to server.</i></font>");
        $objResponse->addScript('set_counter(1);');
        return $objResponse;
    }
}
开发者ID:CodingDK,项目名称:SourceBans-Fork,代码行数:58,代码来源:admin.blockit.php

示例2: ws_menu

function ws_menu($window_name, $form = '')
{
    global $conf, $images;
    $html = $js = '';
    // If an array in a string was provided, build the array and store it in $form
    $form = parse_options_string($form);
    printmsg("DEBUG => Displaying tooltip: {$form['tooltip']}", 4);
    $menuname = 'get_html_' . $form['menu_name'];
    list($html, $js) = $menuname($form);
    // Okay here's what we do:
    //   1. Hide the tool-tip
    //   2. Update it's content
    //   3. Reposition it
    //   4. Unhide it
    $response = new xajaxResponse();
    if ($html) {
        $response->addScript("el('{$form['id']}').style.visibility = 'hidden';");
        $response->addAssign($form['id'], "innerHTML", $html);
        $response->addScript("wwTT_position('{$form['id']}'); el('{$form['id']}').style.visibility = 'visible';");
    }
    if ($js) {
        $response->addScript($js);
    }
    return $response->getXML();
}
开发者ID:edt82,项目名称:ona,代码行数:25,代码来源:menu_control.inc.php

示例3: abrirNavFotos

 function abrirNavFotos($id)
 {
     $objResponse = new xajaxResponse();
     $codigo = '';
     $objResponse->addScript("xajax_loadNavFotos(" . $id . ")");
     $objResponse->addScript("desplegarDiv()");
     return $objResponse;
 }
开发者ID:kailIII,项目名称:eneboo-ecommerce,代码行数:8,代码来源:xajax_serv.inc.php

示例4: updateInBox

function updateInBox($usua_doc)
{
    $xres = new xajaxResponse();
    $ruta_raiz = ".";
    include_once "{$ruta_raiz}/include/db/ConnectionHandler.php";
    $db = new ConnectionHandler("{$ruta_raiz}");
    $db->conn->SetFetchMode(ADODB_FETCH_ASSOC);
    switch ($db->driver) {
        case 'oci8':
            $query = "SELECT * FROM SGD_NOVEDAD_USUARIO WHERE USUA_DOC='{$usua_doc}'";
            break;
        case 'postgres':
            $campo = '"USUA_DOC"';
            $query = "SELECT * FROM SGD_NOVEDAD_USUARIO WHERE {$campo}='{$usua_doc}'";
            break;
    }
    $rs = $db->query($query);
    //var_dump($query);
    while (!$rs->EOF) {
        $xres->addScript("var lf=screen.width-380; var tp=screen.height-200; window.open('alert.php', 'ORFEO :: Bandeja de Entrada','width=460, height=200, status=0, toolbar=0, resizable=0, scrollbars=1, location=0, left='+lf+',top='+tp);");
        $rs->moveNext();
    }
    $xres->addAssign("folders", "innerHTML", ob_get_clean());
    return utf8_encode($xres->getXML());
}
开发者ID:johnfelipe,项目名称:orfeo,代码行数:25,代码来源:inBox_xajax.php

示例5: ws_delete

function ws_delete($window_name, $form = '')
{
    global $base, $include, $conf, $self, $onadb;
    // Check permissions
    if (!(auth('host_del') or auth('subnet_del'))) {
        $response = new xajaxResponse();
        $response->addScript("alert('Permission denied!');");
        return $response->getXML();
    }
    // If an array in a string was provided, build the array and store it in $form
    $form = parse_options_string($form);
    // Instantiate the xajaxResponse object
    $response = new xajaxResponse();
    $js = '';
    // Run the module
    list($status, $output) = run_module('tag_del', array('tag' => $form['id'], 'commit' => 'Y'));
    // If the module returned an error code display a popup warning
    if ($status) {
        $js .= "alert('Delete failed. " . preg_replace('/[\\s\']+/', ' ', $self['error']) . "');";
    } else {
        // If there's (refresh) js, send it to the browser
        if ($form['js']) {
            $js .= $form['js'];
        }
    }
    // Return an XML response
    $response->addScript($js);
    return $response->getXML();
}
开发者ID:edt82,项目名称:ona,代码行数:29,代码来源:edit_tag.inc.php

示例6: xajaxResponse

    function get_bed($inputId, $id, $id_sel = NULL) {
		$objResponse = new xajaxResponse();
		$kon = new Konek;
		$kon->sql = "SELECT id,nomor FROM ref_kamar WHERE pelayanan_id = '".$id."' AND status=0 ORDER BY nomor";
		$kon->execute();
		$data = $kon->getAll();	
		$objResponse->addAssign($inputId, "options.length", "1");
		for($i=0;$i<sizeof($data);$i++) {
			if($data[$i][id] == $id_sel)
				$objResponse->addScript("addOption('".$inputId."','".$inputId."kamar_".$data[$i][id]."','".$data[$i][nama]."','".$data[$i][id]."',false,true);");
			else
				$objResponse->addScript("addOption('".$inputId."','".$inputId."_kamar_".$data[$i][id]."','".$data[$i][nama]."','".$data[$i][id]."',false,false);");
		}
		//$objResponse->addScript("addOption('".$inputId."','".$inputId."_tidak_ada_dokter','Dokter Lain','',false,false);");
		return $objResponse;
	}    			
开发者ID:reekoheek,项目名称:srmis,代码行数:16,代码来源:ref_kamar.php

示例7:

    function tutup_resep_rawat_jalan() {
		$objResponse = new xajaxResponse;
		$objResponse->addScriptCall("enable_mainbar");
		$objResponse->addAssign("modal_resep_rawat_jalan", "style.display", "none");
		$objResponse->addScript("document.getElementById('input_resep_rawat_jalan').reset()");
		
		return $objResponse;
	}    
开发者ID:reekoheek,项目名称:srmis,代码行数:8,代码来源:resep_rajal.modal.php

示例8: disconnectUser

function disconnectUser($dn_name, $us_login)
{
    global $auth;
    $objResponse = new xajaxResponse();
    $auth->disconnectUser($dn_name, $us_login);
    $objResponse->addScript("document.location='connected_users.php'");
    return $objResponse->getXML();
}
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:8,代码来源:connected_users.php

示例9: init

/**
*  initialize page elements
*
*/
function init()
{
    global $locate;
    $objResponse = new xajaxResponse();
    $objResponse->addAssign("divNav", "innerHTML", common::generateManageNav($skin));
    $objResponse->addAssign("divCopyright", "innerHTML", common::generateCopyright($skin));
    $objResponse->addScript("xajax_showGrid(0," . ROWSXPAGE . ",'','','')");
    return $objResponse;
}
开发者ID:ljhcj,项目名称:IRISCC,代码行数:13,代码来源:asteriskcalls.server.php

示例10: showStatus

/**
*  show extension status
*  @return	objResponse		object		xajax response object
*/
function showStatus($curhover)
{
    $objResponse = new xajaxResponse();
    $html .= "<br><br><br><br>";
    $html .= asterEvent::checkExtensionStatus(0, 'table', $curhover);
    $objResponse->addAssign("divStatus", "innerHTML", $html);
    $objResponse->addScript("menuFix();");
    return $objResponse;
}
开发者ID:ljhcj,项目名称:IRISCC,代码行数:13,代码来源:systemstatus.server.php

示例11: init

function init()
{
    global $locate;
    //,$config,$db;
    $objResponse = new xajaxResponse();
    $objResponse->addAssign("divNav", "innerHTML", common::generateManageNav($skin, $_SESSION['curuser']['country'], $_SESSION['curuser']['language']));
    $objResponse->addAssign("divCopyright", "innerHTML", common::generateCopyright($skin));
    $objResponse->addScript("xajax_showGrid(0," . ROWSXPAGE . ",'','','')");
    return $objResponse;
}
开发者ID:ljhcj,项目名称:IRISCC,代码行数:10,代码来源:monitorrecords.server.php

示例12: xajax_redirect

/**
 * callback if the session-check fails, redirects via xajax to login.php
 * 
 * @param array &$anon_account anon account_info with keys 'login', 'passwd' and optional 'passwd_type'
 * @return boolean/string true if we allow anon access and anon_account is set, a sessionid or false otherwise
 */
function xajax_redirect(&$anon_account)
{
    // now the header is included, we can set the charset
    $GLOBALS['xajax']->setCharEncoding('utf-8');
    define('XAJAX_DEFAULT_CHAR_ENCODING', 'utf-8');
    $response = new xajaxResponse();
    $response->addScript("location.href='" . $GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php?cd=10' . "';");
    header('Content-type: text/xml; charset=' . 'utf-8');
    echo $response->getXML();
    $GLOBALS['phpgw']->common->phpgw_exit();
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:17,代码来源:xajax.php

示例13: chkPassword

function chkPassword($value)
{
    $mtview_controller = new MTViewController();
    $matchResult = $mtview_controller->xajaxObjCall($value, 'CPW', 'password');
    $objResponse = new xajaxResponse();
    if ($matchResult) {
        $objResponse->addScript("addUpdate();");
    } else {
        $objResponse->addAlert($GLOBALS['lang_Admin_Users_ErrorsPasswordMismatch']);
    }
    return $objResponse->getXML();
}
开发者ID:noikiy,项目名称:owaspbwa,代码行数:12,代码来源:changeusers.php

示例14: deleteEntry

 function deleteEntry($entry_id)
 {
     $CI =& get_instance();
     $CI->load->model('feedback_model');
     $xajax_response = new xajaxResponse();
     if (is_numeric($entry_id) && $CI->feedback_model->DeleteFeedback($entry_id)) {
         $xajax_response->addAssign('new_entries', 'innerHTML', $CI->feedback_model->GetFeedbackCount());
         $xajax_response->addAssign('deleted_entries', 'innerHTML', $CI->feedback_model->GetFeedbackCount(1));
         $xajax_response->addAssign('feedback' . $entry_id, 'innerHTML', 'DELETED!');
         $xajax_response->addScript('Effect.BlindUp(\'container' . $entry_id . '\');');
     } else {
         $xajax_response->addAlert('Error deleting entry ' . $entry_id . ', reload the page and try again.');
     }
     return $xajax_response;
 }
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:15,代码来源:feedback.php

示例15: array

 function _list()
 {
     $this->load->model('static_model');
     $list = $this->static_model->GetDirectoryListing($this->config->item('static_local_path') . '/podcasts', '', array('mp3'));
     $db_list = $this->podcasts_model->Get_Fnames();
     $arguments = '';
     foreach ($list as $fname) {
         if (!in_array($fname, $db_list)) {
             $arguments = $arguments . ',"' . str_replace(array('/', '\\'), '', $fname) . '"';
         }
     }
     $objResponse = new xajaxResponse();
     $objResponse->addScript('list_response(' . substr($arguments, 1) . ');');
     return $objResponse;
 }
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:15,代码来源:podcasts.php


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