mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Added editable Title field to TagCloudWidget
This commit is contained in:
parent
e3eeffafc9
commit
9289d6ed04
@ -2,16 +2,17 @@
|
||||
|
||||
class TagCloudWidget extends Widget {
|
||||
static $db = array(
|
||||
"Title" => "Varchar",
|
||||
"Limit" => "Int",
|
||||
"Sortby" => "Varchar"
|
||||
);
|
||||
|
||||
static $defaults = array(
|
||||
"Title" => "Tag Cloud",
|
||||
"Limit" => "0",
|
||||
"Sortby" => "alphabet"
|
||||
);
|
||||
|
||||
static $title = "Tag Cloud";
|
||||
static $cmsTitle = "Tag Cloud";
|
||||
static $description = "Shows a tag cloud of tags on your blog.";
|
||||
|
||||
@ -30,11 +31,16 @@ class TagCloudWidget extends Widget {
|
||||
|
||||
function getCMSFields() {
|
||||
return new FieldSet(
|
||||
new TextField("Title", _t("TagCloudWidget.TILE", "Title")),
|
||||
new TextField("Limit", _t("TagCloudWidget.LIMIT", "Limit number of tags")),
|
||||
new OptionsetField("Sortby",_t("TagCloudWidget.SORTBY","Sort by"),array("alphabet"=>_t("TagCloudWidget.SBAL", "alphabet"),"frequency"=>_t("TagCloudWidget.SBFREQ", "frequency")))
|
||||
);
|
||||
}
|
||||
|
||||
function Title() {
|
||||
return $this->Title ? $this->Title : 'Tag Cloud';
|
||||
}
|
||||
|
||||
function Tags() {
|
||||
Requirements::css("blog/css/tagcloud.css");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user