當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PackageList::getHandle方法代碼示例

本文整理匯總了PHP中PackageList::getHandle方法的典型用法代碼示例。如果您正苦於以下問題:PHP PackageList::getHandle方法的具體用法?PHP PackageList::getHandle怎麽用?PHP PackageList::getHandle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PackageList的用法示例。


在下文中一共展示了PackageList::getHandle方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getIncludeFile

 protected function getIncludeFile($view)
 {
     $atHandle = $this->attributeType->getAttributeTypeHandle();
     if (file_exists(DIR_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $view . '.php')) {
         $file = DIR_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $view . '.php';
     }
     if (!isset($file) && $this->attributeType->getPackageID() > 0) {
         $pkgHandle = PackageList::getHandle($this->attributeType->getPackageID());
         $dirp = is_dir(DIR_PACKAGES . '/' . $pkgHandle) ? DIR_PACKAGES . '/' . $pkgHandle : DIR_PACKAGES_CORE . '/' . $pkgHandle;
         if (file_exists($dirp . '/' . DIRNAME_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $view . '.php')) {
             $file = $dirp . '/' . DIRNAME_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $view . '.php';
         }
     }
     if (!isset($file)) {
         if (file_exists(DIR_MODELS_CORE . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $view . '.php')) {
             $file = DIR_MODELS_CORE . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $view . '.php';
         }
     }
     return $file;
 }
開發者ID:Mihail9575,項目名稱:concrete5,代碼行數:20,代碼來源:view.php

示例2: getPackageHandle

 public function getPackageHandle()
 {
     return PackageList::getHandle($this->pkgID);
 }
開發者ID:VonUniGE,項目名稱:concrete5-1,代碼行數:4,代碼來源:set.php

