本文整理汇总了PHP中Page_Controller::CustomJS方法的典型用法代码示例。如果您正苦于以下问题:PHP Page_Controller::CustomJS方法的具体用法?PHP Page_Controller::CustomJS怎么用?PHP Page_Controller::CustomJS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page_Controller
的用法示例。
在下文中一共展示了Page_Controller::CustomJS方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CustomJS
function CustomJS()
{
$js = parent::CustomJS();
if ($this->getPointer()->ServiceAreasLocations()->Count()) {
$Count = 1;
foreach ($this->getPointer()->ServiceAreasLocations() as $Location) {
$js .= '
address_objects[' . $Count . '-1] = {
"Title":"' . $Location->Title . '",
"Address":"' . $Location->Address . '",
"LatLng":[' . $Location->MapLatitude . ',' . $Location->MapLongitude . ']
};';
$Count++;
}
}
return $js;
}
示例2: CustomJS
function CustomJS()
{
$JS = parent::CustomJS();
$FormConfig = $this->FormConfig();
$JS .= "\n\$(document).ready(function(){\n\t\$(\"#Form_RenderForm\").validate({\n\t\t" . ($FormConfig['useNospam'] ? "useNospam: true," : null) . "\n\t});\n});\n\t\t\t";
return $JS;
}
示例3: CustomJS
function CustomJS()
{
$js = parent::CustomJS();
$js .= 'var MapType = "' . $this->MapType . '";
var address_objects = [];';
if ($locations = $this->Locations()) {
foreach ($locations as $key => $l) {
$js .= 'address_objects[' . $key . '] = {"Title":"' . $l->Title . '","Address":"' . $l->Address . '","LatLng":[' . $l->MapLatitude . ',' . $l->MapLongitude . ']};';
}
}
$js .= 'var Avgs = ' . $this->Avgs() . ';
var PageLink = "' . $this->Link() . '";';
return $js;
}
示例4: CustomJS
function CustomJS()
{
$JS = parent::CustomJS();
if (($PaypalStoreItems = $this->PaypalStoreItems()) && $PaypalStoreItems->Count()) {
$JS .= '$(document).ready(function(){';
foreach ($PaypalStoreItems as $PaypalStoreItem) {
if (($ProductOptions = $PaypalStoreItem->PaypalItemOptions()) && $ProductOptions->Count()) {
$JS .= '$("#' . $ProductOptions->First()->OptionID() . '").attr("checked", "checked");';
foreach ($ProductOptions as $ProductOption) {
$JS .= '
$("#' . $ProductOption->OptionID() . '").click(function(){
$("#showprice_' . $ProductOption->FormID() . '").html("$ ' . $ProductOption->Get_Price() . '");
$("#num_' . $ProductOption->FormID() . '").val("' . $ProductOption->Get_ItemID() . '");
$("#price_' . $ProductOption->FormID() . '").val("' . $ProductOption->Get_Price() . '");
});';
}
}
}
$JS .= '});';
}
$this->extend('updateCustomJS', $JS);
return $JS;
}
示例5: CustomJS
function CustomJS()
{
$js = parent::CustomJS();
if ($all_images = DataObject::get('AlbumPage_Image', 'AlbumPageID=' . $this->ID)) {
$first_id = false;
$js .= "var images = [";
$i = 0;
$total = count($all_images);
foreach ($all_images as $image) {
if ($i == 0) {
$first_id = $image->ID;
}
$js .= "'" . $image->GetBigURL() . "'";
if ($i + 1 < $total) {
$js .= ", ";
}
$i++;
}
$js .= "];";
$js .= "var first_id = " . $first_id . ";";
$js .= "var page_link = '" . $this->Link() . "';";
}
return $js;
}