HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/social-media-buttons.tar
assets/banner.svg000064400000003507151540764510010051 0ustar00<svg enable-background="new 55 277 240 240" viewBox="55 277 240 240" xmlns="http://www.w3.org/2000/svg"><path d="m55 277h240v240h-240z" fill="#1880b6"/><g fill="#8ed9ef"><path d="m223 381v-32c0-2.2-1.8-4-4-4h-12v40h12c2.2 0 4-1.8 4-4z"/><path d="m123 393h4v-40h-4c-2.2 0-4 1.8-4 4v32c0 2.2 1.8 4 4 4z"/><path d="m127 405h-8c-2.2 0-4 1.8-4 4v40c0 2.2 1.8 4 4 4h40c2.2 0 4-1.8 4-4v-36h-28c-4.4 0-8-3.6-8-8z"/><path d="m231 401h-24v4c0 4.4-3.6 8-8 8h-20v40c0 2.2 1.8 4 4 4h48c2.2 0 4-1.8 4-4v-48c0-2.2-1.8-4-4-4z"/></g><path d="m135 409h64c2.2 0 4-1.8 4-4v-64c0-2.2-1.8-4-4-4h-64c-2.2 0-4 1.8-4 4v64c0 2.2 1.8 4 4 4z" fill="#f2f0da"/><g fill="#324249"><path d="m171 365c0-2.6 1.6-4 4-4h4v-8s-4.5 0-8 0c-4.7 0-8 3.9-8 8v8h-8v8h8v16h8v-16h8l2-8h-10z"/><path d="m220.9 417.4c-1.2.7-2.5 1.2-3.8 1.5-1.1-1.2-2.7-1.9-4.4-1.9-3.3 0-6.1 2.7-6.1 6.1 0 .5.1.9.2 1.4-5-.3-9.5-2.7-12.5-6.3-.5.9-.8 1.9-.8 3 0 2.1 1.1 4 2.7 5-1 0-1.9-.3-2.7-.8v.1c0 2.9 2.1 5.4 4.9 5.9-.5.1-1 .2-1.6.2-.4 0-.8 0-1.1-.1.8 2.4 3 4.2 5.7 4.2-2.1 1.6-4.7 2.6-7.5 2.6-.5 0-1 0-1.4-.1 2.7 1.7 5.9 2.7 9.3 2.7 11.1 0 17.2-9.2 17.2-17.2 0-.3 0-.5 0-.8 1.2-.9 2.2-1.9 3-3.1-1.1.5-2.3.8-3.5 1 1-.8 2-1.9 2.4-3.4z"/><path d="m231 397h-24v-8h12c4.4 0 8-3.6 8-8v-32c0-4.4-3.6-8-8-8h-12c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v8h-4c-4.4 0-8 3.6-8 8v32c0 4.4 3.6 8 8 8h4v4h-8c-4.4 0-8 3.6-8 8v40c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-36h8v40c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm-24-52h12c2.2 0 4 1.8 4 4v32c0 2.2-1.8 4-4 4h-12zm-84 48c-2.2 0-4-1.8-4-4v-32c0-2.2 1.8-4 4-4h4v40zm40 56c0 2.2-1.8 4-4 4h-40c-2.2 0-4-1.8-4-4v-40c0-2.2 1.8-4 4-4h8c0 4.4 3.6 8 8 8h28zm-28-40c-2.2 0-4-1.8-4-4v-64c0-2.2 1.8-4 4-4h64c2.2 0 4 1.8 4 4v64c0 2.2-1.8 4-4 4zm100 44c0 2.2-1.8 4-4 4h-48c-2.2 0-4-1.8-4-4v-40h20c4.4 0 8-3.6 8-8v-4h24c2.2 0 4 1.8 4 4z"/><path d="m135 417v8h-8v8h8v8h8v-8h8v-8h-8v-8z"/></g></svg>assets/icon.svg000064400000003063151540764510007531 0ustar00<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m18.71094 9.59863h-3.38867v-5.22754c0-.96484-.78516-1.75-1.75-1.75h-8.28321c-.96484 0-1.75.78516-1.75 1.75v8.2832c0 .96484.78516 1.75 1.75 1.75h3.3916v5.22461c0 .96484.78516 1.75 1.75 1.75h8.28027c.96484 0 1.75-.78516 1.75-1.75v-8.28027c0-.96484-.78516-1.75-1.75-1.75zm-3.81934 4.80567c.75977 0 1.37793.61816 1.37793 1.37695s-.61816 1.37695-1.37793 1.37695c-.75879 0-1.37695-.61816-1.37695-1.37695s.61816-1.37695 1.37695-1.37695zm-9.85254-1.75v-8.28321c0-.1377.1123-.25.25-.25h8.2832c.1377 0 .25.1123.25.25v8.2832c0 .1377-.1123.25-.25.25h-8.2832c-.1377 0-.25-.1123-.25-.25zm13.92188 6.97461c0 .13574-.11426.25-.25.25h-8.28027c-.13574 0-.25-.11426-.25-.25v-5.22461h2.20093c-.22656.41089-.36694.87567-.36694 1.37695 0 1.58594 1.29102 2.87695 2.87695 2.87695 1.58691 0 2.87793-1.29102 2.87793-2.87695 0-1.44861-1.08081-2.63904-2.47668-2.83636.01605-.09503.02942-.1911.02942-.29059v-1.55566h3.38867c.13574 0 .25.11426.25.25v8.28027z"/><path d="m10.00684 7.39746c0-.40918.33203-.74121.74121-.74121v-1.5c-1.23535 0-2.24121 1.00586-2.24121 2.24121v.36523h-1.03027v1.5h1.03027v2.35742h1.5v-2.35742h1.03027v-1.5h-1.03027z"/><path d="m17.72949 11.83008c-.18945-.07031-.39941-.07031-.58008 0-.08984.04004-.16992.08984-.23926.16016-.14062.13965-.2207.33984-.2207.5293 0 .20996.08008.39062.2207.53027.06934.08008.14941.12988.23926.16992.09082.04004.19043.0498.29004.0498.2002 0 .39062-.06934.53027-.21973.13965-.13965.21973-.33008.21973-.53027 0-.18945-.08008-.38965-.21973-.5293-.07031-.06055-.15039-.12012-.24023-.16016z"/></svg>data/networks.php000064400000024573151540764510010065 0ustar00<?php

