mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
1eca17e0a9
Includes the removal of all tabs and submit action buttons when 'Drafts' or 'Sent Items' are clicked and the addition of an 'add one' link on 'Drafts' folder page. For more information see: http://www.elijahlofgren.com/silverstripe/newletter-tree-and-tab-row-are-confusing/ Includes a few fixes for undefined variables. (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41772 467b73ca-7a2a-4603-9d3b-597d59a354a9
46 lines
992 B
PHP
Executable File
46 lines
992 B
PHP
Executable File
<?php
|
|
|
|
class NewsletterList extends FormField {
|
|
function __construct($name, $mailtype, $status = "Draft") {
|
|
if(is_object($mailtype)) $this->mailType = $mailtype;
|
|
else $this->mailType = DataObject::get_by_id('NewsletterType',$mailtype);
|
|
$this->status = $status;
|
|
parent::__construct(null);
|
|
}
|
|
|
|
function FieldHolder() {
|
|
return $this->renderWith("NewsletterList");
|
|
}
|
|
|
|
|
|
function setMailType($mailtype) {
|
|
$this->mailType = $mailtype;
|
|
}
|
|
|
|
function setController($controller) {
|
|
$this->controller = $controller;
|
|
}
|
|
/* No longer used
|
|
function Newsletters() {
|
|
return DataObject::get( 'Newsletter', "`ParentID`='{$this->mailType->ID}' AND `Status`='{$this->status}'" );
|
|
}
|
|
*/
|
|
|
|
function DraftNewsletters() {
|
|
return $this->mailType->DraftNewsletters();
|
|
}
|
|
|
|
function SentNewsletters() {
|
|
return $this->mailType->SentNewsletters();
|
|
}
|
|
|
|
function Status() {
|
|
return $this->status;
|
|
}
|
|
function mailTypeID() {
|
|
return $this->mailType->ID;
|
|
}
|
|
}
|
|
|
|
?>
|