示例3: mapAttributeTypeFilePath

	protected function mapAttributeTypeFilePath($_file) {
		$atHandle = $this->atHandle;
		if (file_exists(DIR_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $_file)) {
			$file = DIR_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' .  $atHandle . '/' . $_file;
			$url = BASE_URL . DIR_REL . '/' . DIRNAME_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' .  $atHandle . '/' . $_file;
		} else if ($_file == FILENAME_ATTRIBUTE_CONTROLLER && file_exists(DIR_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' .  DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '.php')) {
			$file = DIR_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' .  DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '.php';
		}
		
		$pkgID = $this->pkgID;
		if (!isset($file) && $pkgID > 0) {
			$pkgHandle = PackageList::getHandle($pkgID);
			$dirp = is_dir(DIR_PACKAGES . '/' . $pkgHandle) ? DIR_PACKAGES . '/' . $pkgHandle : DIR_PACKAGES_CORE . '/' . $pkgHandle;
			if (file_exists($dirp . '/' . DIRNAME_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' .  DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $_file)) {
				$file = $dirp . '/' . DIRNAME_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' .  DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $_file;
				$url = BASE_URL . DIR_REL . '/' .DIRNAME_PACKAGES. '/' .$pkgHandle . '/' . DIRNAME_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' .  $atHandle . '/' . $_file;
			} else if ($_file == FILENAME_ATTRIBUTE_CONTROLLER && file_exists($dirp . '/' . DIRNAME_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' .  DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '.php')) {
				$file = $dirp . '/' . DIRNAME_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' .  DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '.php';
			}
		}
		
		if (!isset($file)) {
			if (file_exists(DIR_MODELS_CORE . '/' . DIRNAME_ATTRIBUTES . '/' .  DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $_file)) {
				$file = DIR_MODELS_CORE . '/' . DIRNAME_ATTRIBUTES . '/' .  DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $_file;
				$url = ASSETS_URL . '/' . DIRNAME_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' .  $atHandle . '/' . $_file;
			} else if ($_file == FILENAME_ATTRIBUTE_CONTROLLER && file_exists(DIR_MODELS_CORE . '/' . DIRNAME_ATTRIBUTES . '/' .  DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '.php')) {
				$file = DIR_MODELS_CORE . '/' . DIRNAME_ATTRIBUTES . '/' .  DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '.php';
			}
		}
		
		if (isset($file)) {
			$obj = new stdClass;
			$obj->file = $file;
			$obj->url = $url;
			return $obj;
		} else {
			return false;
		}
	}
開發者ID:nbourguig,項目名稱:concrete5,代碼行數:39,代碼來源:type.php

示例4: getJobObjByHandle

 public static function getJobObjByHandle($jHandle = '', $jobData = array())
 {
     $jcl = Job::jobClassLocations();
     //check for the job file in the various locations
     $db = Loader::db();
     $pkgID = $db->GetOne('select pkgID from Jobs where jHandle = ?', $jHandle);
     if ($pkgID > 0) {
         $pkgHandle = PackageList::getHandle($pkgID);
         if ($pkgHandle) {
             $jcl[] = DIR_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_JOBS;
             $jcl[] = DIR_PACKAGES_CORE . '/' . $pkgHandle . '/' . DIRNAME_JOBS;
         }
     }
     foreach ($jcl as $jobClassLocation) {
         //load the file & class, then run the job
         $path = $jobClassLocation . '/' . $jHandle . '.php';
         if (file_exists($path)) {
             require_once $path;
             $className = Object::camelcase($jHandle);
             $j = new $className();
             $j->jHandle = $jHandle;
             if (intval($jobData['jID']) > 0) {
                 $j->jID = intval($jobData['jID']);
                 $j->jStatus = $jobData['jStatus'];
                 $j->jDateLastRun = $jobData['jDateLastRun'];
                 $j->jLastStatusText = $jobData['jLastStatusText'];
                 $j->pkgID = $jobData['pkgID'];
                 $j->jDateInstalled = $jobData['jDateInstalled'];
                 $j->jNotUninstallable = $jobData['jNotUninstallable'];
             }
             return $j;
         }
     }
     return NULL;
 }
開發者ID:ronlobo,項目名稱:concrete5-de,代碼行數:35,代碼來源:job.php

示例5: render

 /** 
  * Renders a particular view for an attribute
  */
 public function render($view, $return = false)
 {
     if ($return) {
         ob_start();
     }
     Loader::element(DIRNAME_ATTRIBUTES . '/' . $view . '_header', array('type' => $this->attributeType));
     $js = $this->attributeType->getAttributeTypeFileURL($view . '.js');
     $css = $this->attributeType->getAttributeTypeFileURL($view . '.css');
     $html = Loader::helper('html');
     if ($js != false) {
         $this->controller->addHeaderItem($html->javascript($js));
     }
     if ($css != false) {
         $this->controller->addHeaderItem($html->css($css));
     }
     $this->controller->setupAndRun($view);
     extract($this->controller->getSets());
     extract($this->controller->getHelperObjects());
     $atHandle = $this->attributeType->getAttributeTypeHandle();
     if (is_object($attributeKey)) {
         $this->controller->set('akID', $this->attributeKey->getAttributeKeyID());
     }
     if (file_exists(DIR_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $view . '.php')) {
         $file = DIR_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $view . '.php';
     }
     if (!isset($file) && $this->attributeType->getPackageID() > 0) {
         $pkgHandle = PackageList::getHandle($this->attributeType->getPackageID());
         $dirp = is_dir(DIR_PACKAGES . '/' . $pkgHandle) ? DIR_PACKAGES . '/' . $pkgHandle : DIR_PACKAGES_CORE . '/' . $pkgHandle;
         if (file_exists($dirp . '/' . DIRNAME_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $view . '.php')) {
             $file = $dirp . '/' . DIRNAME_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $view . '.php';
         }
     }
     if (!isset($file)) {
         if (file_exists(DIR_MODELS_CORE . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $view . '.php')) {
             $file = DIR_MODELS_CORE . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES . '/' . $atHandle . '/' . $view . '.php';
         }
     }
     if (isset($file)) {
         include $file;
     }
     Loader::element(DIRNAME_ATTRIBUTES . '/' . $view . '_footer', array('type' => $this->attributeType));
     if ($return) {
         $contents = ob_get_contents();
         ob_end_clean();
         return $contents;
     }
 }
開發者ID:homer6,項目名稱:concrete5-mirror,代碼行數:50,代碼來源:view.php

示例6: getJobObjByHandle

	public static function getJobObjByHandle( $jHandle='', $jobData=array() ){
		$jcl = Job::jobClassLocations();
		
		//check for the job file in the various locations
		$db = Loader::db();
		$pkgID = $db->GetOne('select pkgID from Jobs where jHandle = ?', $jHandle);
		if ($pkgID > 0) {
			$pkgHandle = PackageList::getHandle($pkgID);
			if ($pkgHandle) {
				
				$jcl[] = DIR_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_JOBS;
				$jcl[] = DIR_PACKAGES_CORE . '/' . $pkgHandle . '/' . DIRNAME_JOBS;
				
			}
		}

		foreach( $jcl as $jobClassLocation ){
			//load the file & class, then run the job
			$path=$jobClassLocation.'/'.$jHandle.'.php';	
			if( file_exists($path) ){ 
				require_once($path);
				$className=Object::camelcase( $jHandle );
				$j = new $className();
				$j->jHandle=$jHandle;
				if(intval($jobData['jID'])>0){
					$j->setPropertiesFromArray($jobData);
				}
				return $j;
			}
		}
		
		return NULL;
	}
開發者ID:ronlobo,項目名稱:concrete5,代碼行數:33,代碼來源:job.php

示例7: getPackageHandle

 /**
  * returns the handle of the BlockType's package if it's in a package
  * @return string
  */
 public function getPackageHandle()
 {
     if ($this->pkgHandle === null) {
         return PackageList::getHandle($this->pkgID);
     }
     return $this->pkgHandle;
 }
開發者ID:ojalehto,項目名稱:concrete5-legacy,代碼行數:11,代碼來源:block_types.php


注:本文中的PackageList::getHandle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。