2015-02-08 08:03:55 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated since version 2.0
|
|
|
|
*/
|
2015-11-21 07:17:29 +01:00
|
|
|
class BlogTree extends Page implements MigratableObject
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private static $hide_ancestor = 'BlogTree';
|
2015-02-08 08:03:55 +01:00
|
|
|
|
2015-11-21 07:17:29 +01:00
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
private static $db = array(
|
|
|
|
'Name' => 'Varchar(255)',
|
|
|
|
'LandingPageFreshness' => 'Varchar',
|
|
|
|
);
|
2015-02-08 08:03:55 +01:00
|
|
|
|
2015-11-21 07:17:29 +01:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2016-06-01 07:28:59 +02:00
|
|
|
public function canCreate($member = null, $context = array())
|
2015-11-21 07:17:29 +01:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2015-02-08 08:03:55 +01:00
|
|
|
|
2015-11-21 07:17:29 +01:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
$published = $this->IsPublished();
|
|
|
|
if ($this->ClassName === 'BlogTree') {
|
|
|
|
$this->ClassName = 'Page';
|
|
|
|
$this->RecordClassName = 'Page';
|
|
|
|
$this->write();
|
|
|
|
}
|
|
|
|
if ($published) {
|
|
|
|
$this->publish('Stage', 'Live');
|
|
|
|
$message = "PUBLISHED: ";
|
|
|
|
} else {
|
|
|
|
$message = "DRAFT: ";
|
|
|
|
}
|
2016-06-01 07:28:59 +02:00
|
|
|
|
2015-11-21 07:17:29 +01:00
|
|
|
return $message . $this->Title;
|
|
|
|
}
|
2015-02-08 08:03:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated since version 2.0
|
|
|
|
*/
|
2015-11-21 07:17:29 +01:00
|
|
|
class BlogTree_Controller extends Page_Controller
|
|
|
|
{
|
2015-05-09 16:33:12 +02:00
|
|
|
}
|