当前位置: 首页>>代码示例>>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;未经允许,请勿转载。