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


PHP Page::getByPath方法代碼示例

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


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

示例1: import

 public function import(\SimpleXMLElement $sx)
 {
     $siteTree = null;
     if (isset($this->home)) {
         $siteTree = $this->home->getSiteTreeObject();
     }
     if (isset($sx->pages)) {
         foreach ($sx->pages->page as $px) {
             if ($px['path'] != '') {
                 $page = Page::getByPath($px['path'], 'RECENT', $siteTree);
             } else {
                 if (isset($this->home)) {
                     $page = $this->home;
                 } else {
                     $page = Page::getByID(HOME_CID, 'RECENT');
                 }
             }
             if (isset($px->area)) {
                 $this->importPageAreas($page, $px);
             }
             if (isset($px->attributes)) {
                 foreach ($px->attributes->children() as $attr) {
                     $handle = (string) $attr['handle'];
                     $ak = CollectionKey::getByHandle($handle);
                     if (is_object($ak)) {
                         $value = $ak->getController()->importValue($attr);
                         $page->setAttribute($handle, $value);
                     }
                 }
             }
             $page->reindex();
         }
     }
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:34,代碼來源:ImportPageContentRoutine.php

示例2: up

 public function up(Schema $schema)
 {
     /** Add query log db table */
     try {
         $table = $schema->getTable('SystemDatabaseQueryLog');
     } catch (Exception $e) {
         $table = null;
     }
     if (!$table instanceof Table) {
         $ql = $schema->createTable('SystemDatabaseQueryLog');
         $ql->addColumn('query', 'text');
         $ql->addColumn('params', 'text', array('notnull' => false));
         $ql->addColumn('executionMS', 'string');
     }
     /** Add query log single pages */
     $sp = Page::getByPath('/dashboard/system/optimization/query_log');
     if (!is_object($sp) || $sp->isError()) {
         $sp = SinglePage::add('/dashboard/system/optimization/query_log');
         $sp->update(array('cName' => 'Database Query Log'));
         $sp->setAttribute('meta_keywords', 'queries, database, mysql');
     }
     /** Refresh image block */
     $bt = BlockType::getByHandle('image');
     if (is_object($bt)) {
         $bt->refresh();
     }
 }
開發者ID:vipkailiai,項目名稱:FCVOVA,代碼行數:27,代碼來源:Version572.php

示例3: import

 public function import(\SimpleXMLElement $sx)
 {
     $siteTree = null;
     if (isset($this->home)) {
         $siteTree = $this->home->getSiteTreeObject();
     }
     if (isset($sx->singlepages)) {
         foreach ($sx->singlepages->page as $px) {
             if ($px['custom-path']) {
                 $page = Page::getByPath((string) $px['custom-path'], 'RECENT', $siteTree);
             } else {
                 $page = Page::getByPath((string) $px['path'], 'RECENT', $siteTree);
             }
             if (isset($px->area)) {
                 $this->importPageAreas($page, $px);
             }
             if (isset($px->attributes)) {
                 foreach ($px->attributes->children() as $attr) {
                     $ak = CollectionKey::getByHandle($attr['handle']);
                     if (is_object($ak)) {
                         $page->setAttribute((string) $attr['handle'], $ak->getController()->importValue($attr));
                     }
                 }
             }
         }
     }
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:27,代碼來源:ImportSinglePageContentRoutine.php

示例4: getByPath

 public static function getByPath($path, $version = 'RECENT', TreeInterface $siteTree = null)
 {
     $c = parent::getByPath(STACKS_PAGE_PATH . '/' . trim($path, '/'), $version, $siteTree);
     if (static::isValidStack($c)) {
         return $c;
     }
     return false;
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:8,代碼來源:Stack.php

示例5: up

 public function up(Schema $schema)
 {
     $sp = Page::getByPath('/dashboard/system/multilingual/copy');
     if (!is_object($sp) || $sp->isError()) {
         $sp = \Concrete\Core\Page\Single::add('/dashboard/system/multilingual/copy');
         $sp->update(array('cName' => 'Copy Languages'));
     }
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:8,代碼來源:Version20150612000000.php

示例6: getPermissionObject

 public function getPermissionObject()
 {
     if (is_object($this->page)) {
         return $this->page;
     }
     $page = \Concrete\Core\Page\Page::getByPath($this->page);
     if (is_object($page) && !$page->isError()) {
         return $page;
     }
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:10,代碼來源:Page.php

示例7: getChildPages

 public function getChildPages($parent)
 {
     $pages = array();
     if ($parent->getCollectionPath() == '/account') {
         // Add My Account to the List
         $pages[] = Page::getByPath('/account/welcome');
     }
     $pages = array_merge($pages, parent::getChildPages($parent));
     return $pages;
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:10,代碼來源:account_menu.php

示例8: getContentObject

 public function getContentObject()
 {
     if ($this->getReference() == '/' || $this->getReference() == '') {
         return Page::getByID(HOME_CID, 'ACTIVE');
     }
     $c = Page::getByPath($this->getReference(), 'ACTIVE');
     if (is_object($c) && !$c->isError()) {
         return $c;
     }
 }
開發者ID:digideskio,項目名稱:concrete5,代碼行數:10,代碼來源:PageItem.php

示例9: getChildPages

 public function getChildPages($parent)
 {
     $pages = parent::getChildPages($parent);
     if ($parent->getCollectionPath() == '/dashboard/welcome') {
         // Add My Account to the List
         $pages[] = Page::getByPath('/account');
         $site = \Core::make("site")->getSite();
         $config = $site->getConfigRepository();
         if (is_object($site) && $config->get('user.profiles_enabled')) {
             $pages[] = Page::getByPath('/members/profile');
         }
     }
     return $pages;
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:14,代碼來源:dashboard_menu.php

示例10: replace

 /**
  * Given either a path or a Page object, this is a shortcut to
  * 1. Grab the controller of THAT page.
  * 2. Grab the view of THAT controller
  * 3. Render that view.
  * 4. Exit – so we immediately stop all other output in the controller that
  * called render().
  *
  * @param @string|\Concrete\Core\Page\Page $var
  */
 public function replace($var)
 {
     if ($var instanceof Page) {
         $page = $var;
         $path = $var->getCollectionPath();
     } else {
         $path = (string) $var;
         $page = Page::getByPath($path);
     }
     $request = Request::getInstance();
     $controller = $page->getPageController();
     $request->setCurrentPage($page);
     if (is_callable([$controller, 'setCustomRequestPath'])) {
         $controller->setCustomRequestPath($path);
     }
     $this->replacement = $controller;
 }
開發者ID:seebaermichi,項目名稱:concrete5,代碼行數:27,代碼來源:PageController.php

示例11: up

 public function up(Schema $schema)
 {
     /* delete customize page themes dashboard single page */
     $customize = Page::getByPath('/dashboard/pages/themes/customize');
     if (is_object($customize) && !$customize->isError()) {
         $customize->delete();
     }
     /* Add inspect single page back if it's missing */
     $sp = Page::getByPath('/dashboard/pages/themes/inspect');
     if (!is_object($sp) || $sp->isError()) {
         $sp = SinglePage::add('/dashboard/pages/themes/inspect');
         $sp->setAttribute('meta_keywords', 'inspect, templates');
         $sp->setAttribute('exclude_nav', 1);
     }
     $sp = Page::getByPath('/members/directory');
     if (!is_object($sp) || $sp->isError()) {
         $sp = SinglePage::add('/members/directory');
         $sp->setAttribute('exclude_nav', 1);
     }
     $bt = BlockType::getByHandle('feature');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $bt = BlockType::getByHandle('image_slider');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $db = Database::get();
     $sm = $db->getSchemaManager();
     $schemaTables = $sm->listTableNames();
     if (in_array('signuprequests', $schemaTables)) {
         $db->query('alter table signuprequests rename SignupRequestsTmp');
         $db->query('alter table SignupRequestsTmp rename SignupRequests');
     }
     if (in_array('userbannedips', $schemaTables)) {
         $db->query('alter table userbannedips rename UserBannedIPsTmp');
         $db->query('alter table UserBannedIPsTmp rename UserBannedIPs');
     }
     // Clean up File stupidity
     $r = $db->Execute('select Files.fID from Files left join FileVersions on (Files.fID = FileVersions.fID) where FileVersions.fID is null');
     while ($row = $r->FetchRow()) {
         $db->Execute('delete from Files where fID = ?', array($row['fID']));
     }
 }
開發者ID:ceko,項目名稱:concrete5-1,代碼行數:44,代碼來源:Version20141113000000.php

示例12: on_start

 public function on_start()
 {
     $stacksPage = Page::getByPath('/dashboard/blocks/stacks');
     $stacksPerms = new Permissions($stacksPage);
     // Make sure we can view the stacks page
     if ($stacksPerms->canViewPage()) {
         $currentPage = $this->c;
         $currentPagePerms = new Permissions($currentPage);
         $viewTask = $this->request->get('vtask');
         // If the current user can't view this pages versions, or if vtask is not one of the available tasks
         if (!$currentPagePerms->canViewPageVersions() || !in_array($viewTask, ['view_versions', 'compare'])) {
             $url = $stacksPage->getPageController()->action('view_details', $currentPage->getCollectionID());
             // Redirect to the stacks page
             return $this->factory->redirect($url);
         } else {
             // Otherwise set the current theme and render normally
             $this->theme = 'dashboard';
         }
     }
     // If we can't view the stacks page, send a 404
     return $this->factory->notFound('');
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:22,代碼來源:core_stack.php

示例13: up

 public function up(Schema $schema)
 {
     // image resizing options
     $sp = Page::getByPath('/dashboard/system/files/image_uploading');
     if (!is_object($sp) || $sp->isError()) {
         $sp = \Concrete\Core\Page\Single::add('/dashboard/system/files/image_uploading');
         $sp->update(array('cName' => 'Image Uploading'));
     }
     // background size/position
     \Concrete\Core\Database\Schema\Schema::refreshCoreXMLSchema(array('StyleCustomizerInlineStyleSets'));
     $bt = \BlockType::getByHandle('image_slider');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $bt = \BlockType::getByHandle('youtube');
     if (is_object($bt)) {
         $bt->refresh();
     }
     $bt = \BlockType::getByHandle('autonav');
     if (is_object($bt)) {
         $bt->refresh();
     }
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:23,代碼來源:Version20151221000000.php

示例14: add

 public static function add($cPath, $pkg = null)
 {
     // if we get to this point, we create a special collection
     // without a specific type. This collection has a special cFilename that
     // points to the passed node
     $db = Loader::db();
     $txt = Loader::helper('text');
     Loader::helper('concrete/ui')->clearInterfaceItemsCache();
     // trim off a leading / if there is one
     $cPath = trim($cPath, '/');
     // now we grab the parent collection, if there is a static one.
     $pages = explode('/', $cPath);
     // instantiate the home collection so we have someplace to add these to
     $parent = CorePage::getByID(1);
     // now we iterate through the pages  to ensure that they exist in the system before adding the new guy
     $pathPrefix = '';
     for ($i = 0; $i < count($pages); $i++) {
         $currentPath = $pathPrefix . $pages[$i];
         $pathToFile = static::getPathToNode($currentPath, $pkg);
         // check to see if a page at this point in the tree exists
         $c = CorePage::getByPath("/" . $currentPath);
         if ($c->isError() && $c->getError() == COLLECTION_NOT_FOUND) {
             // create the page at that point in the tree
             $data = array();
             $data['handle'] = $pages[$i];
             $data['name'] = $txt->unhandle($data['handle']);
             $data['filename'] = $pathToFile;
             $data['uID'] = USER_SUPER_ID;
             if ($pkg != null) {
                 $data['pkgID'] = $pkg->getPackageID();
             }
             $newC = $parent->addStatic($data);
             $parent = $newC;
         } else {
             $parent = $c;
         }
         $pathPrefix = $currentPath . '/';
     }
     $env = Environment::get();
     $env->clearOverrideCache();
     return $parent;
 }
開發者ID:digideskio,項目名稱:concrete5,代碼行數:42,代碼來源:Single.php

示例15: forbidden

 /**
  * @inheritdoc
  */
 public function forbidden($requestUrl, $code = Response::HTTP_FORBIDDEN, $headers = array())
 {
     // set page for redirection after successful login
     $this->session->set('rUri', $requestUrl);
     // load page forbidden
     $item = '/page_forbidden';
     $c = Page::getByPath($item);
     if (is_object($c) && !$c->isError()) {
         return $this->collection($c, $code, $headers);
     }
     $cnt = $this->app->make(PageForbidden::class);
     $this->controller($cnt, $code, $headers);
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:16,代碼來源:ResponseFactory.php


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