本文整理汇总了PHP中xajaxResponse::addIncludeScript方法的典型用法代码示例。如果您正苦于以下问题:PHP xajaxResponse::addIncludeScript方法的具体用法?PHP xajaxResponse::addIncludeScript怎么用?PHP xajaxResponse::addIncludeScript使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xajaxResponse
的用法示例。
在下文中一共展示了xajaxResponse::addIncludeScript方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
//.........这里部分代码省略.........
$row = astercrm::getRecordByField('username', $extension, 'astercrm_account');
$objResponse->addScript("addOption('sltExten','" . $row['extension'] . "','{$extension}');");
}
$speeddial =& Customer::getAllSpeedDialRecords();
$speednumber['0']['number'] = $_SESSION['curuser']['extension'];
$speednumber['0']['description'] = $_SESSION['curuser']['username'];
$n = 1;
while ($speeddial->fetchInto($row)) {
// Change here by the name of fields of its database table
$speednumber[$n]['description'] = $row['description'];
$speednumber[$n]['number'] = $row['number'];
$n++;
}
$n = count($speednumber);
for ($i = 0; $i < $n; ++$i) {
$objResponse->addScript("addOption('iptDestNumber','" . $speednumber[$i]['number'] . "','" . $speednumber[$i]['description'] . "-" . $speednumber[$i]['number'] . "');");
}
$curmsg = Customer::getTicketInWork();
$panelHTML = '<a href=? onclick="showMyTickets(\'\',\'agent_tickets\');return false;">' . $locate->Translate("MyTickets") . "</a><span id='curticketMsg'>" . $curmsg . '</span><br/>';
if ($config['system']['display_recent_cdr'] == true && $_SESSION['curuser']['usertype'] == "agent") {
} else {
$panelHTML .= '<a href=? onclick="showRecentCdr(\'\',\'recent\');return false;">' . $locate->Translate("recentCDR") . '</a><br/>';
}
$panelHTML .= "<a href=? onclick=\"document.getElementById('dpnShow').value = 1;showDiallist('',0,0,5,'','','','formDiallistPannel','','');return false;\">" . $locate->Translate("My Diallist") . "</a><br/>";
//<span id=\"sptAddDiallist\" style=\"display:none\">
$panelHTML .= "<a href=? id=\"agentWorkstat\" name=\"agentWorkstat\" onclick=\"document.getElementById('awsShow').value = 1;agentWorkstat();return false;\">" . $locate->Translate("work stat") . "</a><br/>";
$panelHTML .= "<a href=? id=\"knowledge\" name=\"knowledge\" onclick=\"setKnowledge();return false;\">" . $locate->Translate("viewknowledge") . "</a><br/>";
$panelHTML .= '<a href=? id="sendSMS" name="sendSMS" onclick="SendSmsForm(\'' . $config['system']['enable_sms'] . '\');return false;">' . $locate->Translate("Send SMS") . '</a><br/>';
if (!empty($_SESSION['curuser']['privileges']) || $_SESSION['curuser']['usertype'] == "admin" || $_SESSION['curuser']['usertype'] == "groupadmin") {
$panelHTML .= '<a href=# onclick="this.href=\'managerportal.php\'">' . $locate->Translate("manager") . '</a><br/>';
}
$panelHTML .= "<a href='login.php'>" . $locate->Translate("logout") . "</a><br />";
$objResponse->addAssign("divPanel", "innerHTML", $panelHTML);
if ($config['system']['enable_external_crm'] == false) {
//use internal crm
$objResponse->addIncludeScript("js/astercrm.js");
$objResponse->addIncludeScript("js/ajax.js");
$objResponse->addIncludeScript("js/ajax-dynamic-list.js");
$objResponse->addScript("xajax_showGrid(0," . ROWSXPAGE . ",'','','')");
$objResponse->addAssign("divSearchContact", "style.visibility", "visible");
} else {
$objResponse->addIncludeScript("js/extercrm.js");
if ($config['system']['open_new_window'] == 'internal') {
$mycrm = '<iframe id="mycrm" name="mycrm" src="' . $config['system']['external_crm_default_url'] . '?curid=0" width="100%" frameBorder=0 scrolling=auto height="600"></iframe>';
$objResponse->addAssign("divCrm", "innerHTML", $mycrm);
} else {
if ($config['system']['open_new_window'] == 'external') {
//$mycrm = '<iframe id="mycrm" name="mycrm" src="'.$config['system']['external_crm_default_url'].'?curid=0" width="100%" frameBorder=0 scrolling=auto height="600"></iframe>';
//$objResponse->addAssign("divCrm","innerHTML", $mycrm );
$mycrm = '<form id="external_crm_form" action="' . $config['system']['external_crm_default_url'] . '?curid=0" target="mycrm" method="post"></form>';
$objResponse->addAssign("external_crm_openNewDiv", "innerHTML", $mycrm);
$objResponse->addScript('document.getElementById("external_crm_form").submit();');
} else {
$mycrm = '<form id="external_crm_form" action="' . $config['system']['external_crm_default_url'] . '?curid=0" target="mycrm" method="post"></form>';
$objResponse->addAssign("external_crm_openNewDiv", "innerHTML", $mycrm);
$objResponse->addScript('document.getElementById("external_crm_form").submit();');
$mycrm = '<iframe id="mycrm" name="mycrm" src="' . $config['system']['external_crm_default_url'] . '?curid=0" width="100%" frameBorder=0 scrolling=auto height="600"></iframe>';
$objResponse->addAssign("divCrm", "innerHTML", $mycrm);
}
}
/*if ($config['system']['open_new_window'] == false){
$mycrm = '<iframe id="mycrm" name="mycrm" src="'.$config['system']['external_crm_default_url'].'?curid=0" width="100%" frameBorder=0 scrolling=auto height="600"></iframe>';
$objResponse->addAssign("divCrm","innerHTML", $mycrm );
}else{
$mycrm = '<iframe id="mycrm" name="mycrm" src="'.$config['system']['external_crm_default_url'].'?curid=0" width="100%" frameBorder=0 scrolling=auto height="600"></iframe>';
$objResponse->addAssign("divCrm","innerHTML", $mycrm );
$javascript = "openwindow('".$config['system']['external_crm_default_url']."?curid=0')";
$objResponse->addScript("document.getElementById('external_crm_form').submit();");
}*/
}
$monitorstatus = astercrm::getRecordByID($_SESSION['curuser']['groupid'], 'astercrm_accountgroup');
if ($monitorstatus['monitorforce']) {
$objResponse->addAssign("chkMonitor", "checked", 'true');
$objResponse->addAssign("chkMonitor", "style.visibility", 'hidden');
$objResponse->addAssign("btnMonitor", "disabled", 'true');
}
$objResponse->addAssign("clear_popup", "value", $monitorstatus['clear_popup']);
//for clear popup after ($clear_popup) seconds
$objResponse->addScript("clearSettimePopup();");
if ($_SESSION['curuser']['group']['allowloginqueue'] == 'yes' && is_array($_SESSION['curuser']['campaign_queue'])) {
//print_r($_SESSION['curuser']['campaign_queue']);exit;
$objResponse->addScript("getMsgInCampaign();");
} else {
$objResponse->addAssign("divGetMsgInCampaignP", "style.visibility", 'hidden');
}
//if enabled monitor by astercctools
$configstatus = Common::read_ini_file($config['system']['astercc_path'] . '/astercc.conf', $asterccConfig);
if ($configstatus == -2) {
$objResponse->addAlert("fail to read " . $config['system']['astercc_path'] . '/astercc.conf');
} else {
if ($asterccConfig['system']['force_record'] == 1) {
//echo $asterccConfig['system']['force_record'];exit;
$objResponse->addAssign("chkMonitor", "checked", false);
$objResponse->addAssign("chkMonitor", "style.visibility", 'hidden');
$objResponse->addAssign("btnMonitor", "disabled", 'true');
}
}
return $objResponse;
}
示例2: ws_display
function ws_display($window_name, $form = '')
{
global $conf, $self, $ona;
global $images, $color, $style;
$html = '';
$js = '';
// If the user supplied an array in a string, build the array and store it in $form
$form = parse_options_string($form);
// Build $ip from $form['ip_block_start']
$form['ip_block_start'] = ip_complete($form['ip_block_start'], '0');
// Since we currently only display /24 (C) class networks, the
//GD Need to call ip_mangle() so we can use is_ipv4()
// last quad needs to be a .0.
$ip = ip_mangle($form['ip_block_start'], 'numeric');
if (is_ipv4($ip)) {
$end = '\\.\\d+$';
$replace_end_by = '.0';
$version = 4;
} else {
$end = ':[0-9A-F]{0,4}$';
// $replace_end_by = ':0000';
$replace_end_by = ':';
$version = 6;
}
$ip = $form['ip_block_start'] = preg_replace("/{$end}/", $replace_end_by, $form['ip_block_start']);
// Find out if $ip is valid
$ip = ip_mangle($ip, 'numeric');
if ($ip == -1) {
$js .= "alert('The IP address specified is invalid!');";
}
// Update History Title
$history = array_pop($_SESSION['ona']['work_space']['history']);
$js .= "xajax_window_submit('work_space', ' ', 'rewrite_history');";
if ($history['title'] == $window_name) {
$history['title'] = 'Map: ' . ip_mangle($ip, 'dotted');
array_push($_SESSION['ona']['work_space']['history'], $history);
}
// Create some javascript to refresh the current page
$refresh = htmlentities(str_replace(array("'", '"'), array("\\'", '\\"'), $history['url']), ENT_QUOTES, $conf['php_charset']);
$refresh = "xajax_window_submit('work_space', '{$refresh}');";
// Define the window's inner html
$html .= <<<EOL
<div id="{$window_name}_content" style="padding: 2px 4px;">
<form id="block_search_form" onsubmit="el('zoom_block_button').onclick(); return false;">
<div id="{$window_name}_tools">
<b>IP Address</b>
<input type="hidden" id="{$window_name}_zoom" name="zoom" value="8">
<input id="{$window_name}_ip_block_start" name="{$window_name}_ip_block_start" value="{$form['ip_block_start']}" class="edit" type="text" size="15" />
<a id="zoom_block_button" title="Zoom block"
class="act"
onClick="xajax_window_submit('work_space', 'xajax_window_submit(\\'{$window_name}\\', \\'ip_block_start=>' + el('{$window_name}_ip_block_start').value + ',zoom=>' + el('{$window_name}_zoom').value + '\\', \\'display\\');');"
><img src="{$images}/silk/bullet_go.png" border="0"></a>
<br><br>
</div>
</form>
<div id="{$window_name}_portal">
<span id="{$window_name}_substrate"></span>
</div>
</div>
EOL;
// Position/size the portal ourselves
$js .= <<<EOL
var _el = el('{$window_name}_portal');
/* Now calculate where we will sit */
var my_height = el('work_space_content').offsetHeight - el('{$window_name}_tools').offsetHeight - 40;
var my_width = el('{$window_name}_tools').offsetWidth - 10;
/* Finally reposition/resize the window */
_el.style.position = 'relative';
_el.style.height = my_height + 'px';
EOL;
// Get javascript to setup the map portal
$js .= get_portal_js($window_name, $ip, $version);
//*** Send a fake mouseup event to draw the initial map view ***
$js .= "el('{$window_name}_portal').myonmouseup('fake event');";
// Insert the new html into the window
// Instantiate the xajaxResponse object
$response = new xajaxResponse();
// GDO need to use Big Int JS
$response->addIncludeScript('include/js/bignumber.js');
$response->addAssign("work_space_content", "innerHTML", $html);
if ($js) {
$response->addScript($js);
}
return $response->getXML();
}
示例3: includeScript
function includeScript($sFilename)
{
$objResponse = new xajaxResponse();
$objResponse->addIncludeScript($sFilename);
return $objResponse->getXML();
}
示例4: init
/**
* init page
* @return object xajax response object
*/
function init($username = "", $passwd = "", $lang = 'en_US')
{
global $config, $db;
//echo $username.$passwd.$lang;exit;
//if($_SESSION['curuser']['username'] != $username){
$row = astercrm::getRecordByField("username", $username, "astercrm_account");
if ($row['id'] != '') {
if (md5($row['password']) == $passwd) {
$_SESSION = array();
$_SESSION['curuser']['username'] = trim($username);
$_SESSION['curuser']['extension'] = $row['extension'];
$_SESSION['curuser']['usertype'] = $row['usertype'];
$_SESSION['curuser']['accountcode'] = $row['accountcode'];
$_SESSION['curuser']['agent'] = $row['agent'];
$_SESSION['curuser']['extensions'] = array();
// added by solo 2007-10-90
$_SESSION['curuser']['channel'] = $row['channel'];
$_SESSION['curuser']['groupid'] = $row['groupid'];
if ($row['extensions'] != '') {
$_SESSION['curuser']['extensions'] = split(',', $row['extensions']);
}
}
}
//}
//echo $lang;exit;
list($_SESSION['curuser']['country'], $_SESSION['curuser']['language']) = split("_", $lang);
//echo $_SESSION['curuser']['language'];exit;
$locate = new Localization($_SESSION['curuser']['country'], $_SESSION['curuser']['language'], 'portal');
//echo $locate->Translate("Search");exit;
$objResponse = new xajaxResponse();
$objResponse->addAssign("username", "value", $_SESSION['curuser']['username']);
$objResponse->addAssign("extension", "value", $_SESSION['curuser']['extension']);
$objResponse->addAssign("myevents", "innerHTML", $locate->Translate("extension") . $_SESSION['curuser']['extension'] . "-" . $locate->Translate("waiting"));
$objResponse->addAssign("btnShowPortal", "value", $locate->Translate("portal"));
$objResponse->addAssign("btnTransfer", "value", $locate->Translate("Transfer"));
$objResponse->addAssign("btnSearchContact", "value", $locate->Translate("Search"));
$objResponse->addAssign("spanMonitor", "innerHTML", $locate->Translate("monitor"));
$objResponse->addAssign("extensionStatus", "value", 'idle');
$objResponse->addAssign("spanMonitorStatus", "innerHTML", $locate->Translate("idle"));
$objResponse->addAssign("btnMonitorStatus", "value", "idle");
$objResponse->addAssign("btnMonitor", "value", $locate->Translate("start_record"));
$objResponse->addAssign("btnMonitor", "disabled", true);
$objResponse->addAssign("btnCallCtrl", "value", $locate->Translate("Dial"));
$objResponse->addAssign("btnTransfer", "disabled", true);
foreach ($_SESSION['curuser']['extensions'] as $extension) {
$extension = trim($extension);
$row = astercrm::getRecordByField('username', $extension, 'astercrm_account');
$objResponse->addScript("addOption('sltExten','" . $row['extension'] . "','{$extension}');");
}
$speeddial =& astercrm::getAllSpeedDialRecords();
$speednumber['0']['number'] = $_SESSION['curuser']['extension'];
$speednumber['0']['description'] = $_SESSION['curuser']['username'];
$n = 1;
while ($speeddial->fetchInto($row)) {
// Change here by the name of fields of its database table
$speednumber[$n]['description'] = $row['description'];
$speednumber[$n]['number'] = $row['number'];
$n++;
}
$n = count($speednumber);
for ($i = 0; $i < $n; ++$i) {
$objResponse->addScript("addOption('iptDestNumber','" . $speednumber[$i]['number'] . "','" . $speednumber[$i]['description'] . "');");
}
$panelHTML = '<a href=? onclick="xajax_showRecentCdr(\'\',\'recent\');return false;">' . $locate->Translate("recentCDR") . '</a> ';
if ($_SESSION['curuser']['usertype'] != "agent") {
$panelHTML .= '<a href=# onclick="this.href=\'managerportal.php\'">' . $locate->Translate("manager") . '</a> ';
}
if ($config['system']['enable_external_crm'] == false) {
//use internal crm
$objResponse->addIncludeScript("js/astercrm.js");
$objResponse->addIncludeScript("js/ajax.js");
$objResponse->addIncludeScript("js/ajax-dynamic-list.js");
$objResponse->addAssign("divSearchContact", "style.visibility", "visible");
} else {
$objResponse->addIncludeScript("js/extercrm.js");
if ($config['system']['open_new_window'] == false) {
$mycrm = '<iframe id="mycrm" name="mycrm" src="' . $config['system']['external_crm_default_url'] . '" width="100%" frameBorder=0 scrolling=auto height="100%"></iframe>';
$objResponse->addAssign("divCrm", "innerHTML", $mycrm);
} else {
$javascript = "openwindow('" . $config['system']['external_crm_default_url'] . "')";
$objResponse->addScript($javascript);
}
}
$monitorstatus = astercrm::getRecordByID($_SESSION['curuser']['groupid'], 'astercrm_accountgroup');
if ($monitorstatus['monitorforce']) {
$objResponse->addAssign("chkMonitor", "checked", 'true');
$objResponse->addAssign("chkMonitor", "style.visibility", 'hidden');
$objResponse->addAssign("btnMonitor", "disabled", 'true');
}
$objResponse->addAssign("divSearchContact", "style.visibility", "visible");
//if enabled monitor by astercctools
Common::read_ini_file($config['system']['astercc_path'] . '/astercc.conf', $asterccConfig);
if ($asterccConfig['system']['force_record'] == 1) {
$objResponse->addAssign("chkMonitor", "checked", 'false');
$objResponse->addAssign("chkMonitor", "style.visibility", 'hidden');
$objResponse->addAssign("btnMonitor", "disabled", 'true');
//.........这里部分代码省略.........
示例5: ws_display
//.........这里部分代码省略.........
//*** Send a fake mouseup event to draw the initial map view ***
$portal_js .= "el('{$window_name}_portal').myonmouseup('fake event');";
// END SMALL SUBNET MAP
$html .= <<<EOL
<!-- END OF SECOND COLUMN OF SMALL BOXES -->
</td>
<!-- START OF THIRD COLUMN OF SMALL BOXES -->
<td valign="top" style="padding-right: 15px;">
EOL;
$html .= <<<EOL
</td>
<!-- END OF THIRD COLUMN OF SMALL BOXES -->
</tr></table>
</div>
<!-- END OF TOP SECTION -->
EOL;
// SUBNET LIST
$tab = 'subnets';
$submit_window = "list_{$tab}";
$form_id = "{$submit_window}_filter_form";
$_SESSION['ona'][$form_id]['tab'] = $tab;
$content_id = "{$window_name}_{$submit_window}";
$html .= <<<EOL
<!-- SUBNET LIST -->
<div style="border: 1px solid {$color['border']}; margin: 10px 20px;">
<!-- Tab & Quick Filter -->
<table id="{$form_id}_table" cellspacing="0" border="0" cellpadding="0">
<tr>
<td id="{$form_id}_subnets_tab" class="table-tab-active">
Associated {$tab} <span id="{$form_id}_{$tab}_count"></span>
</td>
<td id="{$form_id}_quick_filter" class="padding" align="right" width="100%">
<form id="{$form_id}" onSubmit="return false;">
<input id="{$form_id}_page" name="page" value="1" type="hidden">
<input name="content_id" value="{$content_id}" type="hidden">
<input name="form_id" value="{$form_id}" type="hidden">
<input name="ip_subnet" value="{$record['ip_addr_start']}" type="hidden">
<input name="ip_subnet_thru" value="{$record['ip_addr_end']}" type="hidden">
<div id="{$form_id}_filter_overlay"
title="Filter"
style="position: relative;
display: inline;
color: #CACACA;
cursor: text;"
onClick="this.style.display = 'none'; el('{$form_id}_filter').focus();"
>Name</div>
<input
id="{$form_id}_filter"
name="filter"
class="filter"
type="text"
value=""
size="10"
maxlength="20"
alt="Quick Filter"
onFocus="el('{$form_id}_filter_overlay').style.display = 'none';"
onBlur="if (this.value == '') el('{$form_id}_filter_overlay').style.display = 'inline';"
onKeyUp="
if (typeof(timer) != 'undefined') clearTimeout(timer);
code = 'if ({$form_id}_last_search != el(\\'{$form_id}_filter\\').value) {' +
' {$form_id}_last_search = el(\\'{$form_id}_filter\\').value;' +
' document.getElementById(\\'{$form_id}_page\\').value = 1;' +
' xajax_window_submit(\\'{$submit_window}\\', xajax.getFormValues(\\'{$form_id}\\'), \\'display_list\\');' +
'}';
timer = setTimeout(code, 700);"
>
</form>
</td>
</tr>
</table>
<div id='{$content_id}'>
{$conf['loading_icon']}
</div>
</div>
EOL;
$js .= <<<EOL
/* Setup the quick filter */
el('{$form_id}_filter_overlay').style.left = (el('{$form_id}_filter_overlay').offsetWidth + 10) + 'px';
{$form_id}_last_search = '';
/* Tell the browser to load/display the list */
xajax_window_submit('{$submit_window}', xajax.getFormValues('{$form_id}'), 'display_list');
EOL;
// Insert the new html into the window
// Instantiate the xajaxResponse object
$response = new xajaxResponse();
// GDO need to use Big Int JS
$response->addIncludeScript('include/js/bignumber.js');
$response->addAssign("work_space_content", "innerHTML", $html);
if ($js) {
$response->addScript($js . $portal_js);
}
return $response->getXML();
}