From 7b213908662aa332a49e858597ccaec6949a29b3 Mon Sep 17 00:00:00 2001 From: Colin Tucker Date: Thu, 19 Apr 2018 15:33:47 +1000 Subject: [PATCH] Added sharing icon class. --- composer.json | 2 +- src/Icons/GoogleSharingIcon.php | 93 +++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 src/Icons/GoogleSharingIcon.php diff --git a/composer.json b/composer.json index cdb6bc3..8655c48 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require": { "php": ">=5.6.0", "silverware/silverware": "^1.0", - "silverware/social": "^1.0" + "silverware/social": "^1.1" }, "autoload": { "psr-4": { diff --git a/src/Icons/GoogleSharingIcon.php b/src/Icons/GoogleSharingIcon.php new file mode 100644 index 0000000..edd9746 --- /dev/null +++ b/src/Icons/GoogleSharingIcon.php @@ -0,0 +1,93 @@ +=5.6.0 + * + * For full copyright and license information, please view the + * LICENSE.md file that was distributed with this source code. + * + * @package SilverWare\Google\Icons + * @author Colin Tucker + * @copyright 2018 Praxis Interactive + * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause + * @link https://github.com/praxisnetau/silverware-google + */ + +namespace SilverWare\Google\Icons; + +use SilverWare\Google\Buttons\GoogleSharingButton; +use SilverWare\Social\Model\SharingIcon; + +/** + * An extension of the sharing icon class for a Google sharing icon. + * + * @package SilverWare\Google\Icons + * @author Colin Tucker + * @copyright 2018 Praxis Interactive + * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause + * @link https://github.com/praxisnetau/silverware-google + */ +class GoogleSharingIcon extends SharingIcon +{ + /** + * Human-readable singular name. + * + * @var string + * @config + */ + private static $singular_name = 'Google Sharing Icon'; + + /** + * Human-readable plural name. + * + * @var string + * @config + */ + private static $plural_name = 'Google Sharing Icons'; + + /** + * Description of this object. + * + * @var string + * @config + */ + private static $description = 'A sharing icon to share the current page via Google'; + + /** + * Defines the table name to use for this object. + * + * @var string + * @config + */ + private static $table_name = 'SilverWare_GoogleSharingIcon'; + + /** + * Defines an ancestor class to hide from the admin interface. + * + * @var string + * @config + */ + private static $hide_ancestor = SharingIcon::class; + + /** + * Defines the default values for the fields of this object. + * + * @var array + * @config + */ + private static $defaults = [ + 'FontIcon' => 'google-plus', + 'ColorBackgroundLink' => '#f34a38', + 'ColorForegroundLink' => '#ffffff' + ]; + + /** + * Defines the class of sharing button to use for the popover. + * + * @var string + * @config + */ + private static $button_class = GoogleSharingButton::class; +}