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


PHP CollectionType::getComposerPageTypes方法代码示例

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


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

示例1: view

 /**
  * Views the composer edit page.
  * @param string|int $ctID The collection type
  * @param string|int $cPublishParentID The parent page under which to publish
  */
 public function view($ctID = false, $cPublishParentID = false)
 {
     // Load Page objects from their IDs
     $ct = $this->setCollectionType($ctID);
     $cPublishParent = Page::getByID($cPublishParent);
     // If we couldn't load a collection type, send them to the composer menu
     if (!is_object($ct)) {
         $ctArray = CollectionType::getComposerPageTypes();
         // If there's only one collection type, just choose that one
         if (count($ctArray) === 1) {
             $ct = $ctArray[0];
             $this->redirect('/dashboard/composer/write', $ct->getCollectionTypeID());
             exit;
         }
         // Otherwise, they need to choose the CT from this array of types
         $this->set('ctArray', $ctArray);
     } else {
         // CT was set, so create a draft of this type
         $entry = ComposerPage::createDraft($ct);
         if (is_object($entry)) {
             // Check if we have a parent specified to create this draft under
             if ($cPublishParentID && is_object($cPublishParent)) {
                 // Make this draft under the specified parent
                 $entry->setComposerDraftPublishParentID($cPublishParentID);
             }
             // New draft is created, so start editing it
             $this->redirect('/dashboard/composer/write', 'edit', $entry->getCollectionID());
         } else {
             // Something failed when trying to create a draft, so send back to drafts folder
             $this->redirect('/dashboard/composer/drafts');
         }
     }
 }
开发者ID:r-bansal,项目名称:janeswalk-web-1,代码行数:38,代码来源:write.php

示例2: view

 /**
  * Display all page types controlled by the composer
  * 
  * @return type
  */
 public function view($redirect = true)
 {
     $cap = Loader::helper('concrete/dashboard');
     if (!$cap->canAccessComposer()) {
         return;
     }
     $composerCollectionTypes = CollectionType::getComposerPageTypes();
     if (count($composerCollectionTypes) == 1 && $redirect) {
         $ct = $composerCollectionTypes[0];
         $this->redirect('/dashboard/composer/list/show', $ct->getCollectionTypeID());
         exit;
     }
     $this->set('composerCollectionTypes', $composerCollectionTypes);
 }
开发者ID:haeflimi,项目名称:concrete5-composer-list,代码行数:19,代码来源:list.php

示例3: view

	public function view($ctID = false) {
		$ct = $this->setCollectionType($ctID);		
		if (!is_object($ct)) {
			$ctArray = CollectionType::getComposerPageTypes();
			if (count($ctArray) == 1) {
				$ct = $ctArray[0];
				$this->redirect('/dashboard/composer/write', $ct->getCollectionTypeID());
				exit;
			}
			$this->set('ctArray', $ctArray);
			//$this->redirect('/dashboard/composer');
		} else {
			// create a new page of this type
			$entry = ComposerPage::createDraft($ct);
			$this->redirect('/dashboard/composer/write', 'edit', $entry->getCollectionID());
		}
	}
开发者ID:nbourguig,项目名称:concrete5,代码行数:17,代码来源:write.php


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