return array(
	'facebook' => array(
		'label' => __( 'Facebook', 'so-widgets-bundle' ),
		'base_url' => 'https://www.facebook.com/',
		'icon_color' => '#fff',
		'button_color' => '#3a5795',
	),
	'x-twitter' => array(
		'label' => __( 'X (Twitter)', 'so-widgets-bundle' ),
		'base_url' => 'https://twitter.com/',
		'icon_color' => '#fff',
		'button_color' => '#000',
	),
	'rss'  => array(
		'label' => __( 'RSS', 'so-widgets-bundle' ),
		'base_url' => get_bloginfo( 'rss_url' ),
		'icon_color' => '#fff',
		'button_color' => '#faa21b',
	),
	'envelope' => array(
		'label' => __( 'Email', 'so-widgets-bundle' ),
		'base_url' => 'mailto:',
		'icon_color' => '#ffffff',
		'button_color' => '#4682b4',
	),
	'phone' => array(
		'label' => __( 'Phone', 'so-widgets-bundle' ),
		'base_url' => 'tel:',
		'icon_color' => '#ffffff',
		'button_color' => '#99e5aa',
	),
	'snapchat' => array(
		'label' => __( 'Snapchat', 'so-widgets-bundle' ),
		'base_url' => 'https://www.snapchat.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#fffc00',
	),
	'square-snapchat' => array(
		'label' => __( 'Snapchat (Square Version)', 'so-widgets-bundle' ),
		'base_url' => 'https://www.snapchat.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#fffc00',
	),
	'skype' => array(
		'label' => __( 'Skype', 'so-widgets-bundle' ),
		'base_url' => 'https://skype.com/',
		'icon_color' => '#f5faff',
		'button_color' => '#00adf0',
	),
	'linkedin' => array(
		'label' => __( 'LinkedIn', 'so-widgets-bundle' ),
		'base_url' => 'https://www.linkedin.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#0177b4',
	),
	'pinterest' => array(
		'label' => __( 'Pinterest', 'so-widgets-bundle' ),
		'base_url' => 'https://www.pinterest.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#db7c83',
	),
	'tumblr' => array(
		'label' => __( 'Tumblr', 'so-widgets-bundle' ),
		'base_url' => 'https://www.tumblr.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#36465d',
	),
	'instagram' => array(
		'label' => __( 'Instagram', 'so-widgets-bundle' ),
		'base_url' => 'https://instagram.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#405DE6',
	),
	'vk' => array(
		'label' => __( 'VK', 'so-widgets-bundle' ),
		'base_url' => 'https://vk.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#537599',
	),
	'flickr' => array(
		'label' => __( 'Flickr', 'so-widgets-bundle' ),
		'base_url' => 'https://www.flickr.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#d40057',
	),

	// The rest of the networks, alphabetically

	'500px' => array(
		'label' => __( '500px', 'so-widgets-bundle' ),
		'base_url' => 'https://500px.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#292929',
	),
	'angellist' => array(
		'label' => __( 'AngelList', 'so-widgets-bundle' ),
		'base_url' => 'https://angel.co/',
		'icon_color' => '#ffffff',
		'button_color' => '#2a2929',
	),
	'bandcamp' => array(
		'label' => __( 'Bandcamp', 'so-widgets-bundle' ),
		'base_url' => 'https://bandcamp.com/',
		'icon_color' => '#1da0c3',
		'button_color' => '#ffffff',
	),
	'behance' => array(
		'label' => __( 'Behance', 'so-widgets-bundle' ),
		'base_url' => 'https://www.behance.net/',
		'icon_color' => '#ffffff',
		'button_color' => '#333333',
	),
	'bitbucket' => array(
		'label' => __( 'Bitbucket', 'so-widgets-bundle' ),
		'base_url' => 'https://bitbucket.org/',
		'icon_color' => '#ffffff',
		'button_color' => '#205081',
	),
	'blogger-b' => array(
		'label' => __( 'Blogger', 'so-widgets-bundle' ),
		'base_url' => 'https://www.blogger.com/',
		'icon_color' => '#f1f1f1',
		'button_color' => '#ff5722',
	),
	'bluesky' => array(
		'label' => __( 'Bluesky', 'so-widgets-bundle' ),
		'base_url' => 'https://bsky.social/',
		'icon_color' => '#ffffff',
		'button_color' => '#0886fe',
	),
	'codepen' => array(
		'label' => __( 'Codepen', 'so-widgets-bundle' ),
		'base_url' => 'https://codepen.io/',
		'icon_color' => '#FFFFFF',
		'button_color' => '#2A2A2A',
	),
	'delicious' => array(
		'label' => __( 'Delicious', 'so-widgets-bundle' ),
		'base_url' => 'https://delicious.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#58acfd',
	),
	'deviantart' => array(
		'label' => __( 'deviantArt', 'so-widgets-bundle' ),
		'base_url' => 'http://www.deviantart.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#b2c01c',
	),
	'discord' => array(
		'label' => __( 'Discord', 'so-widgets-bundle' ),
		'base_url' => 'https://discord.gg/',
		'icon_color' => '#ffffff',
		'button_color' => '#7289da',
	),
	'dribbble' => array(
		'label' => __( 'Dribbble', 'so-widgets-bundle' ),
		'base_url' => 'https://dribbble.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#f26798',
	),
	'dropbox' => array(
		'label' => __( 'Dropbox', 'so-widgets-bundle' ),
		'base_url' => 'https://www.dropbox.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#1388e6',
	),
	'github' => array(
		'label' => __( 'Github', 'so-widgets-bundle' ),
		'base_url' => 'https://github.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#202021',
	),
	'goodreads-g' => array(
		'label' => __( 'Goodreads', 'so-widgets-bundle' ),
		'base_url' => 'https://goodreads.com/',
		'icon_color' => '#372213',
		'button_color' => '#e2e0d1',
	),
	'google' => array(
		'label' => __( 'Google', 'so-widgets-bundle' ),
		'base_url' => 'https://google.com/',
		'icon_color' => '#4285F4',
		'button_color' => '#FFFFFF',
	),
	'hacker-news' => array(
		'label' => __( 'Hacker News', 'so-widgets-bundle' ),
		'base_url' => 'https://news.ycombinator.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#ff6600',
	),
	'imdb' => array(
		'label' => __( 'IMDb', 'so-widgets-bundle' ),
		'base_url' => 'https://www.imdb.com/',
		'icon_color' => '#f3ce13',
		'button_color' => '#000',
	),
	'jsfiddle' => array(
		'label' => __( 'JSFiddle', 'so-widgets-bundle' ),
		'base_url' => 'http://jsfiddle.net/',
		'icon_color' => '#ffffff',
		'button_color' => '#4679bd',
	),
	'lastfm' => array(
		'label' => __( 'Last.fm', 'so-widgets-bundle' ),
		'base_url' => 'https://www.last.fm/',
		'icon_color' => '#ffffff',
		'button_color' => '#c02c0c',
	),
	'patreon' => array(
		'label' => __( 'Patreon', 'so-widgets-bundle' ),
		'base_url' => 'https://www.patreon.com/',
		'icon_color' => '#e26058',
		'button_color' => '#ffffff',
	),
	'reddit' => array(
		'label' => __( 'Reddit', 'so-widgets-bundle' ),
		'base_url' => 'https://www.reddit.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#cee3f8',
	),
	'slack' => array(
		'label' => __( 'Slack', 'so-widgets-bundle' ),
		'base_url' => 'https://www.slack.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#4d394b',
	),
	'slideshare' => array(
		'label' => __( 'Slideshare', 'so-widgets-bundle' ),
		'base_url' => 'https://www.slideshare.net/',
		'icon_color' => '#ffffff',
		'button_color' => '#00a8aa',
	),
	'soundcloud' => array(
		'label' => __( 'Soundcloud', 'so-widgets-bundle' ),
		'base_url' => 'https://soundcloud.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#fe4600',
	),
	'spotify' => array(
		'label' => __( 'Spotify', 'so-widgets-bundle' ),
		'base_url' => 'https://www.spotify.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#7bb72f',
	),
	'stack-exchange' => array(
		'label' => __( 'Stack Exchange', 'so-widgets-bundle' ),
		'base_url' => 'http://stackexchange.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#245598',
	),
	'stack-overflow' => array(
		'label' => __( 'Stack Overflow', 'so-widgets-bundle' ),
		'base_url' => 'http://stackoverflow.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#f57920',
	),
	'steam' => array(
		'label' => __( 'Steam', 'so-widgets-bundle' ),
		'base_url' => 'http://steamcommunity.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#171a21',
	),
	'strava' => array(
		'label' => __( 'Strava', 'so-widgets-bundle' ),
		'base_url' => 'https://www.strava.com/athletes/',
		'icon_color' => '#ffffff',
		'button_color' => '#fc4c02',
	),
	'telegram-plane' => array(
		'label' => __( 'Telegram', 'so-widgets-bundle' ),
		'base_url' => 'https://t.me/',
		'icon_color' => '#ffffff',
		'button_color' => '#27a7e5',
	),
	'threads' => array(
		'label' => __( 'Threads', 'so-widgets-bundle' ),
		'base_url' => 'https://www.threads.net/@',
		'icon_color' => '#000',
		'button_color' => '#fff',
	),
	'tiktok' => array(
		'label' => __( 'TikTok', 'so-widgets-bundle' ),
		'base_url' => 'https://www.tiktok.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#000',
	),
	'trello' => array(
		'label' => __( 'Trello', 'so-widgets-bundle' ),
		'base_url' => 'https://trello.com/',
		'icon_color' => '#FFFFFF',
		'button_color' => '#0E74AF',
	),
	'suitcase' => array(
		'label' => __( 'TripAdvisor', 'so-widgets-bundle' ),
		'base_url' => 'https://www.tripadvisor.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#589442',
	),
	'twitch' => array(
		'label' => __( 'Twitch', 'so-widgets-bundle' ),
		'base_url' => 'https://www.twitch.tv/',
		'icon_color' => '#ffffff',
		'button_color' => '#6542a6',
	),
	'twitter-classic' => array(
		'label' => __( 'Twitter (Classic Logo)', 'so-widgets-bundle' ),
		'base_url' => 'https://twitter.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#78bdf1',
	),
	'viber' => array(
		'label' => __( 'Viber', 'so-widgets-bundle' ),
		'base_url' => 'https://www.viber.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#574e92',
	),
	'vimeo-square' => array(
		'label' => __( 'Vimeo', 'so-widgets-bundle' ),
		'base_url' => 'https://vimeo.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#5bc8ff',
	),
	'whatsapp' => array(
		'label' => __( 'WhatsApp', 'so-widgets-bundle' ),
		'base_url' => 'https://www.whatsapp.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#25d366',
	),
	'wordpress' => array(
		'label' => __( 'WordPress', 'so-widgets-bundle' ),
		'base_url' => 'https://wordpress.org/',
		'icon_color' => '#797979',
		'button_color' => '#222222',
	),
	'xing' => array(
		'label' => __( 'Xing', 'so-widgets-bundle' ),
		'base_url' => 'https://www.xing.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#00605e',
	),
	'yahoo' => array(
		'label' => __( 'Yahoo', 'so-widgets-bundle' ),
		'base_url' => 'https://yahoo.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#4101af',
	),
	'yelp' => array(
		'label' => __( 'Yelp', 'so-widgets-bundle' ),
		'base_url' => 'https://www.yelp.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#b4282e',
	),
	'youtube' => array(
		'label' => __( 'YouTube', 'so-widgets-bundle' ),
		'base_url' => 'https://www.youtube.com/',
		'icon_color' => '#ffffff',
		'button_color' => '#cf3427',
	),
);
js/social-media-buttons-admin.js000064400000002776151540764510012653 0ustar00( function ( $ ) {

	// After the form is setup, add some custom stuff.
	$( document ).on( 'sowsetupform', '.siteorigin-widget-form[data-class="SiteOrigin_Widget_SocialMediaButtons_Widget"], .siteorigin-widget-field-social_media_buttons_widget', function () {
		var $socialMediaForm = $( this );

		var setNetworkDefaults = function ( $selectNetworkInput ) {
			window.sowbForms.fetchWidgetVariable( 'networks', 'SiteOrigin_Widget_SocialMediaButtons_Widget',
				function ( networks ) {
					var selectedNetwork = networks[ $selectNetworkInput.find( ':selected' ).val() ];
					if ( selectedNetwork ) {
						var $closestForm = $selectNetworkInput.closest( '.siteorigin-widget-field-repeater-item-form' );

						var $urlInput = $closestForm.find( '[id*="networks-url"]' );
						$urlInput.val( selectedNetwork.base_url );

						var $iconColorPicker = $closestForm.find( '[id*="networks-icon_color"]' );

						if ( typeof $.fn.wpColorPicker === 'function' ) {
							$iconColorPicker.wpColorPicker( 'color', selectedNetwork.icon_color );

							var $buttonColorPicker = $closestForm.find( '[id*="networks-button_color"]' );
							$buttonColorPicker.wpColorPicker( 'color', selectedNetwork.button_color );
						}
					}
				}
			);
		};

		if ( typeof $socialMediaForm.data( 'initialised' ) === 'undefined' ) {
			$socialMediaForm.on( 'change', '[id*="networks-name"]',
				function ( event ) {
					setNetworkDefaults( $( event.target ) );
				}
			);

			$socialMediaForm.data( 'initialised', true );
		}

	} );

} )( jQuery );
js/social-media-buttons-admin.min.js000064400000001457151540764510013430 0ustar00!function(i){i(document).on("sowsetupform",'.siteorigin-widget-form[data-class="SiteOrigin_Widget_SocialMediaButtons_Widget"], .siteorigin-widget-field-social_media_buttons_widget',(function(){var o=i(this);void 0===o.data("initialised")&&(o.on("change",'[id*="networks-name"]',(function(o){var t;t=i(o.target),window.sowbForms.fetchWidgetVariable("networks","SiteOrigin_Widget_SocialMediaButtons_Widget",(function(o){var e=o[t.find(":selected").val()];if(e){var n=t.closest(".siteorigin-widget-field-repeater-item-form");n.find('[id*="networks-url"]').val(e.base_url);var r=n.find('[id*="networks-icon_color"]');"function"==typeof i.fn.wpColorPicker&&(r.wpColorPicker("color",e.icon_color),n.find('[id*="networks-button_color"]').wpColorPicker("color",e.button_color))}}))})),o.data("initialised",!0))}))}(jQuery);social-media-buttons.php000064400000033520151540764510011313 0ustar00<?php
/*
Widget Name: Social Media Buttons
Description: Add social media buttons to your site with personalized icons, colors, and design settings.
Author: SiteOrigin
Author URI: https://siteorigin.com
Documentation: https://siteorigin.com/widgets-bundle/social-media-buttons-widget/
*/

