Conditions | 32 |
Paths | > 20000 |
Total Lines | 557 |
Code Lines | 395 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
775 | public function render_admin_page() |
||
776 | { |
||
777 | $this->admin_process(); |
||
778 | $this->go_pro_cta(); |
||
779 | $this->system_check(); |
||
780 | $max_tabs = apply_filters('metaslider_max_tabs', 0); ?> |
||
781 | |||
782 | <script type='text/javascript'> |
||
783 | var metaslider_slider_id = <?php echo $this->slider->id; ?>; |
||
784 | var metaslider_pro_active = <?php echo function_exists('is_plugin_active') && is_plugin_active('ml-slider-pro/ml-slider-pro.php') ? 'true' : 'false' ?>; |
||
785 | </script> |
||
786 | |||
787 | <div class="wrap metaslider"> |
||
788 | <form accept-charset="UTF-8" action="?page=metaslider&id=<?php echo $this->slider->id ?>" method="post"> |
||
789 | <?php |
||
790 | if ($this->slider) { |
||
791 | wp_nonce_field('metaslider_save_' . $this->slider->id); |
||
792 | } |
||
793 | |||
794 | $title = ''; |
||
795 | $add_url = wp_nonce_url('?page=metaslider&add=true', 'metaslider_add_slider'); |
||
796 | |||
797 | if ($tabs = $this->all_meta_sliders()) { |
||
798 | if ($max_tabs && count($tabs) > $max_tabs) { |
||
799 | if (isset($_GET['add']) && 'true' === $_GET['add']) { |
||
800 | echo "<div id='message' class='updated'><p>" . __("New slideshow created. Click 'Add Slide' to get started!", 'metaslider') . '</p></div>'; |
||
801 | } |
||
802 | echo "<div style='margin-top: 20px;'><label for='select-slider'>Select Slider: </label>"; |
||
803 | echo "<select name='select-slider' onchange='if (this.value) window.location.href=this.value'>"; |
||
804 | |||
805 | $tabs = $this->all_meta_sliders('title'); |
||
806 | |||
807 | foreach ($tabs as $tab) { |
||
808 | $selected = $tab['active'] ? ' selected' : ''; |
||
809 | |||
810 | if ($tab['active']) { |
||
811 | $title = $tab['title']; |
||
812 | } |
||
813 | |||
814 | echo "<option value='?page=metaslider&id={$tab['id']}'{$selected}>{$tab['title']}</option>"; |
||
815 | } |
||
816 | echo '</select> ' . __('or', 'metaslider') . ' '; |
||
817 | echo "<a href='{$add_url}'>" . __('Add New Slideshow', 'metaslider') . '</a></div>'; |
||
818 | } else { |
||
819 | echo "<h3 class='nav-tab-wrapper'>"; |
||
820 | foreach ($tabs as $tab) { |
||
821 | if ($tab['active']) { |
||
822 | echo "<div class='nav-tab nav-tab-active'><input type='text' name='title' value='" . $tab['title'] . "' onfocus='this.style.width = ((this.value.length + 1) * 9) + \"px\"' ></div>"; |
||
823 | } else { |
||
824 | echo "<a href='?page=metaslider&id={$tab['id']}' class='nav-tab'>" . $tab['title'] . '</a>'; |
||
825 | } |
||
826 | } |
||
827 | echo "<a href='{$add_url}' id='create_new_tab' class='nav-tab'>+</a>"; |
||
828 | echo '</h3>'; |
||
829 | } |
||
830 | } else { |
||
831 | echo "<h3 class='nav-tab-wrapper'>"; |
||
832 | echo "<a href='{$add_url}' id='create_new_tab' class='nav-tab'>+</a>"; |
||
833 | echo "<div class='bubble'>" . __('Create your first slideshow') . '</div>'; |
||
834 | echo '</h3>'; |
||
835 | } ?> |
||
836 | |||
837 | <?php |
||
838 | if (!$this->slider) { |
||
839 | return; |
||
840 | } ?> |
||
841 | <div id='poststuff'> |
||
842 | <div id='post-body' class='metabox-holder columns-2'> |
||
843 | |||
844 | <div id='post-body-content'> |
||
845 | <div class="left"> |
||
846 | <table class="widefat sortable"> |
||
847 | <thead> |
||
848 | <tr> |
||
849 | <th style="width: 100px;"> |
||
850 | <h3><?php _e('Slides', 'metaslider') ?></h3> |
||
851 | </th> |
||
852 | <th> |
||
853 | <a href='#' class='button alignright add-slide' data-editor='content' title='<?php _e('Add Slide', 'metaslider') ?>'> |
||
854 | <span class='wp-media-buttons-icon'></span> <?php _e('Add Slide', 'metaslider') ?> |
||
855 | </a> |
||
856 | </th> |
||
857 | </tr> |
||
858 | </thead> |
||
859 | |||
860 | <tbody> |
||
861 | <?php |
||
862 | $this->slider->render_admin_slides(); ?> |
||
863 | </tbody> |
||
864 | </table> |
||
865 | </div> |
||
866 | </div> |
||
867 | |||
868 | <div id='postbox-container-1' class='postbox-container'> |
||
869 | <div id="side-sortables" class="meta-box-sortables"> |
||
870 | <div class='right'> |
||
871 | <div class="postbox"> |
||
872 | <h3 class='configuration'> |
||
873 | <?php _e('Settings', 'metaslider') ?> |
||
874 | <input class='alignright button button-primary' type='submit' name='save' id='ms-save' value='<?php _e('Save', 'metaslider') ?>'> |
||
875 | <input class='alignright button button-primary' type='submit' name='preview' id='ms-preview' value='<?php _e('Save & Preview', 'metaslider') ?>' data-slider_id='<?php echo $this->slider->id ?>' |
||
876 | data-slider_width='<?php echo $this->slider->get_setting('width') ?>' data-slider_height='<?php echo $this->slider->get_setting('height') ?>'> |
||
877 | <span class="spinner"></span> |
||
878 | </h3> |
||
879 | <div class="inside"> |
||
880 | <table class="widefat settings"> |
||
881 | <tbody> |
||
882 | <?php |
||
883 | $aFields = array( |
||
884 | 'type' => array( |
||
885 | 'priority' => 0, |
||
886 | 'type' => 'slider-lib', |
||
887 | 'value' => $this->slider->get_setting('type'), |
||
888 | 'options' => array( |
||
889 | 'flex' => array('label' => __('Flex Slider', 'metaslider')), |
||
890 | 'responsive' => array('label' => __('Responsive', 'metaslider')), |
||
891 | 'nivo' => array('label' => __('Nivo Slider', 'metaslider')), |
||
892 | 'coin' => array('label' => __('Coin Slider', 'metaslider')) |
||
893 | ) |
||
894 | ), |
||
895 | 'width' => array( |
||
896 | 'priority' => 10, |
||
897 | 'type' => 'number', |
||
898 | 'size' => 3, |
||
899 | 'min' => 0, |
||
900 | 'max' => 9999, |
||
901 | 'step' => 1, |
||
902 | 'value' => $this->slider->get_setting('width'), |
||
903 | 'label' => __('Width', 'metaslider'), |
||
904 | 'class' => 'coin flex responsive nivo', |
||
905 | 'helptext' => __('Slideshow width', 'metaslider'), |
||
906 | 'after' => __('px', 'metaslider') |
||
907 | ), |
||
908 | 'height' => array( |
||
909 | 'priority' => 20, |
||
910 | 'type' => 'number', |
||
911 | 'size' => 3, |
||
912 | 'min' => 0, |
||
913 | 'max' => 9999, |
||
914 | 'step' => 1, |
||
915 | 'value' => $this->slider->get_setting('height'), |
||
916 | 'label' => __('Height', 'metaslider'), |
||
917 | 'class' => 'coin flex responsive nivo', |
||
918 | 'helptext' => __('Slideshow height', 'metaslider'), |
||
919 | 'after' => __('px', 'metaslider') |
||
920 | ), |
||
921 | 'effect' => array( |
||
922 | 'priority' => 30, |
||
923 | 'type' => 'select', |
||
924 | 'value' => $this->slider->get_setting('effect'), |
||
925 | 'label' => __('Effect', 'metaslider'), |
||
926 | 'class' => 'effect coin flex responsive nivo', |
||
927 | 'helptext' => __('Slide transition effect', 'metaslider'), |
||
928 | 'options' => array( |
||
929 | 'random' => array('class' => 'option coin nivo', 'label' => __('Random', 'metaslider')), |
||
930 | 'swirl' => array('class' => 'option coin', 'label' => __('Swirl', 'metaslider')), |
||
931 | 'rain' => array('class' => 'option coin', 'label' => __('Rain', 'metaslider')), |
||
932 | 'straight' => array('class' => 'option coin', 'label' => __('Straight', 'metaslider')), |
||
933 | 'sliceDown' => array('class' => 'option nivo', 'label' => __('Slide Down', 'metaslider')), |
||
934 | 'sliceUp' => array('class' => 'option nivo', 'label' => __('Slice Up', 'metaslider')), |
||
935 | 'sliceUpLeft' => array('class' => 'option nivo', 'label' => __('Slide Up Left', 'metaslider')), |
||
936 | 'sliceUpDown' => array('class' => 'option nivo', 'label' => __('Slice Up Down', 'metaslider')), |
||
937 | 'slideUpDownLeft' => array('class' => 'option nivo', 'label' => __('Slide Up Down Left', 'metaslider')), |
||
938 | 'fold' => array('class' => 'option nivo', 'label' => __('Fold', 'metaslider')), |
||
939 | 'fade' => array('class' => 'option nivo flex responsive', 'label' => __('Fade', 'metaslider')), |
||
940 | 'slideInRight' => array('class' => 'option nivo', 'label' => __('Slide In Right', 'metaslider')), |
||
941 | 'slideInLeft' => array('class' => 'option nivo', 'label' => __('Slide In Left', 'metaslider')), |
||
942 | 'boxRandom' => array('class' => 'option nivo', 'label' => __('Box Random', 'metaslider')), |
||
943 | 'boxRain' => array('class' => 'option nivo', 'label' => __('Box Rain', 'metaslider')), |
||
944 | 'boxRainReverse' => array('class' => 'option nivo', 'label' => __('Box Rain Reverse', 'metaslider')), |
||
945 | 'boxRainGrowReverse' => array('class' => 'option nivo', 'label' => __('Box Rain Grow Reverse', 'metaslider')), |
||
946 | 'slide' => array('class' => 'option flex', 'label' => __('Slide', 'metaslider')) |
||
947 | ) |
||
948 | ), |
||
949 | 'theme' => array( |
||
950 | 'priority' => 40, |
||
951 | 'type' => 'theme', |
||
952 | 'value' => $this->slider->get_setting('theme'), |
||
953 | 'label' => __('Theme', 'metaslider'), |
||
954 | 'class' => 'effect coin flex responsive nivo', |
||
955 | 'helptext' => __('Slideshow theme', 'metaslider'), |
||
956 | 'options' => array( |
||
957 | 'default' => array('class' => 'option nivo flex coin responsive', 'label' => __('Default', 'metaslider')), |
||
958 | 'dark' => array('class' => 'option nivo', 'label' => __('Dark (Nivo)', 'metaslider')), |
||
959 | 'light' => array('class' => 'option nivo', 'label' => __('Light (Nivo)', 'metaslider')), |
||
960 | 'bar' => array('class' => 'option nivo', 'label' => __('Bar (Nivo)', 'metaslider')) |
||
961 | ) |
||
962 | ), |
||
963 | 'links' => array( |
||
964 | 'priority' => 50, |
||
965 | 'type' => 'checkbox', |
||
966 | 'label' => __('Arrows', 'metaslider'), |
||
967 | 'class' => 'option coin flex nivo responsive', |
||
968 | 'checked' => 'true' === $this->slider->get_setting('links') ? 'checked' : '', |
||
969 | 'helptext' => __('Show the previous/next arrows', 'metaslider') |
||
970 | ), |
||
971 | 'navigation' => array( |
||
972 | 'priority' => 60, |
||
973 | 'type' => 'navigation', |
||
974 | 'label' => __('Navigation', 'metaslider'), |
||
975 | 'class' => 'option coin flex nivo responsive', |
||
976 | 'value' => $this->slider->get_setting('navigation'), |
||
977 | 'helptext' => __('Show the slide navigation bullets', 'metaslider'), |
||
978 | 'options' => array( |
||
979 | 'false' => array('label' => __('Hidden', 'metaslider')), |
||
980 | 'true' => array('label' => __('Dots', 'metaslider')), |
||
981 | 'thumbnails' => array('label' => __('Thumbnails (Pro)', 'metaslider')) |
||
982 | ) |
||
983 | ) |
||
984 | ); |
||
985 | |||
986 | if ($max_tabs && count($this->all_meta_sliders()) > $max_tabs) { |
||
987 | $aFields['title'] = array( |
||
988 | 'type' => 'title', |
||
989 | 'priority' => 5, |
||
990 | 'class' => 'option flex nivo responsive coin', |
||
991 | 'value' => $title, |
||
992 | 'label' => __('Title', 'metaslider'), |
||
993 | 'helptext' => __('Slideshow title', 'metaslider') |
||
994 | ); |
||
995 | } |
||
996 | |||
997 | $aFields = apply_filters('metaslider_basic_settings', $aFields, $this->slider); |
||
998 | |||
999 | echo $this->build_settings_rows($aFields); ?> |
||
1000 | </tbody> |
||
1001 | </table> |
||
1002 | </div> |
||
1003 | </div> |
||
1004 | |||
1005 | <div class="postbox ms-toggle closed"> |
||
1006 | <div class="handlediv" title="Click to toggle"><br></div> |
||
1007 | <h3 class="hndle"><span><?php _e('Advanced Settings', 'metaslider') ?></span></h3> |
||
1008 | <div class="inside"> |
||
1009 | <table> |
||
1010 | <tbody> |
||
1011 | <?php |
||
1012 | $aFields = array( |
||
1013 | 'fullWidth' => array( |
||
1014 | 'priority' => 5, |
||
1015 | 'type' => 'checkbox', |
||
1016 | 'label' => __('Stretch', 'metaslider'), |
||
1017 | 'class' => 'option flex nivo responsive', |
||
1018 | 'after' => __('100% wide output', 'metaslider'), |
||
1019 | 'checked' => 'true' === $this->slider->get_setting('fullWidth') ? 'checked' : '', |
||
1020 | 'helptext' => __("Stretch the slideshow output to fill it's parent container", 'metaslider') |
||
1021 | ), |
||
1022 | 'center' => array( |
||
1023 | 'priority' => 10, |
||
1024 | 'type' => 'checkbox', |
||
1025 | 'label' => __('Center align', 'metaslider'), |
||
1026 | 'class' => 'option coin flex nivo responsive', |
||
1027 | 'checked' => 'true' === $this->slider->get_setting('center') ? 'checked' : '', |
||
1028 | 'helptext' => __('Center align the slideshow', 'metaslider') |
||
1029 | ), |
||
1030 | 'autoPlay' => array( |
||
1031 | 'priority' => 20, |
||
1032 | 'type' => 'checkbox', |
||
1033 | 'label' => __('Auto play', 'metaslider'), |
||
1034 | 'class' => 'option flex nivo responsive', |
||
1035 | 'checked' => 'true' === $this->slider->get_setting('autoPlay') ? 'checked' : '', |
||
1036 | 'helptext' => __('Transition between slides automatically', 'metaslider') |
||
1037 | ), |
||
1038 | 'smartCrop' => array( |
||
1039 | 'priority' => 30, |
||
1040 | 'type' => 'checkbox', |
||
1041 | 'label' => __('Smart crop', 'metaslider'), |
||
1042 | 'class' => 'option coin flex nivo responsive', |
||
1043 | 'checked' => 'true' === $this->slider->get_setting('smartCrop') ? 'checked' : '', |
||
1044 | 'helptext' => __('Smart Crop ensures your responsive slides are cropped to a ratio that results in a consistent slideshow size', 'metaslider') |
||
1045 | ), |
||
1046 | 'carouselMode' => array( |
||
1047 | 'priority' => 40, |
||
1048 | 'type' => 'checkbox', |
||
1049 | 'label' => __('Carousel mode', 'metaslider'), |
||
1050 | 'class' => 'option flex', |
||
1051 | 'checked' => 'true' === $this->slider->get_setting('carouselMode') ? 'checked' : '', |
||
1052 | 'helptext' => __('Display multiple slides at once. Slideshow output will be 100% wide.', 'metaslider') |
||
1053 | ), |
||
1054 | 'random' => array( |
||
1055 | 'priority' => 50, |
||
1056 | 'type' => 'checkbox', |
||
1057 | 'label' => __('Random', 'metaslider'), |
||
1058 | 'class' => 'option coin flex nivo responsive', |
||
1059 | 'checked' => 'true' === $this->slider->get_setting('random') ? 'checked' : '', |
||
1060 | 'helptext' => __('Randomise the order of the slides', 'metaslider') |
||
1061 | ), |
||
1062 | 'hoverPause' => array( |
||
1063 | 'priority' => 60, |
||
1064 | 'type' => 'checkbox', |
||
1065 | 'label' => __('Hover pause', 'metaslider'), |
||
1066 | 'class' => 'option coin flex nivo responsive', |
||
1067 | 'checked' => 'true' === $this->slider->get_setting('hoverPause') ? 'checked' : '', |
||
1068 | 'helptext' => __('Pause the slideshow when hovering over slider, then resume when no longer hovering.', 'metaslider') |
||
1069 | ), |
||
1070 | 'reverse' => array( |
||
1071 | 'priority' => 70, |
||
1072 | 'type' => 'checkbox', |
||
1073 | 'label' => __('Reverse', 'metaslider'), |
||
1074 | 'class' => 'option flex', |
||
1075 | 'checked' => 'true' === $this->slider->get_setting('reverse') ? 'checked' : '', |
||
1076 | 'helptext' => __('Reverse the animation direction', 'metaslider') |
||
1077 | ), |
||
1078 | 'delay' => array( |
||
1079 | 'priority' => 80, |
||
1080 | 'type' => 'number', |
||
1081 | 'size' => 3, |
||
1082 | 'min' => 500, |
||
1083 | 'max' => 10000, |
||
1084 | 'step' => 100, |
||
1085 | 'value' => $this->slider->get_setting('delay'), |
||
1086 | 'label' => __('Slide delay', 'metaslider'), |
||
1087 | 'class' => 'option coin flex responsive nivo', |
||
1088 | 'helptext' => __('How long to display each slide, in milliseconds', 'metaslider'), |
||
1089 | 'after' => __('ms', 'metaslider') |
||
1090 | ), |
||
1091 | 'animationSpeed' => array( |
||
1092 | 'priority' => 90, |
||
1093 | 'type' => 'number', |
||
1094 | 'size' => 3, |
||
1095 | 'min' => 0, |
||
1096 | 'max' => 2000, |
||
1097 | 'step' => 100, |
||
1098 | 'value' => $this->slider->get_setting('animationSpeed'), |
||
1099 | 'label' => __('Animation speed', 'metaslider'), |
||
1100 | 'class' => 'option flex responsive nivo', |
||
1101 | 'helptext' => __('Set the speed of animations, in milliseconds', 'metaslider'), |
||
1102 | 'after' => __('ms', 'metaslider') |
||
1103 | ), |
||
1104 | 'slices' => array( |
||
1105 | 'priority' => 100, |
||
1106 | 'type' => 'number', |
||
1107 | 'size' => 3, |
||
1108 | 'min' => 0, |
||
1109 | 'max' => 20, |
||
1110 | 'step' => 1, |
||
1111 | 'value' => $this->slider->get_setting('slices'), |
||
1112 | 'label' => __('Number of slices', 'metaslider'), |
||
1113 | 'class' => 'option nivo', |
||
1114 | 'helptext' => __('Number of slices', 'metaslider'), |
||
1115 | 'after' => __('ms', 'metaslider') |
||
1116 | ), |
||
1117 | 'spw' => array( |
||
1118 | 'priority' => 110, |
||
1119 | 'type' => 'number', |
||
1120 | 'size' => 3, |
||
1121 | 'min' => 0, |
||
1122 | 'max' => 20, |
||
1123 | 'step' => 1, |
||
1124 | 'value' => $this->slider->get_setting('spw'), |
||
1125 | 'label' => __('Number of squares', 'metaslider') . ' (' . __('Width', 'metaslider') . ')', |
||
1126 | 'class' => 'option nivo', |
||
1127 | 'helptext' => __('Number of squares', 'metaslider'), |
||
1128 | 'after' => '' |
||
1129 | ), |
||
1130 | 'sph' => array( |
||
1131 | 'priority' => 120, |
||
1132 | 'type' => 'number', |
||
1133 | 'size' => 3, |
||
1134 | 'min' => 0, |
||
1135 | 'max' => 20, |
||
1136 | 'step' => 1, |
||
1137 | 'value' => $this->slider->get_setting('sph'), |
||
1138 | 'label' => __('Number of squares', 'metaslider') . ' (' . __('Height', 'metaslider') . ')', |
||
1139 | 'class' => 'option nivo', |
||
1140 | 'helptext' => __('Number of squares', 'metaslider'), |
||
1141 | 'after' => '' |
||
1142 | ), |
||
1143 | 'direction' => array( |
||
1144 | 'priority' => 130, |
||
1145 | 'type' => 'select', |
||
1146 | 'label' => __('Slide direction', 'metaslider'), |
||
1147 | 'class' => 'option flex', |
||
1148 | 'helptext' => __('Select the sliding direction', 'metaslider'), |
||
1149 | 'value' => $this->slider->get_setting('direction'), |
||
1150 | 'options' => array( |
||
1151 | 'horizontal' => array('label' => __('Horizontal', 'metaslider'), 'class' => ''), |
||
1152 | 'vertical' => array('label' => __('Vertical', 'metaslider'), 'class' => '') |
||
1153 | ) |
||
1154 | ), |
||
1155 | 'easing' => array( |
||
1156 | 'priority' => 140, |
||
1157 | 'type' => 'select', |
||
1158 | 'label' => __('Easing', 'metaslider'), |
||
1159 | 'class' => 'option flex', |
||
1160 | 'helptext' => __('Animation easing effect', 'metaslider'), |
||
1161 | 'value' => $this->slider->get_setting('easing'), |
||
1162 | 'options' => $this->get_easing_options() |
||
1163 | ), |
||
1164 | 'prevText' => array( |
||
1165 | 'priority' => 150, |
||
1166 | 'type' => 'text', |
||
1167 | 'label' => __('Previous text', 'metaslider'), |
||
1168 | 'class' => 'option coin flex responsive nivo', |
||
1169 | 'helptext' => __("Set the text for the 'previous' direction item", 'metaslider'), |
||
1170 | 'value' => 'false' === $this->slider->get_setting('prevText') ? '' : $this->slider->get_setting('prevText') |
||
1171 | ), |
||
1172 | 'nextText' => array( |
||
1173 | 'priority' => 160, |
||
1174 | 'type' => 'text', |
||
1175 | 'label' => __('Next text', 'metaslider'), |
||
1176 | 'class' => 'option coin flex responsive nivo', |
||
1177 | 'helptext' => __("Set the text for the 'next' direction item", 'metaslider'), |
||
1178 | 'value' => 'false' === $this->slider->get_setting('nextText') ? '' : $this->slider->get_setting('nextText') |
||
1179 | ), |
||
1180 | 'sDelay' => array( |
||
1181 | 'priority' => 170, |
||
1182 | 'type' => 'number', |
||
1183 | 'size' => 3, |
||
1184 | 'min' => 0, |
||
1185 | 'max' => 500, |
||
1186 | 'step' => 10, |
||
1187 | 'value' => $this->slider->get_setting('sDelay'), |
||
1188 | 'label' => __('Square delay', 'metaslider'), |
||
1189 | 'class' => 'option coin', |
||
1190 | 'helptext' => __('Delay between squares in ms', 'metaslider'), |
||
1191 | 'after' => __('ms', 'metaslider') |
||
1192 | ), |
||
1193 | 'opacity' => array( |
||
1194 | 'priority' => 180, |
||
1195 | 'type' => 'number', |
||
1196 | 'size' => 3, |
||
1197 | 'min' => 0, |
||
1198 | 'max' => 1, |
||
1199 | 'step' => 0.1, |
||
1200 | 'value' => $this->slider->get_setting('opacity'), |
||
1201 | 'label' => __('Opacity', 'metaslider'), |
||
1202 | 'class' => 'option coin', |
||
1203 | 'helptext' => __('Opacity of title and navigation', 'metaslider'), |
||
1204 | 'after' => '' |
||
1205 | ), |
||
1206 | 'titleSpeed' => array( |
||
1207 | 'priority' => 190, |
||
1208 | 'type' => 'number', |
||
1209 | 'size' => 3, |
||
1210 | 'min' => 0, |
||
1211 | 'max' => 10000, |
||
1212 | 'step' => 100, |
||
1213 | 'value' => $this->slider->get_setting('titleSpeed'), |
||
1214 | 'label' => __('Caption speed', 'metaslider'), |
||
1215 | 'class' => 'option coin', |
||
1216 | 'helptext' => __('Set the fade in speed of the caption', 'metaslider'), |
||
1217 | 'after' => __('ms', 'metaslider') |
||
1218 | ), |
||
1219 | 'developerOptions' => array( |
||
1220 | 'priority' => 195, |
||
1221 | 'type' => 'divider', |
||
1222 | 'class' => 'option coin flex responsive nivo', |
||
1223 | 'value' => __('Developer options', 'metaslider') |
||
1224 | ), |
||
1225 | 'cssClass' => array( |
||
1226 | 'priority' => 200, |
||
1227 | 'type' => 'text', |
||
1228 | 'label' => __('CSS classes', 'metaslider'), |
||
1229 | 'class' => 'option coin flex responsive nivo', |
||
1230 | 'helptext' => __('Specify any custom CSS Classes you would like to be added to the slider wrapper', 'metaslider'), |
||
1231 | 'value' => 'false' === $this->slider->get_setting('cssClass') ? '' : $this->slider->get_setting('cssClass') |
||
1232 | ), |
||
1233 | 'printCss' => array( |
||
1234 | 'priority' => 210, |
||
1235 | 'type' => 'checkbox', |
||
1236 | 'label' => __('Print CSS', 'metaslider'), |
||
1237 | 'class' => 'option coin flex responsive nivo useWithCaution', |
||
1238 | 'checked' => 'true' === $this->slider->get_setting('printCss') ? 'checked' : '', |
||
1239 | 'helptext' => __('Uncheck this is you would like to include your own CSS', 'metaslider') |
||
1240 | ), |
||
1241 | 'printJs' => array( |
||
1242 | 'priority' => 220, |
||
1243 | 'type' => 'checkbox', |
||
1244 | 'label' => __('Print JS', 'metaslider'), |
||
1245 | 'class' => 'option coin flex responsive nivo useWithCaution', |
||
1246 | 'checked' => 'true' === $this->slider->get_setting('printJs') ? 'checked' : '', |
||
1247 | 'helptext' => __('Uncheck this is you would like to include your own Javascript', 'metaslider') |
||
1248 | ), |
||
1249 | 'noConflict' => array( |
||
1250 | 'priority' => 230, |
||
1251 | 'type' => 'checkbox', |
||
1252 | 'label' => __('No conflict mode', 'metaslider'), |
||
1253 | 'class' => 'option flex', |
||
1254 | 'checked' => 'true' === $this->slider->get_setting('noConflict') ? 'checked' : '', |
||
1255 | 'helptext' => __('Delay adding the flexslider class to the slideshow', 'metaslider') |
||
1256 | ) |
||
1257 | ); |
||
1258 | |||
1259 | $aFields = apply_filters('metaslider_advanced_settings', $aFields, $this->slider); |
||
1260 | |||
1261 | echo $this->build_settings_rows($aFields); ?> |
||
1262 | </tbody> |
||
1263 | </table> |
||
1264 | </div> |
||
1265 | </div> |
||
1266 | |||
1267 | <div class="postbox shortcode ms-toggle"> |
||
1268 | <div class="handlediv" title="Click to toggle"><br></div> |
||
1269 | <h3 class="hndle"><span><?php _e('Usage', 'metaslider') ?></span></h3> |
||
1270 | <div class="inside"> |
||
1271 | <ul class='tabs'> |
||
1272 | <li rel='tab-1' class='selected'><?php _e('Shortcode', 'metaslider') ?></li> |
||
1273 | <li rel='tab-2'><?php _e('Template Include', 'metaslider') ?></li> |
||
1274 | </ul> |
||
1275 | <div class='tabs-content'> |
||
1276 | <div class='tab tab-1'> |
||
1277 | <p><?php _e('Copy & paste the shortcode directly into any WordPress post or page.', 'metaslider'); ?></p> |
||
1278 | <input readonly='readonly' type='text' value='[metaslider id=<?php echo $this->slider->id ?>]'></div> |
||
1279 | <div class='tab tab-2' style='display: none'> |
||
1280 | <p><?php _e('Copy & paste this code into a template file to include the slideshow within your theme.', 'metaslider'); ?></p> |
||
1281 | <textarea readonly='readonly'><?php echo do_shortcode("[metaslider id=<?php echo $this->slider->id ?>]"); ?></textarea></div> |
||
1282 | </div> |
||
1283 | </div> |
||
1284 | </div> |
||
1285 | |||
1286 | <div class="postbox social"> |
||
1287 | <div class="inside"> |
||
1288 | <ul class='info'> |
||
1289 | <li style='width: 33%;'> |
||
1290 | <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.metaslider.com" data-text="Check out Meta Slider, an easy to use slideshow plugin for WordPress" data-hashtags="metaslider, wordpress, slideshow">Tweet</a> |
||
1291 | <script>!function (d, s, id) { |
||
1292 | var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; |
||
1293 | if (!d.getElementById(id)) { |
||
1294 | js = d.createElement(s); |
||
1295 | js.id = id; |
||
1296 | js.src = p + '://platform.twitter.com/widgets.js'; |
||
1297 | fjs.parentNode.insertBefore(js, fjs); |
||
1298 | } |
||
1299 | }(document, 'script', 'twitter-wjs');</script> |
||
1300 | </li> |
||
1301 | <li style='width: 34%;'> |
||
1302 | <div class="g-plusone" data-size="medium" data-href="http://www.metaslider.com"></div> |
||
1303 | <script type="text/javascript"> |
||
1304 | (function () { |
||
1305 | var po = document.createElement('script'); |
||
1306 | po.type = 'text/javascript'; |
||
1307 | po.async = true; |
||
1308 | po.src = 'https://apis.google.com/js/plusone.js'; |
||
1309 | var s = document.getElementsByTagName('script')[0]; |
||
1310 | s.parentNode.insertBefore(po, s); |
||
1311 | })(); |
||
1312 | </script> |
||
1313 | </li> |
||
1314 | <li style='width: 33%;'> |
||
1315 | <iframe style='border:none; overflow:hidden; width:80px; height:21px;' |
||
1316 | src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.metaslider.com&send=false&layout=button_count&width=90&show_faces=false&font&colorscheme=light&action=like&height=21&appId=156668027835524" |
||
1317 | scrolling="no" frameborder="0" allowTransparency="true"></iframe> |
||
1318 | </li> |
||
1319 | </ul> |
||
1320 | </div> |
||
1321 | </div> |
||
1322 | <a class='delete-slider alignright button-secondary confirm' href='<?php echo wp_nonce_url("?page=metaslider&delete={$this->slider->id}", 'metaslider_delete_slider'); ?>'><?php _e('Delete Slider', 'metaslider') ?></a> |
||
1323 | </div> |
||
1324 | </div> |
||
1325 | </div> |
||
1326 | </div> |
||
1327 | </div> |
||
1328 | </form> |
||
1329 | </div> |
||
1330 | <?php |
||
1331 | } |
||
1332 | |||
1401 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.