本文整理汇总了PHP中CommonFunctions::escapeForJavascript方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonFunctions::escapeForJavascript方法的具体用法?PHP CommonFunctions::escapeForJavascript怎么用?PHP CommonFunctions::escapeForJavascript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonFunctions
的用法示例。
在下文中一共展示了CommonFunctions::escapeForJavascript方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cmbFillerById
function cmbFillerById($objResponse, $fillArr, $fele, $form, $element, $defSel = -1)
{
if ($defSel == -1) {
$objResponse->addScript("document.getElementById('" . $element . "').options.length = 0;");
$objResponse->addScript("document.getElementById('" . $element . "').options[0] = new Option('--" . $this->defaultOption . "--','0');");
} else {
$objResponse->addScript("document.getElementById('" . $element . "').options.length = {$defSel};");
}
for ($i = 0; $fillArr && count($fillArr) > $i; $i++) {
$objResponse->addScript("document.getElementById('" . $element . "').options[" . ($defSel == 1 ? $i + 1 : $i) . "] = new Option('" . CommonFunctions::escapeForJavascript($fillArr[$i][$fele + 1]) . "','" . $fillArr[$i][$fele] . "');");
}
return $objResponse;
}
示例2: xajax_populateActivities
echo $row;
?>
]">
<td class="tableMiddleLeft"></td>
<td ><input type="checkbox" id="deleteEvent[]" name="deleteEvent[]" value="<?php
echo $timeExpense->getTimeEventId();
?>
" /></td>
<td ><select id="cmbProject[<?php
echo $row;
?>
]" name="cmbProject[]" onfocus="looseCurrFocus();" onchange="$('status').innerHTML='<?php
echo $lang_Common_Loading;
?>
...'; xajax_populateActivities(this.value, <?php
echo "{$row}, {$activityId}, '" . CommonFunctions::escapeForJavascript($activityName) . "'";
?>
);">
<option value="-1">--<?php
echo $lang_Leave_Common_Select;
?>
--</option>
<option selected value="<?php
echo $projectId;
?>
"><?php
echo "{$customerName} - {$projectName}";
?>
</option>
<?php
if (is_array($projects)) {
示例3:
errors.push('<?php
echo CommonFunctions::escapeForJavascript($lang_Time_Attendance_EnterValidDates);
?>
');
} else {
if (fromDateTimestamp >= toDateTimestamp) {
errors.push('<?php
echo CommonFunctions::escapeForJavascript($lang_Time_Attendance_EnterValidDateRange);
?>
');
}
}
if (errors.length > 0) {
message = '<?php
echo CommonFunctions::escapeForJavascript($lang_Error_PleaseCorrectTheFollowing);
?>
' + "\n";
for (i = 0; i < errors.length; i++) {
message += ' - ' + errors[i] + "\n";
}
alert(message);
return false;
}
return true;
}
//]]>
</script>
示例4: escapeForJavascript
/**
* @see CommonFunctions::escapeForJavascript
*/
function escapeForJavascript($string)
{
return CommonFunctions::escapeForJavascript($string);
}
示例5: escapeshellcmd
} else {
// If in the popup window, allow top level (company) to be selected as well.
if (isset($_GET['esp']) && $_GET['esp'] == 1) {
?>
<a class="title" href="#layerForm"
onclick="edit(<?php
echo $child[0]['dept_id'] == '' ? '\'\'' : '\'' . $child[0]['dept_id'] . '\'';
?>
,<?php
echo $child[0]['id'];
?>
, '<?php
echo escapeshellcmd($child[0]['title']);
?>
', '<?php
echo CommonFunctions::escapeForJavascript(escapeshellcmd($child[0]['description']));
?>
', '<?php
echo $child[0]['loc_code'];
?>
');"><?php
echo preg_replace('/' . $lang_compstruct_Other . '$|Other$/', '', $child[0]['title']);
?>
</a>
<?php
} else {
echo $child[0]['dept_id'] . " " . $child[0]['title'];
}
}
?>
示例6: popAndPrint
function popAndPrint() {
frames['printFrame'].document.getElementById("printArea").innerHTML=$('printPanel').innerHTML;
for (i=0; pages>i; i++) {
frames['printFrame'].document.getElementById("page"+(i+1)).style.display="block";
}
}
function init() {
if (pages == 0) {
$("loadingMessage").style.display="none";
<?php
$backButton = '<input type="button" class="backbutton" value="' . $lang_Common_Back . '"' . 'onmouseout="moutButton(this)" onmouseover="moverButton(this)" onclick="goBack()" />';
?>
$("printPanel").innerHTML = '<?php
echo "<br /><br/>" . CommonFunctions::escapeForJavascript($lang_Error_NoRecordsFound) . "<br /><br />{$backButton}";
?>
';
return false;
}
loadPage(1, false);
for (i=1; pages>i; i++) {
loadPage(i+1, true);
}
popup = new getObj('printFrame').obj;
}
function goBack() {
window.location=commonAction+"Select_Timesheets_View&cache=set";
}
示例7: array
$detailAction = "Leave_FetchDetailsSupervisor";
} else {
$action = "Leave_Request_CancelLeave";
$detailAction = "Leave_FetchDetailsEmployee";
}
$statusArr = array(Leave::LEAVE_STATUS_LEAVE_REJECTED => $lang_Leave_Common_Rejected, Leave::LEAVE_STATUS_LEAVE_CANCELLED => $lang_Leave_Common_Cancelled, Leave::LEAVE_STATUS_LEAVE_PENDING_APPROVAL => $lang_Leave_Common_PendingApproval, Leave::LEAVE_STATUS_LEAVE_APPROVED => $lang_Leave_Common_Approved, Leave::LEAVE_STATUS_LEAVE_TAKEN => $lang_Leave_Common_Taken, Leave::LEAVE_STATUS_LEAVE_WEEKEND => $lang_Leave_Common_Weekend, Leave::LEAVE_STATUS_LEAVE_HOLIDAY => $lang_Leave_Common_Holiday, LeaveRequests::LEAVEREQUESTS_MULTIPLESTATUSES => $lang_Leave_Common_StatusDiffer);
?>
<script type="text/javascript">
function validateLeaveRequestList() {
for (i = 0; i < noOfLeaveRecords; i++) {
if ($('txtComment_' + i).value.length > <?php
echo LeaveRequests::MAX_COMMENT_LENGTH;
?>
) {
alert('<?php
echo CommonFunctions::escapeForJavascript(sprintf($lang_Leave_LeaveCommentTooLong, LeaveRequests::MAX_COMMENT_LENGTH));
?>
');
$('txtComment_' + i).focus();
return false;
}
}
return true;
}
</script>
<?php
/* Show leave filter form only for admin */
if ($modifier === "ADMIN" || $modifier === "SUP") {
$refreshAction = $_GET['action'];
?>
<script type="text/javascript">
示例8:
projectSelect = '<select name="' + selectName + '" id="' + selectName + '"';
projectSelect += 'onchange="fetchActivities($s(\'' + selectName + '\').value, \'' + selectName + '\');"';
projectSelect += '>';
projectSelect += '<option value="-1">-- <?php
echo $lang_Time_Timesheet_SelectProject;
?>
--</option>';
<?php
for ($i = 0; $i < $projectsCount; $i++) {
?>
projectSelect += '<option value="<?php
echo $projectsList[$i]['id'];
?>
"><?php
echo CommonFunctions::escapeForJavascript($projectsList[$i]['name']);
?>
</option>';
<?php
}
?>
projectSelect += '</select>';
projectCell.innerHTML = projectSelect;
row.appendChild(projectCell);
/* Adding activities select box */
activityCell = document.createElement('td');
var activitySelect = document.createElement('select');
activitySelect.style.width= "125px";