本文整理汇总了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;
}
示例2: getPackageHandle
public function getPackageHandle()
{
return PackageList::getHandle($this->pkgID);
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}