Added editable Title field to TagCloudWidget

This commit is contained in:
Sam Minnee 2008-04-08 23:22:08 +00:00
parent e3eeffafc9
commit 9289d6ed04
1 changed files with 7 additions and 1 deletions

View File

@ -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");