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


PHP Versioned::prepopulate_versionnumber_cache方法代码示例

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


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

示例1: testLinkRewritingOnAPublishedPageDoesntMakeItEditedOnDraft

 public function testLinkRewritingOnAPublishedPageDoesntMakeItEditedOnDraft()
 {
     // Publish the source page
     $page = $this->objFromFixture('Page', 'page1');
     $this->assertTrue($page->doPublish());
     $this->assertFalse($page->getIsModifiedOnStage());
     // Rename the file
     $file = $this->objFromFixture('Image', 'file1');
     $file->Name = 'renamed-test-file.jpg';
     $file->write();
     // Caching hack
     Versioned::prepopulate_versionnumber_cache('SiteTree', 'Stage', array($page->ID));
     Versioned::prepopulate_versionnumber_cache('SiteTree', 'Live', array($page->ID));
     // Confirm that the page hasn't gone green.
     $this->assertFalse($page->getIsModifiedOnStage());
 }
开发者ID:helpfulrobot,项目名称:comperio-silverstripe-cms,代码行数:16,代码来源:FileLinkTrackingTest.php

示例2: updateStatusFlags

 public function updateStatusFlags(&$flags)
 {
     static $prepop = true;
     if ($prepop) {
         Versioned::prepopulate_versionnumber_cache('SiteTree', 'Stage');
         Versioned::prepopulate_versionnumber_cache('SiteTree', 'Live');
         $prepop = false;
     }
     $stageVersion = intval(Versioned::get_versionnumber_by_stage('SiteTree', 'Stage', $this->owner->ID));
     $liveVersion = intval(Versioned::get_versionnumber_by_stage('SiteTree', 'Live', $this->owner->ID));
     if ($liveVersion == 0) {
         $flags['status_draft'] = '';
     } elseif ($stageVersion > $liveVersion) {
         $flags['status_draft_published'] = '';
     } else {
         $flags['status_published'] = '';
     }
 }
开发者ID:helpfulrobot,项目名称:zirak-sitetree-status-icon,代码行数:18,代码来源:SiteTreeIconExtension.php

示例3: fixVersionNumberCache

 public function fixVersionNumberCache($page)
 {
     $pages = func_get_args();
     foreach ($pages as $p) {
         Versioned::prepopulate_versionnumber_cache('SiteTree', 'Stage', array($p->ID));
         Versioned::prepopulate_versionnumber_cache('SiteTree', 'Live', array($p->ID));
     }
 }
开发者ID:helpfulrobot,项目名称:comperio-silverstripe-cms,代码行数:8,代码来源:VirtualPageTest.php

示例4: SiteTreeAsUL

 /**
  * Return the entire site tree as a nested set of ULs
  */
 public function SiteTreeAsUL()
 {
     $this->generateDataTreeHints();
     $this->generateTreeStylingJS();
     // Pre-cache sitetree version numbers for querying efficiency
     Versioned::prepopulate_versionnumber_cache("SiteTree", "Stage");
     Versioned::prepopulate_versionnumber_cache("SiteTree", "Live");
     return $this->getSiteTreeFor("SiteTree");
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:12,代码来源:CMSMain.php

示例5: SiteTreeAsUL

 /**
  * Return the entire site tree as a nested set of ULs
  */
 public function SiteTreeAsUL()
 {
     // Pre-cache sitetree version numbers for querying efficiency
     Versioned::prepopulate_versionnumber_cache("SiteTree", "Stage");
     Versioned::prepopulate_versionnumber_cache("SiteTree", "Live");
     $html = $this->getSiteTreeFor($this->stat('tree_class'));
     $this->extend('updateSiteTreeAsUL', $html);
     return $html;
 }
开发者ID:hemant-chakka,项目名称:awss,代码行数:12,代码来源:CMSMain.php

示例6: filtersitetree

	/**
	 * Returns a filtered Site Tree
	 */
	public function filtersitetree() {
		// Pre-cache sitetree version numbers for querying efficiency
		Versioned::prepopulate_versionnumber_cache("SiteTree", "Stage");
		Versioned::prepopulate_versionnumber_cache("SiteTree", "Live");
		
		$className = 'SiteTree';
		$rootID = null;
		$obj = $rootID ? $this->getRecord($rootID) : singleton($className);
		$obj->setMarkingFilterFunction('cmsMainMarkingFilterFunction');
		$obj->markPartialTree();

		if($p = $this->currentPage()) $obj->markToExpose($p);

		// getChildrenAsUL is a flexible and complex way of traversing the tree
		$siteTree = $obj->getChildrenAsUL("", '
					"<li id=\"record-$child->ID\" class=\"" . $child->CMSTreeClasses($extraArg) . "\">" .
					"<a href=\"" . Director::link(substr($extraArg->Link(),0,-1), "show", $child->ID) . "\" " . (($child->canEdit() || $child->canAddChildren()) ? "" : "class=\"disabled\"") . " title=\"' . _t('LeftAndMain.PAGETYPE') . '".$child->class."\" >" .
					($child->TreeTitle()) .
					"</a>"
'
					,$this, true);

		// Wrap the root if needs be.

		if(!$rootID) {
			$rootLink = $this->Link() . '0';
			$siteTree = "<ul id=\"sitetree\" class=\"tree unformatted\"><li id=\"record-0\" class=\"Root nodelete\"><a href=\"$rootLink\">" .
				 _t('LeftAndMain.TREESITECONTENT',"Site Content",PR_HIGH,'Root node on left') . "</a>"
				. $siteTree . "</li></ul>";
		}

		return $siteTree;

	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:37,代码来源:CMSMain.php

示例7: SiteTreeAsUL

	/**
	 * Return the entire site tree as a nested set of ULs
	 */
	public function SiteTreeAsUL() {
		$html = '';

		// Include custom CSS for tree icons inline, as the tree might be loaded
		// via Ajax, in which case we can't inject it into the HTML header easily through the HTTP response.
		$css = $this->generateTreeStylingCSS();
		if($this->request->isAjax()) {
			$html .= "<style type=\"text/css\">\n" . $css . "</style>\n";				
		} else {
			Requirements::customCSS($css);
		}

		// Pre-cache sitetree version numbers for querying efficiency
		Versioned::prepopulate_versionnumber_cache("SiteTree", "Stage");
		Versioned::prepopulate_versionnumber_cache("SiteTree", "Live");
		$html .= $this->getSiteTreeFor($this->stat('tree_class'));

		return $html;
	}
开发者ID:redema,项目名称:silverstripe-cms,代码行数:22,代码来源:CMSMain.php


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