class SiteOrigin_Widget_SocialMediaButtons_Widget extends SiteOrigin_Widget {
	private $networks;

	public function __construct() {
		parent::__construct(
			'sow-social-media-buttons',
			__( 'SiteOrigin Social Media Buttons', 'so-widgets-bundle' ),
			array(
				'description' => __( 'Add social media buttons to your site with personalized icons, colors, and design settings.', 'so-widgets-bundle' ),
				'help' => 'https://siteorigin.com/widgets-bundle/social-media-buttons-widget/',
			),
			array(),
			false,
			plugin_dir_path( __FILE__ )
		);
	}

	public function get_settings_form() {
		return array(
			'responsive_breakpoint' => array(
				'type'        => 'measurement',
				'label'       => __( 'Responsive Breakpoint', 'so-widgets-bundle' ),
				'default'     => '780px',
				'description' => __( 'This setting controls when the Mobile Align setting will be used. The default value is 780px', 'so-widgets-bundle' ),
			),
		);
	}

	public function get_widget_form() {
		if ( empty( $this->networks ) ) {
			$this->networks = include plugin_dir_path( __FILE__ ) . 'data/networks.php';
		}

		$network_names = array();

		foreach ( $this->networks as $key => $value ) {
			$network_names[ $key ] = $value['label'];
		}

		return array(
			'title' => array(
				'type' => 'text',
				'label' => __( 'Title', 'so-widgets-bundle' ),
			),
			'networks' => array(
				'type'       => 'repeater',
				'label'      => __( 'Networks', 'so-widgets-bundle' ),
				'item_name'  => __( 'Network', 'so-widgets-bundle' ),
				'item_label' => array(
					'selector'     => "[id*='networks-name'] :selected",
					'update_event' => 'change',
					'value_method' => 'text',
				),
				'fields'     => array(
					'name'         => array(
						'type'    => 'select',
						'label'   => '',
						'prompt'  => __( 'Select network', 'so-widgets-bundle' ),
						'options' => $network_names,
					),
					'url'          => array(
						'type'  => 'text',
						'label' => __( 'URL', 'so-widgets-bundle' ),
					),
					'icon_title' => array(
						'type' => 'text',
						'label' => __( 'Icon title', 'so-widgets-bundle' ),
					),
					'icon_color'   => array(
						'type'  => 'color',
						'label' => __( 'Icon color', 'so-widgets-bundle' ),
					),
					'button_color' => array(
						'type'  => 'color',
						'label' => __( 'Background color', 'so-widgets-bundle' ),
					),
					'border_color' => array(
						'type'  => 'color',
						'label' => __( 'Border color', 'so-widgets-bundle' ),
						'state_handler' => array(
							'theme[wire]' => array( 'show' ),
							'_else[theme]' => array( 'hide' ),
						),
					),
					'icon_color_hover' => array(
						'type'  => 'color',
						'label' => __( 'Icon hover color', 'so-widgets-bundle' ),
						'state_handler' => array(
							'hover_effects[enabled]' => array( 'show' ),
							'hover_effects[disabled]' => array( 'hide' ),
						),
					),
					'button_color_hover' => array(
						'type'  => 'color',
						'label' => __( 'Background hover color', 'so-widgets-bundle' ),
						'state_handler' => array(
							'hover_effects[enabled]' => array( 'show' ),
							'hover_effects[disabled]' => array( 'hide' ),
						),
					),
					'border_hover_color' => array(
						'type'  => 'color',
						'label' => __( 'Border hover color', 'so-widgets-bundle' ),
						'state_handler' => array(
							'theme[wire]' => array( 'show' ),
							'_else[theme]' => array( 'hide' ),
						),
					),
				),
			),
			'design'   => array(
				'type'   => 'section',
				'label'  => __( 'Design and Layout', 'so-widgets-bundle' ),
				'hide'   => true,
				'fields' => array(
					'new_window' => array(
						'type'    => 'checkbox',
						'label'   => __( 'Open in a new window', 'so-widgets-bundle' ),
						'default' => true,
					),
					'theme'      => array(
						'type'    => 'select',
						'label'   => __( 'Button theme', 'so-widgets-bundle' ),
						'default' => 'atom',
						'options' => array(
							'atom' => __( 'Atom', 'so-widgets-bundle' ),
							'flat' => __( 'Flat', 'so-widgets-bundle' ),
							'wire' => __( 'Wire', 'so-widgets-bundle' ),
						),
						'state_emitter' => array(
							'callback' => 'select',
							'args' => array( 'theme' ),
						),
					),
					'hover'      => array(
						'type'    => 'checkbox',
						'label'   => __( 'Use hover effects', 'so-widgets-bundle' ),
						'default' => true,
						'state_emitter' => array(
							'callback' => 'conditional',
							'args'     => array(
								'hover_effects[enabled]: val',
								'hover_effects[disabled]: ! val',
							),
						),
					),
					'icon_size'  => array(
						'type'    => 'select',
						'label'   => __( 'Icon size', 'so-widgets-bundle' ),
						'options' => array(
							'1'    => __( 'Normal', 'so-widgets-bundle' ),
							'1.33' => __( 'Medium', 'so-widgets-bundle' ),
							'1.66' => __( 'Large', 'so-widgets-bundle' ),
							'2'    => __( 'Extra large', 'so-widgets-bundle' ),
						),
					),
					'rounding'   => array(
						'type'    => 'select',
						'label'   => __( 'Rounding', 'so-widgets-bundle' ),
						'default' => '0.25',
						'options' => array(
							'0'    => __( 'None', 'so-widgets-bundle' ),
							'0.25' => __( 'Slightly rounded', 'so-widgets-bundle' ),
							'0.5'  => __( 'Very rounded', 'so-widgets-bundle' ),
							'1.5'  => __( 'Completely rounded', 'so-widgets-bundle' ),
						),
					),
					'padding'    => array(
						'type'    => 'select',
						'label'   => __( 'Padding', 'so-widgets-bundle' ),
						'default' => '1',
						'options' => array(
							'0.5' => __( 'Low', 'so-widgets-bundle' ),
							'1'   => __( 'Medium', 'so-widgets-bundle' ),
							'1.4' => __( 'High', 'so-widgets-bundle' ),
							'1.8' => __( 'Very high', 'so-widgets-bundle' ),
						),
					),
					'align'      => array(
						'type'    => 'select',
						'label'   => __( 'Align', 'so-widgets-bundle' ),
						'default' => 'left',
						'options' => array(
							'left'    => __( 'Left', 'so-widgets-bundle' ),
							'right'   => __( 'Right', 'so-widgets-bundle' ),
							'center'  => __( 'Center', 'so-widgets-bundle' ),
							'justify' => __( 'Justify', 'so-widgets-bundle' ),
						),
					),
					'mobile_align'      => array(
						'type'    => 'select',
						'label'   => __( 'Mobile Align', 'so-widgets-bundle' ),
						'default' => 'left',
						'options' => array(
							'left'    => __( 'Left', 'so-widgets-bundle' ),
							'right'   => __( 'Right', 'so-widgets-bundle' ),
							'center'  => __( 'Center', 'so-widgets-bundle' ),
							'justify' => __( 'Justify', 'so-widgets-bundle' ),
						),
					),
					'margin'     => array(
						'type'    => 'select',
						'label'   => __( 'Margin', 'so-widgets-bundle' ),
						'default' => '0.1',
						'options' => array(
							'0.1' => __( 'Low', 'so-widgets-bundle' ),
							'0.2' => __( 'Medium', 'so-widgets-bundle' ),
							'0.3' => __( 'High', 'so-widgets-bundle' ),
							'0.4' => __( 'Very high', 'so-widgets-bundle' ),
						),
					),
				),
			),
		);
	}

