本文整理汇总了PHP中Concrete\Core\Page\Page类的典型用法代码示例。如果您正苦于以下问题:PHP Page类的具体用法?PHP Page怎么用?PHP Page使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Page类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: publish
public function publish(CollectionKey $ak, Page $page, AttributeValue $value)
{
$inspector = \Core::make('import/value_inspector');
$result = $inspector->inspect($value->getValue());
$content = $result->getReplacedContent();
$page->setAttribute($ak->getAttributeKeyHandle(), $content);
}
开发者ID:motoki1199,项目名称:addon_migration_tool,代码行数:7,代码来源:StandardPublisher.php
示例2: getCacheHeaders
public function getCacheHeaders(Page $c)
{
$lifetime = $c->getCollectionFullPageCachingLifetimeValue();
$expires = gmdate('D, d M Y H:i:s', time() + $lifetime) . ' GMT';
$headers = array('Pragma' => 'public', 'Cache-Control' => 'max-age=' . $lifetime . ',s-maxage=' . $lifetime, 'Expires' => $expires);
return $headers;
}
开发者ID:WillemAnchor,项目名称:concrete5,代码行数:7,代码来源:PageCache.php
示例3: getPublishButtonTitle
public function getPublishButtonTitle(Page $c)
{
if ($c->isPageDraft()) {
$publishTitle = t('Publish Page');
} else {
$publishTitle = t('Publish Changes');
}
$pk = Key::getByHandle('approve_page_versions');
$pk->setPermissionObject($c);
$pa = $pk->getPermissionAccessObject();
$workflows = array();
$canApproveWorkflow = true;
if (is_object($pa)) {
$workflows = $pa->getWorkflows();
}
foreach ($workflows as $wf) {
if (!$wf->canApproveWorkflow()) {
$canApproveWorkflow = false;
}
}
if (count($workflows) > 0 && !$canApproveWorkflow) {
$publishTitle = t('Submit to Workflow');
}
return $publishTitle;
}
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:25,代码来源:Composer.php
示例4: isActive
/**
* Determines whether this nav item is the current page the user is on.
*
* @param \Concrete\Core\Page\Page $c The page object for the current page
*
* @return bool
*/
public function isActive(&$c)
{
if ($c) {
$cID = $c->getCollectionPointerID() > 0 ? $c->getCollectionPointerOriginalID() : $c->getCollectionID();
return $cID == $this->cID;
}
}
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:14,代码来源:nav_item.php
示例5: canPublishPageTypeBeneathTarget
public function canPublishPageTypeBeneathTarget(Type $pagetype, \Concrete\Core\Page\Page $page)
{
if ($page->getAttribute('blog_section') > 0) {
return true;
} else {
return false;
}
}
开发者ID:baardev,项目名称:lbtb,代码行数:8,代码来源:BlogSectionConfiguration.php
示例6: publish
public function publish(CollectionKey $ak, Page $page, AttributeValue $value)
{
$links = $value->getValue();
$r = array();
foreach ($links as $link) {
$r[$link['service']] = $link['detail'];
}
$page->setAttribute($ak->getAttributeKeyHandle(), $r);
}
开发者ID:motoki1199,项目名称:addon_migration_tool,代码行数:9,代码来源:SocialLinksPublisher.php
示例7: publish
public function publish(CollectionKey $ak, Page $page, AttributeValue $value)
{
$inspector = \Core::make('import/value_inspector');
$result = $inspector->inspect($value->getValue());
$items = $result->getMatchedItems();
if (isset($items[0]) && $items[0] instanceof FileItem) {
$file = $items[0]->getContentObject();
$page->setAttribute($ak->getAttributeKeyHandle(), $file);
}
}
开发者ID:motoki1199,项目名称:addon_migration_tool,代码行数:10,代码来源:ImageFilePublisher.php
示例8: getMenuItemClass
public function getMenuItemClass(Page $page)
{
$classes = [];
if (is_object($this->currentPage) && $page->getCollectionID() == $this->currentPage->getCollectionID()) {
$classes[] = 'nav-selected';
}
if (in_array($page->getCollectionID(), $this->trail)) {
$classes[] = 'nav-path-selected';
}
return implode($classes, ' ');
}
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:11,代码来源:menu.php
示例9: publish
/**
* @param CollectionKey $ak
* @param Page $page
* @param AddressAttributeValue $address
*/
public function publish(CollectionKey $ak, Page $page, AttributeValue $address)
{
$value = new Value();
$value->address1 = $address->getAddress1();
$value->address2 = $address->getAddress2();
$value->address3 = $address->getAddress3();
$value->city = $address->getCity();
$value->country = $address->getCountry();
$value->state_province = $address->getStateProvince();
$value->postal_code = $address->getPostalCode();
$page->setAttribute($ak->getAttributeKeyHandle(), $value);
}
开发者ID:motoki1199,项目名称:addon_migration_tool,代码行数:17,代码来源:AddressPublisher.php
示例10: set
public function set(ConcretePage $c, $content)
{
if (!is_dir(Config::get('concrete.cache.page.directory'))) {
@mkdir(Config::get('concrete.cache.page.directory'));
@touch(Config::get('concrete.cache.page.directory') . '/index.html');
}
$lifetime = $c->getCollectionFullPageCachingLifetimeValue();
$file = $this->getCacheFile($c);
if ($file) {
$response = new PageCacheRecord($c, $content, $lifetime);
if ($content) {
file_put_contents($file, serialize($response));
}
}
}
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:15,代码来源:FilePageCache.php
示例11: publishToPage
public function publishToPage(Page $c, $data, $controls)
{
array_push(self::$ptComposerRequestControlsProcessed, $this);
// now we check to see if we have any more core controls to process in this request
$coreControls = array();
foreach ($controls as $cnt) {
if ($cnt->getPageTypeComposerControlTypeHandle() == $this->ptComposerControlTypeHandle) {
$coreControls[] = $controls;
}
}
if (count(self::$ptComposerRequestControlsProcessed) == count($coreControls)) {
// this was the last one. so we're going to loop through our saved request
// and do the page update once, rather than four times.
$c->update(self::$ptComposerSaveRequest);
}
}
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:16,代码来源:CorePageProperty.php
示例12: 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
示例13: setupSiteInterfaceLocalization
public static function setupSiteInterfaceLocalization(Page $c = null)
{
$loc = \Localization::getInstance();
if (!(\User::isLoggedIn() && Config::get('concrete.multilingual.keep_users_locale'))) {
if (!$c) {
$c = Page::getCurrentPage();
}
// don't translate dashboard pages
$dh = \Core::make('helper/concrete/dashboard');
if ($dh->inDashboard($c)) {
return;
}
$locale = null;
$ms = Section::getBySectionOfSite($c);
if ($ms) {
$locale = $ms->getLocale();
}
if (!$locale) {
if (Config::get('concrete.multilingual.use_previous_locale') && Session::has('previous_locale')) {
$locale = Session::get('previous_locale');
}
if (!$locale) {
$ms = static::getPreferredSection();
if ($ms) {
$locale = $ms->getLocale();
}
}
}
if ($locale) {
$loc->setLocale($locale);
}
}
Session::set('previous_locale', $loc->getLocale());
}
开发者ID:WillemAnchor,项目名称:concrete5,代码行数:34,代码来源:Detector.php
示例14: setupSiteInterfaceLocalization
public static function setupSiteInterfaceLocalization(Page $c = null)
{
if (!$c) {
$c = Page::getCurrentPage();
}
$app = Facade::getFacadeApplication();
// don't translate dashboard pages
$dh = $app->make('helper/concrete/dashboard');
if ($dh->inDashboard($c)) {
return;
}
$ms = Section::getBySectionOfSite($c);
if (!is_object($ms)) {
$ms = static::getPreferredSection();
}
if (!$ms) {
return;
}
$locale = $ms->getLocale();
if ($locale) {
$app->make('session')->set('multilingual_default_locale', $locale);
$loc = Localization::getInstance();
$loc->setContextLocale('site', $locale);
}
}
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:25,代码来源:Detector.php
示例15: registerEvents
public function registerEvents()
{
$app = $this->app;
$events = $this->app->make('director');
// Add the sitemap icons listener
$events->addListener('on_before_render', function ($event) use($app) {
$c = Page::getCurrentPage();
$view = $event->getArgument('view');
$assets = $app->make('asset_pipeline/helper/assets');
$theme = null;
if (is_object($c)) {
$theme = $c->getCollectionThemeObject();
} else {
$theme = Theme::getSiteTheme();
}
// TODO: If there are page-specific styles set, should we use
// this one instead:
//$style = $c->getCustomStyleObject();
$style = $theme->getThemeCustomStyleObject();
if (is_object($style)) {
$valueList = $style->getValueList();
if ($valueList instanceof \Concrete\Core\StyleCustomizer\Style\ValueList) {
$variables = array();
foreach ($valueList->getValues() as $value) {
$variables = array_merge($value->toLessVariablesArray(), $variables);
}
$assets->setStylesheetVariables('theme', $variables);
}
}
$view->addScopeItems(array('assets' => $assets));
});
}
开发者ID:mainio,项目名称:c5_asset_pipeline,代码行数:32,代码来源:PackageServiceProvider.php
示例16: setupSiteInterfaceLocalization
public static function setupSiteInterfaceLocalization(Page $c = null)
{
if (\User::isLoggedIn() && Config::get('concrete.multilingual.keep_users_locale')) {
return;
}
if (!$c) {
$c = Page::getCurrentPage();
}
// don't translate dashboard pages
$dh = \Core::make('helper/concrete/dashboard');
if ($dh->inDashboard($c)) {
return;
}
$ms = Section::getBySectionOfSite($c);
if (!is_object($ms)) {
$ms = static::getPreferredSection();
}
if (!$ms) {
return;
}
$locale = $ms->getLocale();
if (strlen($locale)) {
\Localization::changeLocale($locale);
}
}
开发者ID:ceko,项目名称:concrete5-1,代码行数:25,代码来源:Detector.php
示例17: 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
示例18: 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
示例19: 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
示例20: 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
注:本文中的Concrete\Core\Page\Page类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论