當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。