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


PHP Package::getByID方法代码示例

本文整理汇总了PHP中Package::getByID方法的典型用法代码示例。如果您正苦于以下问题:PHP Package::getByID方法的具体用法?PHP Package::getByID怎么用?PHP Package::getByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Package的用法示例。


在下文中一共展示了Package::getByID方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: module

	public function module($module = null, $task = null) {
		Loader::model('dashboard/homepage');
		$dh = new DashboardHomepageView();

		$mod = $dh->getByHandle($module);
		if ($mod->pkgID > 0) {
			$pkg = Package::getByID($mod->pkgID);
			$class = Loader::dashboardModuleController($mod->dbhModule, $pkg);
		} else {
			$class = Loader::dashboardModuleController($mod->dbhModule);
		}
		
		$args = func_get_args();

		array_shift($args);
		array_shift($args); // no that's not a misprint
		
		if (method_exists($class, $task)) {
			try {
				$resp = call_user_func_array(array($class, $task), $args);
				if ($resp) {
					$this->set('message', $resp);
				}
			} catch(Exception $e) {
				$this->set('error', $e);
			}
		}
				
		print $this->view();
	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:30,代码来源:controller.php

示例2: inspect_package

	public function inspect_package($pkgID = 0) { 
		if ($pkgID > 0) {
			$pkg = Package::getByID($pkgID);
		}
		
		if (isset($pkg) && ($pkg instanceof Package)) {
			$this->set('pkg', $pkg);
		} else {
			$this->redirect('/dashboard/extend/install');
		}
	}
开发者ID:nbourguig,项目名称:concrete5,代码行数:11,代码来源:install.php

示例3: output

	public function output($dbh) {
		ob_start();
		if ($dbh->pkgID > 0) {
			$pkg = Package::getByID($dbh->pkgID);
			Loader::dashboardModule($dbh->dbhModule, $pkg);
		} else {
			Loader::dashboardModule($dbh->dbhModule);
		}
		$content = ob_get_contents();
		ob_end_clean();
		return $content;
	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:12,代码来源:homepage.php

示例4: remove

 public function remove($ptID, $token = '')
 {
     $v = Loader::helper('validation/error');
     try {
         $valt = Loader::helper('validation/token');
         if (!$valt->validate('remove', $token)) {
             throw new Exception($valt->getErrorMessage());
         }
         $pl = PageTheme::getByID($ptID);
         if (!is_object($pl)) {
             throw new Exception(t('Invalid theme.'));
         }
         /*
         if ($pl->getPackageID() > 0) {
         	throw new Exception('You may not uninstall a packaged theme.');
         }
         */
         $localUninstall = true;
         if ($pl->getPackageID() > 0) {
             // then we check to see if this is the only theme in that package. If so, we uninstall the package too
             $pkg = Package::getByID($pl->getPackageID());
             $items = $pkg->getPackageItems();
             if (count($items) == 1) {
                 $_pl = $items[0];
                 if ($_pl instanceof PageTheme && $_pl->getThemeID() == $ptID) {
                     $pkg->uninstall();
                     $localUninstall = false;
                 }
             }
         }
         if ($localUninstall) {
             $pl->uninstall();
         }
         $this->set('message', t('Theme uninstalled.'));
     } catch (Exception $e) {
         $v->add($e);
         $this->set('error', $v);
     }
     $this->view();
 }
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:40,代码来源:controller.php

示例5: install

 /**
  * @return Package
  */
 public function install()
 {
     PackageList::refreshCache();
     $db = Loader::db();
     $dh = Loader::helper('date');
     $v = array($this->getPackageName(), $this->getPackageDescription(), $this->getPackageVersion(), $this->getPackageHandle(), 1, $dh->getSystemDateTime());
     $db->query("insert into Packages (pkgName, pkgDescription, pkgVersion, pkgHandle, pkgIsInstalled, pkgDateInstalled) values (?, ?, ?, ?, ?, ?)", $v);
     $pkg = Package::getByID($db->Insert_ID());
     Package::installDB($pkg->getPackagePath() . '/' . FILENAME_PACKAGE_DB);
     $env = Environment::get();
     $env->clearOverrideCache();
     return $pkg;
 }
开发者ID:ojalehto,项目名称:concrete5-legacy,代码行数:16,代码来源:package.php

示例6: t

				<tr>
					<td colspan="4">
						<?php 
    echo t('No pages found.');
    ?>
					</td>
				</tr>
			<?php 
} else {
    ?>

				<?php 
    foreach ($generated as $p) {
        $cp = new Permissions($p);
        if ($p->getPackageID() > 0) {
            $package = Package::getByID($p->getPackageID());
            if (is_object($package)) {
                $packageHandle = $package->getPackageHandle();
                $packageName = $package->getPackageName();
            }
        } else {
            $packageName = t('None');
        }
        ?>
					<tr>
						<td style="width: 30%"><a href="<?php 
        echo DIR_REL;
        ?>
/<?php 
        echo DISPATCHER_FILENAME;
        ?>
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:31,代码来源:single.php

示例7: getPackageObject

 public function getPackageObject()
 {
     return Package::getByID($this->getPackageID());
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:4,代码来源:Shape.php

示例8: refresh

	public function refresh() {
		// takes a generated collection and refreshes it - updates its path, it's cDateModified
		// it's name, it's permissions
		
		if (!$this->isGeneratedCollection()) {
			return false;
		}
		
		$pkg = Package::getByID($this->getPackageID());
		$currentPath = $this->getCollectionPath();
		$pathToFile = SinglePage::getPathToNode($currentPath, $pkg);
		$pxml = SinglePage::obtainPermissionsXML($currentPath, $pkg);

		$txt = Loader::helper('text');

		$data = array();
		$data['cName'] = $txt->unhandle($this->getCollectionHandle());
		$data['cFilename'] = $pathToFile;
		
		$this->update($data);	
		if ($pxml) {
			$this->assignPermissionSet($pxml); // pass it an array
		}
	}
开发者ID:rii-J,项目名称:concrete5-de,代码行数:24,代码来源:single_page.php

示例9: render


//.........这里部分代码省略.........
         }
     } else {
         if (is_string($view)) {
             // if we're passing a view but our render override is not null, that means that we're passing
             // a new view from within a controller. If that's the case, then we DON'T override the viewPath, we want to keep it
             // In order to enable editable 404 pages, other editable pages that we render without actually visiting
             if (defined('DB_DATABASE') && $view == '/page_not_found') {
                 $pp = Page::getByPath($view);
                 if (!$pp->isError()) {
                     $this->c = $pp;
                 }
             }
             $viewPath = $view;
             if ($this->controller->getRenderOverride() != '' && $this->getCollectionObject() != null) {
                 // we are INSIDE a collection renderring a view. Which means we want to keep the viewPath that of the collection
                 $this->viewPath = $this->getCollectionObject()->getCollectionPath();
             }
             // we're just passing something like "/login" or whatever. This will typically just be
             // internal Concrete stuff, but we also prepare for potentially having something in DIR_FILES_CONTENT (ie: the webroot)
             if (file_exists(DIR_FILES_CONTENT . "/{$view}/" . FILENAME_COLLECTION_VIEW)) {
                 $content = DIR_FILES_CONTENT . "/{$view}/" . FILENAME_COLLECTION_VIEW;
             } else {
                 if (file_exists(DIR_FILES_CONTENT . "/{$view}.php")) {
                     $content = DIR_FILES_CONTENT . "/{$view}.php";
                 } else {
                     if (file_exists(DIR_FILES_CONTENT_REQUIRED . "/{$view}/" . FILENAME_COLLECTION_VIEW)) {
                         $content = DIR_FILES_CONTENT_REQUIRED . "/{$view}/" . FILENAME_COLLECTION_VIEW;
                     } else {
                         if (file_exists(DIR_FILES_CONTENT_REQUIRED . "/{$view}.php")) {
                             $content = DIR_FILES_CONTENT_REQUIRED . "/{$view}.php";
                         } else {
                             if ($this->getCollectionObject() != null && $this->getCollectionObject()->isGeneratedCollection() && $this->getCollectionObject()->getPackageID() > 0) {
                                 //This is a single_page associated with a package, so check the package views as well
                                 $pagePkgPath = Package::getByID($this->getCollectionObject()->getPackageID())->getPackagePath();
                                 if (file_exists($pagePkgPath . "/single_pages/{$view}/" . FILENAME_COLLECTION_VIEW)) {
                                     $content = $pagePkgPath . "/single_pages/{$view}/" . FILENAME_COLLECTION_VIEW;
                                 } else {
                                     if (file_exists($pagePkgPath . "/single_pages/{$view}.php")) {
                                         $content = $pagePkgPath . "/single_pages/{$view}.php";
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             $wrapTemplateInTheme = true;
             $themeFilename = $view . '.php';
         }
     }
     if (is_object($this->c)) {
         $c = $this->c;
         if (defined('DB_DATABASE') && ($view == '/page_not_found' || $view == '/login')) {
             $view = $c;
             $req = Request::get();
             $req->setCurrentPage($c);
             $_pageBlocks = $view->getBlocks();
             $_pageBlocksGlobal = $view->getGlobalBlocks();
             $_pageBlocks = array_merge($_pageBlocks, $_pageBlocksGlobal);
         }
     }
     if (is_array($_pageBlocks)) {
         foreach ($_pageBlocks as $b1) {
             $b1p = new Permissions($b1);
             if ($b1p->canRead()) {
                 $btc = $b1->getInstance();
开发者ID:Mihail9575,项目名称:concrete5,代码行数:67,代码来源:view.php

示例10: render


//.........这里部分代码省略.........
					
					
				} else if (is_string($view)) {
					
					// if we're passing a view but our render override is not null, that means that we're passing 
					// a new view from within a controller. If that's the case, then we DON'T override the viewPath, we want to keep it
					
					// In order to enable editable 404 pages, other editable pages that we render without actually visiting
					if (defined('DB_DATABASE') && $view == '/page_not_found') {
						$pp = Page::getByPath($view);
						if (!$pp->isError()) {
							$this->c = $pp;
						}
					}
					
					$viewPath = $view;
					if ($this->controller->getRenderOverride() != '' && $this->getCollectionObject() != null) {
						// we are INSIDE a collection renderring a view. Which means we want to keep the viewPath that of the collection
						$this->viewPath = $this->getCollectionObject()->getCollectionPath();
					}
					
					// we're just passing something like "/login" or whatever. This will typically just be 
					// internal Concrete stuff, but we also prepare for potentially having something in DIR_FILES_CONTENT (ie: the webroot)
					if (file_exists(DIR_FILES_CONTENT . "/{$view}/" . FILENAME_COLLECTION_VIEW)) {
						$content = DIR_FILES_CONTENT . "/{$view}/" . FILENAME_COLLECTION_VIEW;
					} else if (file_exists(DIR_FILES_CONTENT . "/{$view}.php")) {
						$content = DIR_FILES_CONTENT . "/{$view}.php";
					} else if (file_exists(DIR_FILES_CONTENT_REQUIRED . "/{$view}/" . FILENAME_COLLECTION_VIEW)) {
						$content = DIR_FILES_CONTENT_REQUIRED . "/{$view}/" . FILENAME_COLLECTION_VIEW;
					} else if (file_exists(DIR_FILES_CONTENT_REQUIRED . "/{$view}.php")) {
						$content = DIR_FILES_CONTENT_REQUIRED . "/{$view}.php";
					} else if ($this->getCollectionObject() != null && $this->getCollectionObject()->isGeneratedCollection() && $this->getCollectionObject()->getPackageID() > 0) {
						//This is a single_page associated with a package, so check the package views as well
						$pagePkgPath = Package::getByID($this->getCollectionObject()->getPackageID())->getPackagePath();
						if (file_exists($pagePkgPath . "/single_pages/{$view}/" . FILENAME_COLLECTION_VIEW)) {
							$content = $pagePkgPath . "/single_pages/{$view}/" . FILENAME_COLLECTION_VIEW;
						} else if (file_exists($pagePkgPath . "/single_pages/{$view}.php")) {
							$content = $pagePkgPath . "/single_pages/{$view}.php";
						}
					}
					$wrapTemplateInTheme = true;
					$themeFilename = $view . '.php';
				}
				
				
				if (is_object($this->c)) {
					$c = $this->c;
					if (defined('DB_DATABASE') && $view == '/page_not_found') {
						$view = $c;
						$req = Request::get();
						$req->setCurrentPage($c);
					}
				}
				
				// Determine which outer item/theme to load
				// obtain theme information for this collection
				if (isset($this->themeOverride)) {
					$theme = $this->themeOverride;
				} else if ($this->controller->theme != false) {
					$theme = $this->controller->theme;
				} else if (($tmpTheme = $this->getThemeFromPath($viewPath)) != false) {
					$theme = $tmpTheme;
				} else if (is_object($this->c) && ($tmpTheme = $this->c->getCollectionThemeObject()) != false) {
					$theme = $tmpTheme;
				} else {
					$theme = FILENAME_COLLECTION_DEFAULT_THEME;
开发者ID:nbourguig,项目名称:concrete5,代码行数:67,代码来源:view.php

示例11: refresh

		/**
		 * refreshes the BlockType's database schema throws an Exception if error
		 * @return void
		 */
		public function refresh() {
			if ($this->getPackageID() > 0) {
				$pkg = Package::getByID($this->getPackageID());
				$resp = BlockType::installBlockTypeFromPackage($this->getBlockTypeHandle(), $pkg, $this->getBlockTypeID());			
				if ($resp != '') {
					throw new Exception($resp);
				}
			} else {
				$resp = BlockType::installBlockType($this->getBlockTypeHandle(), $this->getBlockTypeID());			
				if ($resp != '') {
					throw new Exception($resp);
				}
			}
		}
开发者ID:ronlobo,项目名称:concrete5,代码行数:18,代码来源:block_types.php

示例12: exportList

 public static function exportList($x)
 {
     $nconfig = $x->addChild('config');
     $db = Loader::db();
     $r = $db->Execute("select cfKey, cfValue, pkgID from Config where uID = 0 and cfKey not in ('SITE','SITE_APP_VERSION','SEEN_INTRODUCTION')");
     while ($row = $r->FetchRow()) {
         $option = $nconfig->addChild($row['cfKey'], $row['cfValue']);
         if ($row['pkgID'] > 0) {
             $pkg = Package::getByID($row['pkgID']);
             if (is_object($pkg)) {
                 $option->addAttribute('package', $pkg->getPackageHandle());
             }
         }
     }
 }
开发者ID:ronlobo,项目名称:concrete5-de,代码行数:15,代码来源:config.php

示例13: package_installed

 public function package_installed($pkgID = 0)
 {
     $this->set('message', t('The package has been installed.'));
     $this->set('installedPKG', Package::getByID($pkgID));
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:5,代码来源:install.php


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