From 68f5cb91a308b3c9f95c38e3f31e73851183bcb8 Mon Sep 17 00:00:00 2001 From: helpfulrobot Date: Sat, 26 Dec 2015 11:00:22 +1300 Subject: [PATCH] Converted to PSR-2 --- code/SocialPageControllerExtension.php | 15 ++--- code/SocialSiteConfig.php | 76 +++++++++++++------------- 2 files changed, 47 insertions(+), 44 deletions(-) diff --git a/code/SocialPageControllerExtension.php b/code/SocialPageControllerExtension.php index 89de27f..2362881 100644 --- a/code/SocialPageControllerExtension.php +++ b/code/SocialPageControllerExtension.php @@ -1,15 +1,16 @@ "Varchar(127)", - "gPlusURL" => "Varchar(127)", - "gPlusButton" => "HTMLVarchar(127)", - "useOpenGraph" => "Boolean", - "ogSiteName" => "Varchar(64)", - "fbAppID" => "Varchar(32)", - "fbAdmins" => "Varchar(127)", - "fbURL" => "Varchar(127)", - "twitterURL" => "Varchar(127)", - "vimeoURL" => "Varchar(127)", - "youtubeURL" => "Varchar(127)", - "linkedInURL" => "Varchar(127)" - ); - - private static $has_one = array( - "ogImage" => "Image" - ); - - public function updateCMSFields(FieldList $fields) { - $fields->addFieldToTab("Root.Social", TextField::create("Publisher", "Publisher (g+)")); - $fields->addFieldToTab("Root.Social", TextField::create("gPlusURL", "Adresa pre Google Plus")); - $fields->addFieldToTab("Root.Social", TextField::create("gPlusButton", "Google Plus Button")->setDescription("Aby sa button začal zobrazovať, treba uviesť atribúty g+ buttonu, t.j. minimálne veľkosť buttonu v tvare: data-size=\"tall\" (small|medium|standard|tall), viac info v g+ dokumentácii.
Šablóna musí podporovať vloženie g+ buttonu!")); - $fields->addFieldToTab("Root.Social", CheckboxField::create("useOpenGraph", "Pridať Open Graph do hlavičky?")); - $fields->addFieldToTab("Root.Social", TextField::create("ogSiteName", "Open Graph - Názov stránky")->setDescription("Ak nezadáte, zobrazí sa Titulok webu, t.j. ".$this->owner->Title."")); - $fields->addFieldToTab("Root.Social", UploadField::create("ogImage", "Open Graph obrázok")); - $fields->addFieldToTab("Root.Social", TextField::create("fbAppID", "Facebook App ID")->setDescription("If set, Facebook admin field bellow will be ignored")); - $fields->addFieldToTab("Root.Social", TextField::create("fbAdmins", "Facebook admin")->setDescription("Bez zadania Facebook ID sa nevytvorí prepojenie Web ↔ Facebook. Facebook ID zistíte napr. tu: findmyfacebookid.com")); - $fields->addFieldToTab("Root.Social", TextField::create("fbURL", "Adresa pre Facebook")); - $fields->addFieldToTab("Root.Social", TextField::create("twitterURL", "Adresa pre Twitter")); - $fields->addFieldToTab("Root.Social", TextField::create("vimeoURL", "Adresa pre Vimeo")); - $fields->addFieldToTab("Root.Social", TextField::create("youtubeURL", "Adresa pre YouTube")); - $fields->addFieldToTab("Root.Social", TextField::create("linkedInURL", "Adresa pre LinkedIn")); + +class SocialSiteConfig extends DataExtension +{ + + private static $db = array( + "Publisher" => "Varchar(127)", + "gPlusURL" => "Varchar(127)", + "gPlusButton" => "HTMLVarchar(127)", + "useOpenGraph" => "Boolean", + "ogSiteName" => "Varchar(64)", + "fbAppID" => "Varchar(32)", + "fbAdmins" => "Varchar(127)", + "fbURL" => "Varchar(127)", + "twitterURL" => "Varchar(127)", + "vimeoURL" => "Varchar(127)", + "youtubeURL" => "Varchar(127)", + "linkedInURL" => "Varchar(127)" + ); + + private static $has_one = array( + "ogImage" => "Image" + ); + + public function updateCMSFields(FieldList $fields) + { + $fields->addFieldToTab("Root.Social", TextField::create("Publisher", "Publisher (g+)")); + $fields->addFieldToTab("Root.Social", TextField::create("gPlusURL", "Adresa pre Google Plus")); + $fields->addFieldToTab("Root.Social", TextField::create("gPlusButton", "Google Plus Button")->setDescription("Aby sa button začal zobrazovať, treba uviesť atribúty g+ buttonu, t.j. minimálne veľkosť buttonu v tvare: data-size=\"tall\" (small|medium|standard|tall), viac info v g+ dokumentácii.
Šablóna musí podporovať vloženie g+ buttonu!")); + $fields->addFieldToTab("Root.Social", CheckboxField::create("useOpenGraph", "Pridať Open Graph do hlavičky?")); + $fields->addFieldToTab("Root.Social", TextField::create("ogSiteName", "Open Graph - Názov stránky")->setDescription("Ak nezadáte, zobrazí sa Titulok webu, t.j. ".$this->owner->Title."")); + $fields->addFieldToTab("Root.Social", UploadField::create("ogImage", "Open Graph obrázok")); + $fields->addFieldToTab("Root.Social", TextField::create("fbAppID", "Facebook App ID")->setDescription("If set, Facebook admin field bellow will be ignored")); + $fields->addFieldToTab("Root.Social", TextField::create("fbAdmins", "Facebook admin")->setDescription("Bez zadania Facebook ID sa nevytvorí prepojenie Web ↔ Facebook. Facebook ID zistíte napr. tu: findmyfacebookid.com")); + $fields->addFieldToTab("Root.Social", TextField::create("fbURL", "Adresa pre Facebook")); + $fields->addFieldToTab("Root.Social", TextField::create("twitterURL", "Adresa pre Twitter")); + $fields->addFieldToTab("Root.Social", TextField::create("vimeoURL", "Adresa pre Vimeo")); + $fields->addFieldToTab("Root.Social", TextField::create("youtubeURL", "Adresa pre YouTube")); + $fields->addFieldToTab("Root.Social", TextField::create("linkedInURL", "Adresa pre LinkedIn")); } - } // EOF +