	public function modify_form( $form ) {
		return apply_filters( 'sow_social_media_buttons_form_options', $form );
	}

	public function modify_instance( $instance ) {
		if ( ! empty( $instance['networks'] ) ) {
			foreach ( $instance['networks'] as $name => $network ) {
				if ( $network['name'] == 'envelope' ) {
					$network['name'] = 'email';
				}

				// If user has a legacy Google Plus network selected, convert it to a standard Google icon.
				if ( $network['name'] == 'google-plus' ) {
					$network['name'] = 'google';
				}

				if ( $network['name'] == 'email' ) {
					$network['name'] = 'envelope';
				}

				if ( $network['name'] == 'tripadvisor' ) {
					$network['name'] = 'suitcase';
				}

				// Migrate the Classic Twitter icon to the X icon.
				// The old logo is still selectable in the widget.
				if ( $network['name'] == 'twitter' ) {
					$network['name'] = 'x-twitter';

					// If the color wasn't adjusted, use the X colours.
					if (
						$network['icon_color'] == '#ffffff' &&
						$network['button_color'] == '#78bdf1' &&
						! empty( $network['icon_color_hover'] ) &&
						$network['icon_color_hover'] == '#ffffff' &&
						! empty( $network['button_color_hover'] ) &&
						$network['button_color_hover'] == '#78bdf1'
					) {
						$network['button_color'] = '#000';
						$network['button_color_hover'] = '#000';
					}
				}

				if (
					$network['name'] != 'envelope' &&
					$network['name'] != 'suitcase' &&
					$network['name'] != 'rss' &&
					$network['name'] != 'phone'
				) {
					$network['icon_name'] = 'fontawesome-sow-fab-' . $network['name'];
				} else {
					$network['icon_name'] = 'fontawesome-sow-fas-' . $network['name'];
				}
				$instance['networks'][$name] = $network;
			}
		}

		return $instance;
	}

