2015-02-08 08:03:55 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated since version 2.0
|
|
|
|
*/
|
|
|
|
class BlogHolder extends BlogTree implements MigratableObject {
|
2015-05-09 16:33:12 +02:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2015-02-08 08:03:55 +01:00
|
|
|
private static $hide_ancestor = 'BlogHolder';
|
2015-05-09 16:33:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2015-02-08 08:03:55 +01:00
|
|
|
private static $db = array(
|
|
|
|
'AllowCustomAuthors' => 'Boolean',
|
|
|
|
'ShowFullEntry' => 'Boolean',
|
|
|
|
);
|
|
|
|
|
2015-05-09 16:33:12 +02:00
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2015-02-08 08:03:55 +01:00
|
|
|
private static $has_one = array(
|
|
|
|
'Owner' => 'Member',
|
|
|
|
);
|
|
|
|
|
2015-05-09 16:33:12 +02:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2015-02-08 08:03:55 +01:00
|
|
|
public function canCreate($member = null) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-06-27 09:05:51 +02:00
|
|
|
|
|
|
|
//Overload these to stop the Uncaught Exception: Object->__call(): the method 'parent' does not exist on 'BlogHolder' error.
|
|
|
|
public function validURLSegment() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
public function syncLinkTracking() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2015-05-09 16:33:12 +02:00
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2015-02-08 08:03:55 +01:00
|
|
|
public function up() {
|
2015-06-27 09:05:51 +02:00
|
|
|
|
|
|
|
$published = $this->IsPublished();
|
|
|
|
|
2015-02-08 08:03:55 +01:00
|
|
|
if($this->ClassName === 'BlogHolder') {
|
|
|
|
$this->ClassName = 'Blog';
|
2015-06-27 09:05:51 +02:00
|
|
|
$this->RecordClassName = 'Blog';
|
2015-02-08 08:03:55 +01:00
|
|
|
$this->write();
|
|
|
|
}
|
2015-06-27 09:05:51 +02:00
|
|
|
|
|
|
|
if($published){
|
|
|
|
$this->publish('Stage','Live');
|
|
|
|
$message = "PUBLISHED: ";
|
|
|
|
} else {
|
|
|
|
$message = "DRAFT: ";
|
|
|
|
}
|
|
|
|
|
|
|
|
return $message . $this->Title;
|
2015-02-08 08:03:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @deprecated since version 2.0
|
|
|
|
*/
|
|
|
|
class BlogHolder_Controller extends BlogTree_Controller {
|
2015-05-09 16:33:12 +02:00
|
|
|
|
|
|
|
}
|