| @@ -11,18 +11,16 @@ | ||
| 11 | 11 | class displayBlock extends block |
| 12 | 12 | { |
| 13 | 13 | protected $blockname = "display"; |
| 14 | 14 | protected $fields = array( |
| 15 | - 'display_page' => array('default' => 'after'), | |
| 15 | + 'display_page' => array('default' => 'hidden'), | |
| 16 | 16 | 'display_page_options' => array('default' => array()), |
| 17 | - 'display_post' => array('default' => 'after'), | |
| 17 | + 'display_post' => array('default' => 'hidden'), | |
| 18 | 18 | 'display_post_options' => array('default' => array()), |
| 19 | 19 | 'display_homepage' => array('default' => 'hidden'), |
| 20 | 20 | 'display_homepage_options' => array('default' => array()), |
| 21 | - 'display_archive' => array('default' => 'after'), | |
| 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,18 +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 ( Install::isPRO() ) { | |
| 51 | - | |
| 52 | - if (! isset($post['show_desktop']) && isset($post['form_post'])) | |
| 53 | - $blockdata['show_desktop'] = 0; | |
| 54 | - | |
| 55 | - if (! isset($post['show_mobile']) && isset($post['form_post'])) | |
| 56 | - $blockdata['show_mobile'] = 0; | |
| 57 | - } | |
| 58 | - | |
| 59 | 47 | foreach($post_types as $post_type) |
| 60 | 48 | { |
| 61 | 49 | if (isset($post['display_' . $post_type])) |
| 62 | 50 | { |
| @@ -135,22 +123,16 @@ | ||
| 135 | 123 | $orientation = $this->collection->orientation; |
| 136 | 124 | $is_static = $this->collection->is_static; |
| 137 | 125 | $is_post = $this->collection->is_post; |
| 138 | 126 | |
| 139 | - /// $css["mb-item"]["normal"]["float"] = 'left'; | |
| 140 | - | |
| 127 | + $css["mb-item"]["normal"]["float"] = 'left'; | |
| 141 | 128 | // Decide which auto values go with the default settings of the other dimensions. |
| 142 | 129 | |
| 143 | - if ($position && $is_static) | |
| 130 | + if ($position) | |
| 144 | 131 | { |
| 145 | 132 | list($position_y, $position_x) = explode("_", $position); |
| 146 | 133 | |
| 147 | 134 | } |
| 148 | - elseif($position && $is_post) | |
| 149 | - { | |
| 150 | - $position_x = $position; | |
| 151 | - $position_y = false; | |
| 152 | - } | |
| 153 | 135 | else { |
| 154 | 136 | if ($is_static) |
| 155 | 137 | { |
| 156 | 138 | $position_x = 'left'; |
| @@ -171,9 +153,8 @@ | ||
| 171 | 153 | break; |
| 172 | 154 | |
| 173 | 155 | case "vertical"; |
| 174 | 156 | $css["mb-item"]["normal"]["clear"] = "both"; |
| 175 | - $css['maxsocial']['normal']['width'] = 'auto'; | |
| 176 | 157 | break; |
| 177 | 158 | |
| 178 | 159 | } |
| 179 | 160 | |
| @@ -225,13 +206,9 @@ | ||
| 225 | 206 | } |
| 226 | 207 | |
| 227 | 208 | |
| 228 | 209 | } // is_static |
| 229 | - /* elseif ($is_post) | |
| 230 | - { | |
| 231 | 210 | |
| 232 | - } */ | |
| 233 | - | |
| 234 | 211 | return $css; |
| 235 | 212 | } |
| 236 | 213 | |
| 237 | 214 | protected function expert_admin() |
| @@ -599,35 +576,8 @@ | ||
| 599 | 576 | |
| 600 | 577 | |
| 601 | 578 | } |
| 602 | 579 | |
| 603 | - $spacer = new maxField('spacer'); | |
| 604 | - $spacer->id = 'show_spacer'; | |
| 605 | - $spacer->name = $spacer->id; | |
| 606 | - $spacer->label = ' '; | |
| 607 | - | |
| 608 | - $admin->addField($spacer, 'start', 'end'); | |
| 609 | - | |
| 610 | - if ( Install::isPRO() ) { | |
| 611 | - $show_desktop = new maxField('switch'); | |
| 612 | - $show_desktop->id = 'show_desktop'; | |
| 613 | - $show_desktop->name = $show_desktop->id; | |
| 614 | - $show_desktop->value = 1; | |
| 615 | - $show_desktop->label = __('Show on Desktop', 'mbsocial'); | |
| 616 | - $show_desktop->checked = checked( $this->getValue('show_desktop'), 1, false); | |
| 617 | - | |
| 618 | - $admin->addField($show_desktop, 'start', 'end'); | |
| 619 | - | |
| 620 | - $show_mobile = new maxField('switch'); | |
| 621 | - $show_mobile->id = 'show_mobile'; | |
| 622 | - $show_mobile->name = $show_mobile->id; | |
| 623 | - $show_mobile->value = 1; | |
| 624 | - $show_mobile->label = __('Show on Mobile', 'mbsocial'); | |
| 625 | - $show_mobile->checked = checked( $this->getValue('show_mobile'), 1, false); | |
| 626 | - //$show_mobile->publish = ; | |
| 627 | - | |
| 628 | - $admin->addField($show_mobile, 'start', 'end'); | |
| 629 | - } | |
| 630 | 580 | $admin->display_fields(); |
| 631 | 581 | |
| 632 | 582 | } |
| 633 | 583 | |
| @@ -764,10 +714,8 @@ | ||
| 764 | 714 | |
| 765 | 715 | // 'bottom' => __('Bottom', 'mbsocial'), |
| 766 | 716 | ); |
| 767 | 717 | |
| 768 | - $postpos_options = $static_options; | |
| 769 | - | |
| 770 | 718 | $staticpos_options = array( |
| 771 | 719 | // 'auto' => __('Auto', 'mbsocial'), |
| 772 | 720 | 'top' => __('Top', 'mbsocial'), |
| 773 | 721 | 'center' => __('Center', 'mbsocial'), |
| @@ -824,9 +772,8 @@ | ||
| 824 | 772 | |
| 825 | 773 | <div class='post_options'> |
| 826 | 774 | |
| 827 | 775 | <?php |
| 828 | - /* 07/01/2021 - Seems unused | |
| 829 | 776 | $staticIcons = array( |
| 830 | 777 | 'auto' => 'icon_auto.png', |
| 831 | 778 | 'left' => 'icon_posleft.png', |
| 832 | 779 | 'right' => 'icon_posright.png', |
| @@ -835,9 +782,8 @@ | ||
| 835 | 782 | 'bottom' => 'icon_posbottom.png', |
| 836 | 783 | 'horizontal' => 'icon_horizontal.png', |
| 837 | 784 | 'vertical' => 'icon_vertical.png', |
| 838 | 785 | ); |
| 839 | - */ | |
| 840 | 786 | $icon_url = MBSocial()->get_plugin_url() . 'images/icons/'; |
| 841 | 787 | |
| 842 | 788 | $orsp = new maxField('spacer'); |
| 843 | 789 | $orsp->name = 'or_spacer'; |
| @@ -867,50 +813,46 @@ | ||
| 867 | 813 | $or->value = 'vertical'; |
| 868 | 814 | // $or->image = $icon_url . $staticIcons['vertical']; |
| 869 | 815 | $or->custom_icon = 'display_icon vertical'; |
| 870 | 816 | |
| 817 | + | |
| 871 | 818 | $admin->addField($orv, '', 'end'); |
| 872 | 819 | |
| 873 | 820 | $admin->display_fields(); |
| 874 | 821 | |
| 875 | - | |
| 876 | - | |
| 877 | 822 | ?> |
| 878 | 823 | </div> |
| 879 | 824 | <div class='content_options'> |
| 880 | 825 | <?php |
| 881 | 826 | |
| 882 | -/* See : https://bitbucket.org/MF_Team/maxbuttons-social-share/issues/38/inline-share-buttons-cant-be-aligned | |
| 883 | 827 | $spacer = new maxField('spacer'); |
| 884 | - $spacer->name = 'pos_spacer'; | |
| 828 | + $spacer->name = 'spacer'; | |
| 829 | + //$spacer->main_class = 'pos_options'; | |
| 885 | 830 | $spacer->label = __('Alignment', 'mbsocial'); |
| 886 | - // $spacer->main_class = 'pos_options'; | |
| 887 | - $admin->addField($spacer, 'start',''); | |
| 831 | + //$admin->addField($spacer, 'start',''); | |
| 888 | 832 | |
| 889 | 833 | $i = 0; |
| 890 | - | |
| 891 | - foreach($postpos_options as $option => $label) | |
| 834 | + foreach($static_options as $option => $label) | |
| 892 | 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; | |
| 893 | 843 | |
| 894 | - $posopt = new maxField('radio'); | |
| 895 | - $posopt->id = 'position_' . $option; | |
| 896 | - $posopt->name = 'position'; | |
| 897 | - $posopt->title = $label; | |
| 898 | - $posopt->value = $option; | |
| 899 | - //$posopt->image = $icon_url . 'icon_' . $y_option . $x_option . '.png'; | |
| 900 | - $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' : ''; | |
| 901 | 848 | |
| 902 | - $posopt->checked = checked ( $option, 'auto', false); | |
| 903 | - $posopt->inputclass = 'check_button icon'; | |
| 904 | - | |
| 905 | - //$start = ($i == 0) ? 'start' : ''; | |
| 906 | - $end = ($i == 2) ? 'end' : ''; | |
| 907 | - $admin->addField($posopt, '', $end); | |
| 908 | - $i++; | |
| 849 | + //$admin->addField($posopt, '',$end); | |
| 850 | + $i++; | |
| 909 | 851 | } |
| 852 | +/* This is note possible due to margins being in use . */ | |
| 853 | + //$admin->display_fields(); | |
| 910 | 854 | |
| 911 | - $admin->display_fields(); | |
| 912 | -*/ | |
| 913 | 855 | ?> |
| 914 | 856 | |
| 915 | 857 | </div> |
| 916 | 858 | |
| @@ -961,9 +903,9 @@ | ||
| 961 | 903 | $posopt->value = $y_option . '_' . $x_option; |
| 962 | 904 | //$posopt->image = $icon_url . 'icon_' . $y_option . $x_option . '.png'; |
| 963 | 905 | $posopt->custom_icon = 'display_icon ' . $y_option . $x_option; |
| 964 | 906 | |
| 965 | - $posopt->checked = checked ( $x_option, 'auto', false); | |
| 907 | + $posopt->checked = checked ( $option, 'auto', false); | |
| 966 | 908 | $posopt->inputclass = 'check_button icon'; |
| 967 | 909 | |
| 968 | 910 | $start = ( $end == 'end') ? 'start' : ''; // from prev run |
| 969 | 911 | $end = ($i % 3 === 0 && $i > 0) ? 'end' : ''; |
| @@ -1000,28 +942,25 @@ | ||
| 1000 | 942 | $fixed->value = 1; |
| 1001 | 943 | |
| 1002 | 944 | $admin->addField($fixed, 'start', 'end'); |
| 1003 | 945 | |
| 946 | + $admin->display_fields(); | |
| 1004 | 947 | |
| 1005 | 948 | |
| 1006 | - $admin->display_fields(); | |
| 1007 | 949 | ?> |
| 1008 | - </div> | |
| 1009 | 950 | |
| 1010 | 951 | |
| 952 | + </div> | |
| 1011 | 953 | |
| 1012 | - | |
| 1013 | - | |
| 1014 | 954 | <div class='share_options'> |
| 1015 | 955 | <?php |
| 1016 | 956 | $share_options = array( |
| 1017 | 957 | 'auto' => __('Auto', 'mbsocial'), |
| 1018 | 958 | 'current-post' => __('Current Post or Page', 'mbsocial'), |
| 1019 | - 'home' => __('Homepage', 'mbsocial'), | |
| 1020 | - 'custom-url' => __('Custom URL link', 'mbsocial'), | |
| 959 | + 'home' => __('Home URL', 'mbsocial'), | |
| 960 | + 'custom-url' => __('Custom URL', 'mbsocial'), | |
| 1021 | 961 | ); |
| 1022 | 962 | |
| 1023 | - | |
| 1024 | 963 | $share_setting = new maxField('option_select'); |
| 1025 | 964 | $share_setting->id = 'share_setting'; |
| 1026 | 965 | $share_setting->name = $share_setting->id; |
| 1027 | 966 | $share_setting->label = __('Share URL setting', 'mbsocial'); |
| @@ -1026,31 +965,16 @@ | ||
| 1026 | 965 | $share_setting->name = $share_setting->id; |
| 1027 | 966 | $share_setting->label = __('Share URL setting', 'mbsocial'); |
| 1028 | 967 | $share_setting->options = $share_options; |
| 1029 | 968 | |
| 1030 | - //$custom_conditional = htmlentities(json_encode(array('target' => $share_setting->name, 'values' => 'custom-url'))); | |
| 1031 | - | |
| 1032 | 969 | $share_custom = new maxField(); |
| 1033 | 970 | $share_custom->id = 'share_custom_url'; |
| 1034 | - $share_custom->note = __("Settings below only apply when Share URL is set to Custom URL", 'mbsocial'); | |
| 1035 | 971 | $share_custom->name = $share_custom->id; |
| 1036 | 972 | $share_custom->label = __('Custom URL','mbsocial'); |
| 1037 | 973 | $share_custom->inputclass = 'medium'; |
| 1038 | - // $share_custom->start_conditional = $custom_conditional; | |
| 1039 | 974 | |
| 1040 | - $custom_title = new maxField('text'); | |
| 1041 | - $custom_title->id = 'share_custom_title'; | |
| 1042 | - $custom_title->name = $custom_title->id; | |
| 1043 | - $custom_title->label = __('Custom Title', 'mbsocial'); | |
| 1044 | - $custom_title->inputclass = 'medium'; | |
| 1045 | - // $custom_title->start_conditional = $custom_conditional; //htmlentities(json_encode(array('target' => $share_setting->name, 'values' => 'custom-url'))); | |
| 1046 | - | |
| 1047 | 975 | $admin->addField($share_setting, 'start', 'end'); |
| 1048 | - | |
| 1049 | 976 | $admin->addField($share_custom, 'start', 'end'); |
| 1050 | - $admin->addField($custom_title, 'start', 'end'); | |
| 1051 | - | |
| 1052 | - | |
| 1053 | 977 | |
| 1054 | 978 | $admin->display_fields(); |
| 1055 | 979 | ?> |
| 1056 | 980 | |