	public function get_javascript_variables() {
		if ( empty( $this->networks ) ) {
			$this->networks = include plugin_dir_path( __FILE__ ) . 'data/networks.php';
		}

		return array( 'networks' => $this->networks );
	}

	public function enqueue_admin_scripts() {
		wp_enqueue_script(
			'sow-social-media-buttons',
			plugin_dir_url( __FILE__ ) . 'js/social-media-buttons-admin' . SOW_BUNDLE_JS_SUFFIX . '.js',
			array( 'jquery' ),
			SOW_BUNDLE_VERSION
		);
	}

	public function get_style_name( $instance ) {
		if ( empty( $instance['design']['theme'] ) ) {
			return 'atom';
		}

		return $instance['design']['theme'];
	}

	public function get_less_variables( $instance ) {
		if ( empty( $instance ) ) {
			return;
		}

		$design = $instance['design'];
		$m = $design['margin'];
		$top = $right = $bottom = $left = $m . 'em';
		switch ( $design['align'] ) {
			case 'left':
				$left = '0';
				break;

			case 'right':
				$right = '0';
				break;

			case 'center':
				$left = $right = ( $m * 0.5 ) . 'em';
				break;
		}
		$margin = $top . ' ' . $right . ' ' . $bottom . ' ' . $left;

		// Get responsive breakpoint and make sure it's properly formatted
		$breakpoint = $this->get_global_settings( 'responsive_breakpoint' );

		return array(
			'icon_size'             => $design['icon_size'] . 'em',
			'rounding'              => $design['rounding'] . 'em',
			'padding'               => $design['padding'] . 'em',
			'align'                 => $design['align'],
			'mobile_align'          => ! empty( $design['mobile_align'] ) ? $design['mobile_align'] : '',
			'responsive_breakpoint' => ! empty( $breakpoint ) ? $breakpoint : '',
			'margin'                => $margin,
		);
	}

