PluginProbe
Social Share Buttons / 1.5
Social Share Buttons v1.5
trunk 0.9 1.0 1.1 1.1.1 1.1.2 1.10 1.11 1.12 1.15 1.16 1.17 1.18 1.19 1.2 1.20 1.3 1.30 1.4 1.5 1.6 1.7 1.8 1.9
← All changes | classes/blocks/display_block.php +25 -85 1.18 → 1.5 View file →
@@ -19,10 +19,8 @@
19 19 'display_homepage' => array('default' => 'hidden'),
20 20 'display_homepage_options' => array('default' => array()),
21 21 'display_archive' => array('default' => 'hidden'),
22 22 'display_archive_options' => array('default' => array()),
23 - 'show_desktop' => array('default' => 1),
24 - 'show_mobile' => array('default' => 1),
25 23 );
26 24
27 25 /*protected $meta_fields = array(
28 26 'display_here' => array('default' => 1 )
@@ -45,16 +43,8 @@
45 43
46 44 $save_global = array('display_page', 'display_post', 'display_homepage', 'display_archive');
47 45 $save_options = array('display_page_options', 'display_post_options', 'display_homepage_options', 'display_archive_options');
48 46
49 - // check google block realsave as well. Implement this on the main form? Should be there.
50 - if (! isset($post['show_desktop']) && isset($post['form_post']))
51 - $blockdata['show_desktop'] = 0;
52 -
53 - if (! isset($post['show_mobile']) && isset($post['form_post']))
54 - $blockdata['show_mobile'] = 0;
55 -
56 -
57 47 foreach($post_types as $post_type)
58 48 {
59 49 if (isset($post['display_' . $post_type]))
60 50 {
@@ -133,22 +123,16 @@
133 123 $orientation = $this->collection->orientation;
134 124 $is_static = $this->collection->is_static;
135 125 $is_post = $this->collection->is_post;
136 126
137 - /// $css["mb-item"]["normal"]["float"] = 'left';
138 -
127 + $css["mb-item"]["normal"]["float"] = 'left';
139 128 // Decide which auto values go with the default settings of the other dimensions.
140 129
141 - if ($position && $is_static)
130 + if ($position)
142 131 {
143 132 list($position_y, $position_x) = explode("_", $position);
144 133
145 134 }
146 - elseif($position && $is_post)
147 - {
148 - $position_x = $position;
149 - $position_y = false;
150 - }
151 135 else {
152 136 if ($is_static)
153 137 {
154 138 $position_x = 'left';
@@ -169,9 +153,8 @@
169 153 break;
170 154
171 155 case "vertical";
172 156 $css["mb-item"]["normal"]["clear"] = "both";
173 - $css['maxsocial']['normal']['width'] = 'auto';
174 157 break;
175 158
176 159 }
177 160
@@ -223,13 +206,9 @@
223 206 }
224 207
225 208
226 209 } // is_static
227 - /* elseif ($is_post)
228 - {
229 210
230 - } */
231 -
232 211 return $css;
233 212 }
234 213
235 214 protected function expert_admin()
@@ -597,35 +576,8 @@
597 576
598 577
599 578 }
600 579
601 - $spacer = new maxField('spacer');
602 - $spacer->id = 'show_spacer';
603 - $spacer->name = $spacer->id;
604 - $spacer->label = '&nbsp';
605 -
606 - $admin->addField($spacer, 'start', 'end');
607 -
608 - if ( Install::isPRO() ) {
609 - $show_desktop = new maxField('switch');
610 - $show_desktop->id = 'show_desktop';
611 - $show_desktop->name = $show_desktop->id;
612 - $show_desktop->value = 1;
613 - $show_desktop->label = __('Show on Desktop', 'mbsocial');
614 - $show_desktop->checked = checked( $this->getValue('show_desktop'), 1, false);
615 -
616 - $admin->addField($show_desktop, 'start', 'end');
617 -
618 - $show_mobile = new maxField('switch');
619 - $show_mobile->id = 'show_mobile';
620 - $show_mobile->name = $show_mobile->id;
621 - $show_mobile->value = 1;
622 - $show_mobile->label = __('Show on Mobile', 'mbsocial');
623 - $show_mobile->checked = checked( $this->getValue('show_mobile'), 1, false);
624 - //$show_mobile->publish = ;
625 -
626 - $admin->addField($show_mobile, 'start', 'end');
627 - }
628 580 $admin->display_fields();
629 581
630 582 }
631 583
@@ -762,10 +714,8 @@
762 714
763 715 // 'bottom' => __('Bottom', 'mbsocial'),
764 716 );
765 717
766 - $postpos_options = $static_options;
767 -
768 718 $staticpos_options = array(
769 719 // 'auto' => __('Auto', 'mbsocial'),
770 720 'top' => __('Top', 'mbsocial'),
771 721 'center' => __('Center', 'mbsocial'),
@@ -822,9 +772,8 @@
822 772
823 773 <div class='post_options'>
824 774
825 775 <?php
826 - /* 07/01/2021 - Seems unused
827 776 $staticIcons = array(
828 777 'auto' => 'icon_auto.png',
829 778 'left' => 'icon_posleft.png',
830 779 'right' => 'icon_posright.png',
@@ -833,9 +782,8 @@
833 782 'bottom' => 'icon_posbottom.png',
834 783 'horizontal' => 'icon_horizontal.png',
835 784 'vertical' => 'icon_vertical.png',
836 785 );
837 - */
838 786 $icon_url = MBSocial()->get_plugin_url() . 'images/icons/';
839 787
840 788 $orsp = new maxField('spacer');
841 789 $orsp->name = 'or_spacer';
@@ -865,50 +813,46 @@
865 813 $or->value = 'vertical';
866 814 // $or->image = $icon_url . $staticIcons['vertical'];
867 815 $or->custom_icon = 'display_icon vertical';
868 816
817 +
869 818 $admin->addField($orv, '', 'end');
870 819
871 820 $admin->display_fields();
872 821
873 -
874 -
875 822 ?>
876 823 </div>
877 824 <div class='content_options'>
878 825 <?php
879 826
880 -/* See : https://bitbucket.org/MF_Team/maxbuttons-social-share/issues/38/inline-share-buttons-cant-be-aligned
881 827 $spacer = new maxField('spacer');
882 - $spacer->name = 'pos_spacer';
828 + $spacer->name = 'spacer';
829 + //$spacer->main_class = 'pos_options';
883 830 $spacer->label = __('Alignment', 'mbsocial');
884 - // $spacer->main_class = 'pos_options';
885 - $admin->addField($spacer, 'start','');
831 + //$admin->addField($spacer, 'start','');
886 832
887 833 $i = 0;
888 -
889 - foreach($postpos_options as $option => $label)
834 + foreach($static_options as $option => $label)
890 835 {
836 + $posopt = new maxField('radio');
837 + $posopt->id = 'position_x_' . $option;
838 + $posopt->name = 'position_x';
839 + $posopt->title = $label;
840 + $posopt->value = $option;
841 + //$posopt->image = $icon_url . $staticIcons[$option];
842 + //$postopt->custom_icon = 'display_icon ' . $option;
891 843
892 - $posopt = new maxField('radio');
893 - $posopt->id = 'position_' . $option;
894 - $posopt->name = 'position';
895 - $posopt->title = $label;
896 - $posopt->value = $option;
897 - //$posopt->image = $icon_url . 'icon_' . $y_option . $x_option . '.png';
898 - $posopt->custom_icon = 'display_icon center' . $option; // center comes from lookup on icon image
844 + //default
845 + $posopt->checked = checked ( $option, 'auto', false);
846 + $posopt->inputclass = 'check_button icon';
847 + $end = ($i == count($static_options)-1) ? 'end' : '';
899 848
900 - $posopt->checked = checked ( $option, 'auto', false);
901 - $posopt->inputclass = 'check_button icon';
902 -
903 - //$start = ($i == 0) ? 'start' : '';
904 - $end = ($i == 2) ? 'end' : '';
905 - $admin->addField($posopt, '', $end);
906 - $i++;
849 + //$admin->addField($posopt, '',$end);
850 + $i++;
907 851 }
852 +/* This is note possible due to margins being in use . */
853 + //$admin->display_fields();
908 854
909 - $admin->display_fields();
910 -*/
911 855 ?>
912 856
913 857 </div>
914 858
@@ -959,9 +903,9 @@
959 903 $posopt->value = $y_option . '_' . $x_option;
960 904 //$posopt->image = $icon_url . 'icon_' . $y_option . $x_option . '.png';
961 905 $posopt->custom_icon = 'display_icon ' . $y_option . $x_option;
962 906
963 - $posopt->checked = checked ( $x_option, 'auto', false);
907 + $posopt->checked = checked ( $option, 'auto', false);
964 908 $posopt->inputclass = 'check_button icon';
965 909
966 910 $start = ( $end == 'end') ? 'start' : ''; // from prev run
967 911 $end = ($i % 3 === 0 && $i > 0) ? 'end' : '';
@@ -998,18 +942,16 @@
998 942 $fixed->value = 1;
999 943
1000 944 $admin->addField($fixed, 'start', 'end');
1001 945
946 + $admin->display_fields();
1002 947
1003 948
1004 - $admin->display_fields();
1005 949 ?>
1006 - </div>
1007 950
1008 951
952 + </div>
1009 953
1010 -
1011 -
1012 954 <div class='share_options'>
1013 955 <?php
1014 956 $share_options = array(
1015 957 'auto' => __('Auto', 'mbsocial'),
@@ -1045,10 +987,8 @@
1045 987 $admin->addField($share_setting, 'start', 'end');
1046 988
1047 989 $admin->addField($share_custom, 'start', 'end');
1048 990 $admin->addField($custom_title, 'start', 'end');
1049 -
1050 -
1051 991
1052 992 $admin->display_fields();
1053 993 ?>
1054 994