本文整理汇总了PHP中CJavaScript::quote方法的典型用法代码示例。如果您正苦于以下问题:PHP CJavaScript::quote方法的具体用法?PHP CJavaScript::quote怎么用?PHP CJavaScript::quote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CJavaScript
的用法示例。
在下文中一共展示了CJavaScript::quote方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addMarker
public static function addMarker($model, $inMarker, $draggable = 'false')
{
if (!$model) {
return false;
}
if ($model->lat && $model->lng) {
self::$jsCode .= '
var latLng' . $model->id . ' = new google.maps.LatLng(' . $model->lat . ', ' . $model->lng . ');
latLngList.push(latLng' . $model->id . ');
markersGMap[' . $model->id . '] = new google.maps.Marker({
position: latLng' . $model->id . ',
title: "' . CJavaScript::quote($model->getStrByLang('title')) . '",
icon: "' . $model->getMapIconUrl() . '",
map: mapGMap,
draggable: ' . $draggable . '
});
markersForClasterGMap.push(markersGMap[' . $model->id . ']);
infoWindowsGMap[' . $model->id . '] = new google.maps.InfoWindow({
content: "' . CJavaScript::quote($inMarker) . '"
});
google.maps.event.addListener(markersGMap[' . $model->id . '], "click", function() {
infoWindowsGMap[' . $model->id . '].open(mapGMap, markersGMap[' . $model->id . ']);
});
';
}
}
示例2: getLinkString
/**
* @param string $attributeString
* @return string
*/
public function getLinkString($attributeString)
{
$url = Yii::app()->createUrl("calendars/default/addSubsriptionForCalendar");
$errorInProcess = CJavaScript::quote(Zurmo::t('Core', 'There was an error processing your request'));
$string = 'ZurmoHtml::link(';
$string .= $attributeString . ', ';
$string .= '"javascript:addCalendarRowToSharedCalendarListView(\'$data->id\', \'' . $url . '\', \'' . $this->uniqueLayoutId . '\', \'' . $errorInProcess . '\')"';
$string .= ')';
return $string;
}
示例3: getLinkString
/**
* @param string $attributeString
* @return string
*/
public function getLinkString($attributeString)
{
$url = Yii::app()->createUrl("opportunityProducts/default/addOpportunityRelation", array('relationModuleId' => $this->relationModuleId, 'portletId' => $this->portletId, 'uniqueLayoutId' => $this->uniqueLayoutId));
$errorInProcess = CJavaScript::quote(Zurmo::t('Core', 'There was an error processing your request'));
$string = 'ZurmoHtml::link(';
$string .= $attributeString . ', ';
$string .= '"javascript:addProductRowToPortletGridView(\'$data->id\', \'' . $url . '\', \'' . $this->relationAttributeName . '\', \'' . $this->relationModelId . '\'
, \'' . $this->uniqueLayoutId . '\', \'' . $errorInProcess . '\')"';
$string .= ')';
return $string;
}
开发者ID:RamaKavanan,项目名称:BaseVersion,代码行数:15,代码来源:OpportunityProductTemplateSelectFromRelatedListModalListLinkProvider.php
示例4: addMarker
public static function addMarker($model, $inMarker, $draggable = 'false')
{
if (!$model) {
return false;
}
if ($model->lat && $model->lng) {
self::$jsCode .= '
var latLng' . $model->id . ' = new google.maps.LatLng(' . $model->lat . ', ' . $model->lng . ');
//final position for marker, could be updated if another marker already exists in same position
var finalLatLng' . $model->id . ' = latLng' . $model->id . ';
//check to see if any of the existing markers match the latlng of the new marker
if (markersForClasterGMap.length != 0) {
for (i=0; i < markersForClasterGMap.length; i++) {
var existingMarker = markersForClasterGMap[i];
var pos = existingMarker.getPosition();
//if a marker already exists in the same position as this marker
if (latLng' . $model->id . '.equals(pos)) {
//update the position of the coincident marker by applying a small multipler to its coordinates
var newLat = latLng' . $model->id . '.lat() + ((Math.random() -.4) / 6500);
var newLng = latLng' . $model->id . '.lng() + ((Math.random() -.4) / 6500);
finalLatLng' . $model->id . ' = new google.maps.LatLng(newLat, newLng);
}
}
}
latLngList.push(finalLatLng' . $model->id . ');
markersGMap[' . $model->id . '] = new google.maps.Marker({
position: finalLatLng' . $model->id . ',
title: "' . CJavaScript::quote($model->getStrByLang('title')) . '",
icon: "' . $model->getMapIconUrl() . '",
map: mapGMap,
draggable: ' . $draggable . '
});
markersForClasterGMap.push(markersGMap[' . $model->id . ']);
infoWindowsGMap[' . $model->id . '] = new google.maps.InfoWindow({
content: "' . CJavaScript::quote($inMarker) . '"
});
google.maps.event.addListener(markersGMap[' . $model->id . '], "click", function() {
infoWindowsGMap[' . $model->id . '].open(mapGMap, markersGMap[' . $model->id . ']);
});
';
}
}
示例5: renderBeforeTableContent
protected function renderBeforeTableContent()
{
$dropDownContent = ZurmoHtml::dropDownList('attributeTypeName', null, $this->getValueTypeDropDownArray());
$linkContent = static::renderConfigureLinkContent(null, 'attributeTypeNameButton');
$url = Yii::app()->createUrl($this->moduleId . '/' . $this->controllerId . '/attributeEdit/', array('moduleClassName' => $this->moduleClassName));
Yii::app()->clientScript->registerScript('attributeTypeCreateLink', "\n \$('#attributeTypeNameButton').click( function()\n {\n if (\$('#attributeTypeName').val() == '')\n {\n alert('" . CJavaScript::quote(Zurmo::t('DesignerModule', 'You must first select a field type')) . "');\n }\n else\n {\n window.location = '" . $url . "&attributeTypeName=' + \$('#attributeTypeName').val();\n }\n }\n );");
DropDownUtil::registerScripts();
$content = null;
$content .= '<div class="add-custom-field">';
$content .= '<h1>' . Zurmo::t('DesignerModule', 'Create Field') . '</h1>';
$content .= '<div class="panel-buffer"><div>' . $dropDownContent . '</div>' . $linkContent . '</div>';
$content .= '</div>';
return $content;
}
示例6: registerUnifiedEventHander
protected function registerUnifiedEventHander()
{
if (Yii::app()->clientScript->isScriptRegistered(static::JS_HANDLER_ID)) {
return;
} else {
$unlinkConfirmMessage = CJavaScript::quote($this->getUnlinkTranslatedMessage());
$errorMessage = CJavaScript::quote(Zurmo::t('Core', 'There was an error processing your request'));
// Begin Not Coding Standard
Yii::app()->clientScript->registerScript(static::JS_HANDLER_ID, '
$("a.' . static::LINK_ACTION_ELEMENT_CLASS . '").unbind("click.action").bind("click.action", function(event)
{
linkUrl = $(this).attr("href");
linkId = $(this).attr("id");
refreshGrid = false;
if (linkId.indexOf("delete") !== -1 && !$(this).onAjaxSubmitRelatedListAction("' . $unlinkConfirmMessage . '", "' . $this->getGridId() . '"))
{
refreshMembersListGridView("' . $this->getGridId() . '");
}
else
{
$.ajax({
"error" : function(xhr, textStatus, errorThrown)
{
alert("' . $errorMessage . '");
},
"success" : function()
{
refreshMembersListGridView("' . $this->getGridId() . '");
},
"url" : linkUrl,
"cache" : false
});
}
event.preventDefault();
return false;
}
);
');
// End Not Coding Standard
}
}
示例7: processFireBugLogEntry
/**
* @param $level
* @param $time
* @param $category
* @param $content
* @param null $groupName
* @param bool $forced
*
* @return null
*/
public static function processFireBugLogEntry($level, $time, $category, $content, $groupName = null, $forced = false)
{
$time = date('H:i:s.', $time) . sprintf('%03d', (int) (($time - (int) $time) * 1000));
if ($level === LogLevel::Warning) {
$func = 'warn';
} else {
if ($level === LogLevel::Error) {
$func = 'error';
} else {
$func = 'log';
}
}
if ($groupName !== null) {
echo "\tconsole.groupCollapsed(\"{$groupName}\");\n";
}
$content = \CJavaScript::quote("[{$time}][{$level}][{$category}]" . ($forced ? "[Forced]" : "") . "\n{$content}");
echo "\tconsole.{$func}(\"{$content}\");\n";
if ($groupName !== null) {
echo "\tconsole.groupEnd();\n";
}
}
示例8: addMarker
public static function addMarker($model, $inMarker, $draggable = 'false')
{
if (!$model) {
return false;
}
if ($model->lat && $model->lng) {
self::setIconType($model);
self::$jsCode .= '
var markerIcon = L.icon({
iconUrl: "' . self::$icon['href'] . '",
iconSize: [' . self::$icon['size']['x'] . ', ' . self::$icon['size']['y'] . '],
className : "marker-icon-class"
});
markersOSMap[' . $model->id . '] = L.marker([' . $model->lat . ', ' . $model->lng . '], {icon: markerIcon, draggable : ' . $draggable . '})
.addTo(mapOSMap)
.bindPopup("' . CJavaScript::quote($inMarker) . '");
latLngList.push([' . $model->lat . ', ' . $model->lng . ']);
markersForClasterOSMap.push(markersOSMap[' . $model->id . ']);
';
}
}
示例9: registerUnifiedEventHander
protected function registerUnifiedEventHander()
{
if (Yii::app()->clientScript->isScriptRegistered('marketingListMemberLinkActionElementEventHandler')) {
return;
} else {
$unlinkConfirmMessage = CJavaScript::quote(Zurmo::t('MarketingListsModule', 'Are you sure you want to unlink this record?'));
$errorMessage = CJavaScript::quote(Zurmo::t('Core', 'There was an error processing your request'));
// Begin Not Coding Standard
Yii::app()->clientScript->registerScript('marketingListMemberLinkActionElementEventHandler', '
$("a.' . static::LINK_ACTION_ELEMENT_CLASS . '").unbind("click.action").bind("click.action", function(event)
{
linkUrl = $(this).attr("href");
linkId = $(this).attr("id");
if (linkId.indexOf("delete") !== -1 && !onAjaxSubmitRelatedListAction("' . $unlinkConfirmMessage . '", "' . $this->getGridId() . '"))
{
event.preventDefault();
}
$.ajax({
"error" : function(xhr, textStatus, errorThrown)
{
alert("' . $errorMessage . '");
},
"success" : function()
{
$("#" + linkId).closest(".items").parent().find(".pager").find(".refresh").find("a").click();
},
"url" : linkUrl,
"cache" : false
});
event.preventDefault();
}
);
');
// End Not Coding Standard
}
}
示例10:
?>
",
"allowScriptAccess","<?php
echo $this->allowScriptAccess;
?>
",
"allowFullScreen","<?php
echo $this->allowFullScreen;
?>
",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else { // flash is too old or we can't detect the plugin
var alternateContent = '<?php
echo CJavaScript::quote($this->altHtmlContent);
?>
';
document.write(alternateContent); // insert non-flash content
}
/*]]>*/
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="<?php
echo $this->name;
?>
"
width="<?php
echo $this->width;
?>
示例11: getFlashVarsAsString
/**
* Generates the properly quoted flash parameter string.
* @return string the flash parameter string.
*/
public function getFlashVarsAsString()
{
$params = array();
foreach ($this->flashVars as $k => $v) {
$params[] = urlencode($k) . '=' . urlencode($v);
}
return CJavaScript::quote(implode('&', $params));
}
示例12: encode
private static function encode($value)
{
if (is_string($value)) {
if (strpos($value, 'js:') === 0) {
return substr($value, 3);
}
if (strpos($value, '{') === 0) {
return $value;
} else {
return "'" . CJavaScript::quote($value) . "'";
}
} else {
if ($value === null) {
return 'null';
} else {
if (is_bool($value)) {
return $value ? 'true' : 'false';
} else {
if (is_integer($value)) {
return "{$value}";
} else {
if (is_float($value)) {
if ($value === -INF) {
return 'Number.NEGATIVE_INFINITY';
} else {
if ($value === INF) {
return 'Number.POSITIVE_INFINITY';
} else {
return rtrim(sprintf('%.16F', $value), '0');
}
}
// locale-independent representation
} else {
if (is_object($value)) {
return self::encode(get_object_vars($value));
} else {
if (is_array($value)) {
$es = array();
if (($n = count($value)) > 0 && array_keys($value) !== range(0, $n - 1)) {
foreach ($value as $k => $v) {
$es[] = "'" . CJavaScript::quote($k) . "':" . self::encode($v);
}
return '{' . implode(',', $es) . '}';
} else {
foreach ($value as $v) {
$es[] = self::encode($v);
}
return '[' . implode(',', $es) . ']';
}
} else {
return '';
}
}
}
}
}
}
}
}
示例13: getAjaxBeforeSendOptionForModalLinkContent
public static function getAjaxBeforeSendOptionForModalLinkContent($title, $containerId = 'modalContainer', $height = 'auto', $width = 600, $position = 'center top+25', $class = "''", $extraCloseScript = null)
{
assert('is_string($containerId)');
assert('is_string($title)');
assert('$height == "auto" || is_int($height)');
assert('is_int($width)');
assert('is_string($position) || is_array($position)');
assert('is_string($class) || $class == null');
assert('is_string($extraCloseScript) || $extraCloseScript == null');
if ($height == 'auto') {
$heightContent = "'auto'";
} else {
$heightContent = $height;
}
if (is_array($position)) {
$position = CJSON::encode($position);
} else {
$position = "'" . $position . "'";
}
$modalTitle = CJavaScript::quote($title);
// Begin Not Coding Standard
return "js:function(){\n jQuery('#{$containerId}').html('');\n \$(this).makeLargeLoadingSpinner(true, '#{$containerId}');\n //window.scrollTo(0, 0);\n jQuery('#{$containerId}').dialog({\n 'title' : '{$modalTitle}',\n 'autoOpen' : true,\n 'modal' : true,\n 'position' : {$position},\n 'dialogClass' : {$class},\n 'height' : {$heightContent},\n 'open': function( event, ui ) { jQuery('#{$containerId}').parent().addClass('openingModal'); },\n 'close': function( event, ui ) { jQuery('#{$containerId}').parent().removeClass('openingModal');\n \$('#{$containerId}').dialog('destroy');\n " . $extraCloseScript . "\n }\n });\n return true;\n }";
// End Not Coding Standard
}
示例14: resolveSuccessMessage
protected static function resolveSuccessMessage()
{
return CJavaScript::quote(Zurmo::t('CampaignsModule', 'Campaign status was changed.'));
}
示例15: getAjaxLinkOptions
protected function getAjaxLinkOptions()
{
return array('error' => 'function(xhr, textStatus, errorThrown) {alert("' . CJavaScript::quote(Zurmo::t('Core', 'There was an error processing your request')) . '");}', 'success' => "js:function(){\$('#" . $this->getLinkId() . "').closest('.items').parent()\n .find('.pager').find('.refresh').find('a').click();}");
}