	public function less_generate_calls_to( $instance, $args ) {
		$networks = $this->get_instance_networks( $instance );
		$calls    = array();

		foreach ( $networks as $network ) {
			if ( ! empty( $network['name'] ) ) {
				$icon_color_hover_fallback = ! empty( $network['icon_color'] ) ? ', @icon_color_hover:' . $network['icon_color'] : '';
				$button_color_hover_fallback = ! empty( $network['button_color'] ) ? ', @button_color_hover:' . $network['button_color'] : '';
				$call = $args[0] . '( @name:' . $network['css_class_name'];
				$call .= ! empty( $network['icon_color'] ) ? ', @icon_color:' . $network['icon_color'] : '';
				$call .= ! empty( $network['button_color'] ) ? ', @button_color:' . $network['button_color'] : '';
				$call .= ! empty( $network['icon_color_hover'] ) ? ', @icon_color_hover:' . $network['icon_color_hover'] : $icon_color_hover_fallback;
				$call .= ! empty( $network['button_color_hover'] ) ? ', @button_color_hover:' . $network['button_color_hover'] : $button_color_hover_fallback;

				if ( $instance['design']['theme'] == 'wire' ) {
					$call .= ! empty( $network['border_color'] ) ? ', @border_color:' . $network['border_color'] : '';
					$border_hover_color_fallback = ! empty( $network['border_color'] ) ? ', @border_hover_color:' . $network['border_color'] : ", @border_hover_color: ''";
					$call .= ! empty( $network['border_hover_color'] ) ? ', @border_hover_color:' . $network['border_hover_color'] : $border_hover_color_fallback;
				}
				$call .= ');';
				$calls[] = $call;
			}
		}

		return implode( "\n", $calls );
	}

