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


PHP Page_Controller::CustomJS方法代码示例

本文整理汇总了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;
    }
开发者ID:helpfulrobot,项目名称:iqnection-pages-serviceareaspage,代码行数:17,代码来源:ServiceAreasPage.php

示例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;
 }
开发者ID:helpfulrobot,项目名称:iqnection-pages-basepages,代码行数:7,代码来源:FormPage.php

示例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;
    }
开发者ID:helpfulrobot,项目名称:iqnection-pages-locationspage,代码行数:14,代码来源:LocationsPage.php

示例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;
    }
开发者ID:helpfulrobot,项目名称:iqnection-pages-paypalstorepage,代码行数:23,代码来源:PaypalStorePage.php

示例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;
 }
开发者ID:helpfulrobot,项目名称:iqnection-pages-photogallerypage,代码行数:24,代码来源:AlbumPage.php


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