	public function get_template_variables( $instance, $args ) {
		return array(
			'networks' => $this->get_instance_networks( $instance ),
		);
	}

	private function get_instance_networks( $instance ) {
		if ( isset( $instance['networks'] ) && ! empty( $instance['networks'] ) ) {
			$networks = $instance['networks'];
		} else {
			$networks = array();
		}
		$networks = apply_filters( 'sow_social_media_buttons_networks', $networks, $instance );

		$network_classes = array();

		foreach ( $networks as &$network ) {
			$name = $network['name'];

			if ( ! isset( $network_classes[ $name ] ) ) {
				$network_classes[$name] = 0;
			} else {
				++$network_classes[$name];
			}

			if ( $name === 'suitcase' ) {
				$network['name'] = 'Tripadvisor';
			}

			$name .= '-' . $network_classes[$name];
			$network['css_class_name'] = $name;
		}

		return $networks;
	}

	/**
	 * This is used to generate the hash of the instance.
	 *
	 * @return array
	 */
	protected function get_style_hash_variables( $instance ) {
		$networks = $this->get_instance_networks( $instance );

		foreach ( $networks as $i => $network ) {
			// URL is not important for the styling.
			unset( $networks[$i]['url'] );
		}

		return array(
			'less' => $this->get_less_variables( $instance ),
			'networks' => $networks,
		);
	}

	public function get_form_teaser() {
		if ( class_exists( 'SiteOrigin_Premium' ) ) {
			return false;
		}

		return sprintf(
			__( 'Add custom social networks with %sSiteOrigin Premium%s', 'so-widgets-bundle' ),
			'<a href="https://siteorigin.com/downloads/premium/?featured_addon=plugin/social-widgets" target="_blank" rel="noopener noreferrer">',
			'</a>'
		);
	}
}

siteorigin_widget_register( 'sow-social-media-buttons', __FILE__, 'SiteOrigin_Widget_SocialMediaButtons_Widget' );
styles/atom.less000064400000003335151540764510007733 0ustar00@import "../../../base/less/mixins";
@import "widget-mixins";

.widget-function('generate_calls_to', .create_social_media_button_style);

.sow-social-media-button {
	.social-media-button-base();
}

.create_social_media_button_style( @name, @icon_color:'', @button_color:'', @button_color_hover: '', @icon_color_hover: '' ) {

	.sow-social-media-button-@{name} {
		border: 1px solid;
		.box-shadow(~"inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 2px rgba(0,0,0,0.065)");
		text-shadow: 0 1px 0 rgba(0,0,0,0.05);

		& when( iscolor( @button_color ) ) {
			@border_color: darken(@button_color, 15%);
			border-color: lighten(@border_color, 2%) @border_color darken(@border_color, 3%) @border_color;
			.gradient(@button_color, darken(@button_color, 10%), @button_color);

			& when( iscolor( @button_color_hover ) ) {
				@darker_border_hover_color: darken( @button_color_hover, 15% );
				&.ow-button-hover:focus,
				&.ow-button-hover:hover {
					.gradient( lighten( @button_color_hover, 2% ), lighten( darken( @button_color_hover, 10% ), 2% ), lighten( @button_color_hover, 2% ) );
					border-top: 1px solid lighten( lighten( @darker_border_hover_color, 2%), 2%);
					border-right: 1px solid lighten( @darker_border_hover_color, 2% );
					border-bottom: 1px solid  darken( lighten( @darker_border_hover_color, 2% ), 3% );
					border-left: 1px solid lighten( @darker_border_hover_color, 2% );
				}
			}
		}

		& when( iscolor( @icon_color ) ) {
			color: @icon_color !important;
			&.ow-button-hover {
				&:focus,
				&:hover {
					& when not( iscolor( @icon_color_hover ) ) {
						color: lighten( @icon_color, 2% ) !important;
					}

					& when( iscolor( @icon_color_hover ) ) {
						color: @icon_color_hover !important;
					}
				}
			}
		}
	}
}
styles/flat.less000064400000002367151540764510007725 0ustar00@import "../../../base/less/mixins";
@import "widget-mixins";

.widget-function('generate_calls_to', .create_social_media_button_style);

.sow-social-media-button {
	.social-media-button-base();
}

.create_social_media_button_style( @name, @icon_color:'', @button_color:'', @icon_color_hover: '', @button_color_hover: '' ) {

	.sow-social-media-button-@{name} {

		& when( iscolor( @icon_color ) ) {
			color: @icon_color !important;

			&.ow-button-hover:focus,
			&.ow-button-hover:hover {
				& when not( iscolor( @icon_color_hover ) ) {
					color: @icon_color !important;
				}

				& when( iscolor( @icon_color_hover ) ) {
					color: @icon_color_hover !important;
				}
			}
		}

		& when( iscolor( @button_color ) ) {
			background-color: @button_color;
			border: 1px solid @button_color;

			// Account for Twenty Fifteen link border-bottom override.
			&:hover {
				border-bottom: 1px solid @button_color;
			}

			&.ow-button-hover:hover {
				& when not( iscolor( @button_color_hover ) ) {
					background-color: lighten( @button_color, 4% );
					border-bottom-color: lighten( @button_color, 4% );
				}

				& when( iscolor( @button_color_hover ) ) {
					background-color: @button_color_hover;
					border-color: @button_color_hover;
				}
			}
		}
	}
}
styles/widget-mixins.less000064400000001424151540764510011560 0ustar00@icon_size: 1.3em;
@rounding: 0.25em;
@padding: 0.75em;
@margin: 0.1em;
@align: left;
@mobile_align: left;
@responsive_breakpoint: 780px;

.social-media-button-container {
	.clearfix();
	text-align: @align;

	@media (max-width: @responsive_breakpoint) {
		text-align: @mobile_align;
	}

	// This little gem allows justified buttons when there's only one row of buttons or if it's the last row of buttons
	/*
	&:after {
		content:"";
		display:inline-block;
		width:100%;
	}
	*/
}

.social-media-button-base() {
	display: inline-block;
	font-size: @icon_size;
	line-height: 1em;
	margin: @margin;
	padding: @padding 0;
	width: (1em + @padding * 2);
	text-align: center;
	vertical-align: middle;

	.sow-icon-fontawesome {
		display: inline-block;
		height: 1em;
	}

	.rounded(@rounding);
}
styles/wire.less000064400000002500151540764510007732 0ustar00@import "../../../base/less/mixins";
@import "widget-mixins";

.widget-function('generate_calls_to', .create_social_media_button_style);

.sow-social-media-button {
	.social-media-button-base();
}

.create_social_media_button_style( @name, @icon_color:'', @button_color:'', @icon_color_hover: '', @border_color: '', @button_color_hover: '', @border_hover_color: '' ) {

	.sow-social-media-button-@{name} {
		background: transparent;
		text-shadow: 0 1px 0 rgba(0,0,0,0.05);

		& when( iscolor( @icon_color ) ) {
			color: @icon_color !important;
		}

		& when( iscolor( @button_color ) ) {
			border: 2px solid @button_color !important;
			color: @button_color !important;
		}

		& when( iscolor( @border_color ) ) {
			border: 2px solid @border_color !important;
		}

		&.ow-button-hover:focus,
		&.ow-button-hover:hover {
			& when not( iscolor( @button_color_hover ) ) {
				color: @button_color !important;
			}

			& when ( iscolor( @button_color_hover ) ) {
				background: @button_color_hover;
			}

			& when ( iscolor( @border_hover_color ) ) {
				border-color: @border_hover_color !important;
			}

			& when not( iscolor( @icon_color_hover ) ) {
				& when( iscolor( @icon_color ) ) {
					color: @icon_color !important;
				}
			}

			& when( iscolor( @icon_color_hover ) ) {
				color: @icon_color_hover !important;
			}
		}
	}
}
tpl/default.php000064400000003650151540764510007514 0ustar00<?php
/**
 * @var $networks array
 */
?>

<?php if ( ! empty( $instance['title'] ) ) {
	echo $args['before_title'] . wp_kses_post( $instance['title'] ) . $args['after_title'];
} ?>

<div class="social-media-button-container">
	<?php foreach ( $networks as $network ) {
		$classes = array();

		if ( ! empty( $instance['design']['hover'] ) ) {
			$classes[] = 'ow-button-hover';
		}
		$classes[] = 'sow-social-media-button-' . sanitize_html_class( $network['css_class_name'] );
		$classes[] = 'sow-social-media-button';

		if ( empty( $network['icon_title'] ) ) {
			if ( $network['name'] == 'email' || $network['name'] == 'phone' ) {
				$title = sprintf(
					__( '%s %s', 'so-widgets-bundle' ),
					ucfirst( $network['name'] ),
					get_bloginfo( 'name' )
				);
			} else {
				$title = sprintf(
					__( '%s on %s', 'so-widgets-bundle' ),
					get_bloginfo( 'name' ),
					ucwords( str_replace( '-', ' ', $network['name'] ) )
				);
			}
		} else {
			$title = $network['icon_title'];
		}
		$button_attributes = array(
			'class' => esc_attr( implode( ' ', $classes ) ),
			'title' => $title,
			'aria-label' => $title,
		);

		if ( ! empty( $instance['design']['new_window'] ) && $network['name'] != 'phone' ) {
			$button_attributes['target'] = '_blank';
			$button_attributes['rel'] = 'noopener noreferrer';
		}

		if ( ! empty( $network['url'] ) ) {
			$button_attributes['href'] = sow_esc_url( trim( $network['url'] ) );
		}
		?>

		<a <?php foreach ( $button_attributes as $name => $val ) {
			echo siteorigin_sanitize_attribute_key( $name ) . '="' . esc_attr( $val ) . '" ';
		} ?>>
			<span>
				<?php if ( ! empty( $network['is_custom'] ) ) {
					echo '<!-- premium-' . siteorigin_sanitize_attribute_key( $network['name'] ) . ' -->';
				} ?>
				<?php echo siteorigin_widget_get_icon( $network['icon_name'] ); ?>
				<?php if ( ! empty( $network['is_custom'] ) ) {
					echo '<!-- endpremium -->';
				} ?>
			</span>
		</a>
	<?php } ?>
</div>