Changeset 3055603
- Timestamp:
- 03/20/2024 08:14:46 PM (2 years ago)
- Location:
- petmatchpro/trunk
- Files:
-
- 2 added
- 10 edited
-
CHANGE-LOG.docx (modified) (previous)
-
CHANGE-LOG.pdf (modified) (previous)
-
CHANGE-LOG.txt (modified) (1 diff)
-
README.txt (modified) (1 diff)
-
admin/class-pet-match-pro-admin-settings.php (modified) (43 diffs)
-
admin/partials/pmp-admin-info.php (modified) (1 diff)
-
admin/partials/pmp-option-levels-color.php (added)
-
includes/class-pet-match-pro.php (modified) (1 diff)
-
includes/pp/class-pet-match-pro-pp-api.php (modified) (18 diffs)
-
includes/rg/class-pet-match-pro-rg-api.php (modified) (7 diffs)
-
pet-match-pro.php (modified) (2 diffs)
-
public/partials/pet-match-pro-public-color-css.php (added)
Legend:
- Unmodified
- Added
- Removed
-
petmatchpro/trunk/CHANGE-LOG.txt
r3053866 r3055603 1 Version 4.7.1 - March 20, 2024 2 + /admin/class-pet-match-pro-admin-settings.php 3 * Add Colors tab to simplify the customization of the front-end. 4 + /admin/partials/pmp-option-levels-color.php 5 * New file for Admin Colors tab. 6 + /admin/partials/pmp-admin-info.php 7 * Add help text for Colors tab. 8 + /includes/class-pet-match-pro.php 9 * Register the new Colors tab. 10 + /public/partials/pet-match-pro-public-color-css.php 11 * New file to set color styles from Colors tab. 12 + /includes/rg/class-pet-match-pro-rg-api.php 13 * Update to include the color styles for search and detail output. 14 * Correct issue with formatting of search results. 15 + /includes/pp/class-pet-match-pro-pp-api.php 16 * Update to include the color styles for search and detail output. 17 1 18 Version 4.6.5- March 18, 2024 2 19 + /includes/pp/class-pet-match-pro-pp-api.php -
petmatchpro/trunk/README.txt
r3053866 r3055603 6 6 Requires at least: 5.0 7 7 Tested up to: 6.4 8 Stable tag: 4. 6.58 Stable tag: 4.7.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
petmatchpro/trunk/admin/class-pet-match-pro-admin-settings.php
r3053008 r3055603 42 42 public $pmpLicenseKey; 43 43 public $generalOptions; 44 public $integration_partner; 45 46 /* Start by Prolific 10/31/2022 to Resolve Issue w/ Headings on Labels Tab */ 47 // public function label_element_filter_details() { 48 // return; 49 // } 50 51 // public function label_element_search_title() { 52 // return; 53 // } 54 /* End Prolific 10/31/2022 to Resolve Issue w/ Headings on Labels Tab */ 44 public $colorOptions; 55 45 56 46 public function instruction_title() { … … 64 54 $this->pmpLicenseKey = get_option("PMP_lic_Key", ""); 65 55 $liceEmail = get_option("PMP_lic_email", ""); 56 66 57 PetMatchProBase::addOnDelete(function () { 67 58 delete_option('PMP_lic_Key'); … … 72 63 $this->generalOptions = get_option('pet-match-pro-general-options'); 73 64 $this->integrationPartner = $this->generalOptions['integration_partner']; 74 //echo 'Integration Partner is ' . $this->integrationPartner . '<br>'; 75 65 //echo 'Integration Partner is ' . $this->integrationPartner . '<br>'; 66 67 $this->colorOptions = get_option('pet-match-pro-color-options'); 68 76 69 if (PetMatchProBase::CheckWPPlugin($this->pmpLicenseKey, $liceEmail, $this->licenseMessage, $this->responseObj, PET_MATCH_PRO_PATH_FILE)) { 77 //add_action('admin_menu', [$this, 'ActiveAdminMenu'], 99999);78 //add_action('admin_post_PetMatchPro_el_deactivate_license', [$this, 'action_deactivate_license']);79 //$this->licenselMessage=$this->mess;80 //***Write you plugin's code here***81 70 add_action('admin_menu', [$this, 'setup_plugin_options_menu_active']); 82 71 add_action('admin_post_PetMatchPro_el_deactivate_license', [$this, 'action_deactivate_license']); … … 98 87 add_action('PMP_activate_lic', [$this, 'action_activate_license']); 99 88 add_action('admin_post_PMP_activate_license', [$this, 'action_activate_license']); 100 /* Register Label Initialization Function */101 // if ($this->integrationPartner == constant('PETPOINT')) {102 // add_action('initialize_label_options', [Pet_Match_Pro_PP_Options, 'initialize_label_options']);103 // } elseif ($this->integrationPartner == constant('RESCUEGROUPS')) {104 // add_action('initialize_label_options', [Pet_Match_Pro_RG_Options, 'initialize_label_options']);105 // }106 89 $this->pmp_activated = false; 107 90 update_option('PMP_License_Type', ""); … … 109 92 $this->PMPLicenseTypeID = (int) get_option('PMP_License_Type_ID'); 110 93 } 111 //$this->api_activated = $api_activated;112 //if ( empty($this->PMPLicenseTypeID) ) {113 // $this->PMPLicenseTypeID = constant('FREE_LEVEL');114 //}115 94 if ( $this->PMPLicenseTypeID == 0 ) { 116 95 $this->PMPLicenseTypeID = constant('FREE_LEVEL'); … … 135 114 } 136 115 //echo 'Require File = ' . $requireFile . '<br>'; 137 //die;138 116 require($requireFile); 139 // include_once($requireFile);140 117 //echo '<pre>INFO SETTINGS'; print_r($pmpAdminInfo); echo '</pre>'; 141 118 } … … 144 121 */ 145 122 public function setup_plugin_options_menu_active() { 146 //$logoPath = constant("PET_MATCH_PRO_PATH") . '/assets/icon-256x256.png';147 123 $logoPath = plugins_url('petmatchpro/' . constant('ASSETS_DIR') . '/' . 'icon-25x25.png'); 148 124 add_menu_page( … … 207 183 } else if ($active_tab == 'label_options') { 208 184 $active_tab = 'label_options'; 185 } else if ($active_tab == 'color_options') { 186 $active_tab = 'color_options'; 209 187 } else if ($active_tab == 'instructions') { 210 188 $active_tab = 'instructions'; … … 222 200 <a href="?page=pet-match-pro-options&subpage=label_options" 223 201 class="nav-tab <?php echo $active_tab == 'label_options' ? 'nav-tab-active' : ''; ?>"><?php _e('Labels', 'pet-match-pro-plugin'); ?></a> 202 <a href="?page=pet-match-pro-options&subpage=color_options" 203 class="nav-tab <?php echo $active_tab == 'color_options' ? 'nav-tab-active' : ''; ?>"><?php _e('Colors', 'pet-match-pro-plugin'); ?></a> 224 204 <a href="?page=pet-match-pro-options&subpage=instructions" 225 205 class="nav-tab <?php echo $active_tab == 'instructions' ? 'nav-tab-active' : ''; ?>"><?php _e('Instructions', 'pet-match-pro-plugin'); ?></a> … … 251 231 ); 252 232 //Based on the Partner API load filter options 253 // $partner_api = $general_options['integration_partner'];254 233 if ($this->integrationPartner == constant('PETPOINT')) { 255 // if ($partner_api == 'PetPoint') {256 234 //all petpoint callback here 257 //echo 'PetPoint';258 //$this->initialize_filter_options();259 // $ppfilterOptions = new Pet_Match_Pro_PP_Options($this->pmp_activated);260 // $ppfilterOptions->api_activated = $this->pmp_activated;261 235 echo $ppOptions->initialize_filter_options(); 262 // echo $ppfilterOptions->initialize_filter_options();263 //settings_fields( 'pet-match-pro-filter-options' );264 //do_settings_sections( 'pet-match-pro-filter-options' );265 236 submit_button('Save Filters'); 266 237 } elseif ($this->integrationPartner == constant('RESCUEGROUPS')) { 267 238 //all RescueGroups callback here 268 //echo 'RescueGroups';269 //$this->initialize_filter_options();270 // $rgfilterOptions = new Pet_Match_Pro_RG_Options($this->pmp_activated);271 // $rgfilterOptions = new Pet_Match_Pro_RG_Options($this->pmp_activated);272 // $rgfilterOptions->api_activated = $this->pmp_activated;273 239 echo $rgOptions->initialize_filter_options(); 274 // echo $rgfilterOptions->initialize_filter_options();275 //settings_fields( 'pet-match-pro-filter-options' );276 //do_settings_sections( 'pet-match-pro-filter-options' );277 240 submit_button('Save Filters'); 278 241 } else { … … 295 258 'pet-match-pro-label-options' 296 259 ); 297 // $this->initialize_label_options();298 // settings_fields('pet-match-pro-label-options');299 // do_settings_sections('pet-match-pro-label-options');300 // submit_button('Save Labels');301 302 // $includePath = constant("PET_MATCH_PRO_PATH") . '/' . constant('INCLUDE_DIR') . '/';303 // $requireFile = 'class-pet-match-pro-';304 260 if ($this->integrationPartner == constant('PETPOINT')) { 305 // $includePath = $includePath . constant('PETPOINT_DIR') . '/';306 // echo 'PetPoint Include Path is ' . $includePath . '<br>';307 // $requireFile = $requireFile . constant('PETPOINT_DIR') . '-option.php';308 // require $requireFile;309 // $pplabelOptions = new Pet_Match_Pro_PP_Options($this->pmp_activated);310 // $pplabelOptions->api_activated = $this->pmp_activated;311 261 echo $ppOptions->initialize_label_options(); 312 // echo $pplabelOptions->initialize_label_options();313 //settings_fields( 'pet-match-pro-filter-options' );314 //do_settings_sections( 'pet-match-pro-filter-options' );315 262 submit_button('Save Labels'); 316 263 } elseif ($this->integrationPartner == constant('RESCUEGROUPS')) { 317 // $includePath = $includePath . constant('RESCUEGROUPS_DIR') . '/';318 // echo 'PetPoint Include Path is ' . $includePath . '<br>';319 // $requireFile = $requireFile . constant('RESCUEGROUPS_DIR') . '-option.php';320 // require $requireFile;321 // $rglabelOptions = new Pet_Match_Pro_RG_Options($this->pmp_activated);322 // $rglabelOptions->api_activated = $this->pmp_activated;323 264 echo $rgOptions->initialize_label_options(); 324 // echo $rglabelOptions->initialize_label_options();325 //settings_fields( 'pet-match-pro-filter-options' );326 //do_settings_sections( 'pet-match-pro-filter-options' );327 265 submit_button('Save Labels'); 328 266 } else { … … 330 268 echo 'Select a Partner API from the General Options tab to load label options.'; 331 269 } 270 } elseif ($active_tab == 'color_options') { 271 register_setting( 272 'pet-match-pro-color-options', 273 'pet-match-pro-color-options' 274 ); 275 $this->initialize_color_options(); 276 settings_fields('pet-match-pro-color-options'); 277 do_settings_sections('pet-match-pro-color-options'); 278 submit_button('Save Colors'); 332 279 } elseif ($active_tab == 'instructions') { 333 280 register_setting( … … 347 294 $options = get_option('pet-match-pro-general-options'); 348 295 //var_dump($options); 349 return '<p>' . __('General configuration to make things run', 'pet-match-pro-plugin') . '</p>';350 } // end general_options_callback296 return '<p>' . __('General PetMatchPro Configuration', 'pet-match-pro-plugin') . '</p>'; 297 } 351 298 352 // public function filter_options_callback() {353 // $options = get_option('pet-match-pro-filter-options');354 //var_dump($options);355 // return '<p>' . __('Settings to filter and display search results', 'pet-match-pro-plugin') . '</p>';356 // } // end general_options_callback357 358 299 public function contact_options_callback() { 359 300 $options = get_option('pet-match-pro-contact-options'); 360 301 //var_dump($options); 361 return '<p>' . __('Settings for contact options', 'pet-match-pro-plugin') . '</p>'; 302 return '<p>' . __('Settings for Contact Options', 'pet-match-pro-plugin') . '</p>'; 303 } 304 305 public function color_options_callback() { 306 $options = get_option('pet-match-pro-color-options'); 307 //var_dump($options); 308 return '<p>' . __('Settings for Color Options', 'pet-match-pro-plugin') . '</p>'; 362 309 } // end general_options_callback 310 363 311 364 312 public function instructions_callback() { 365 313 $options = get_option('pet-match-pro-instructions'); 366 314 //var_dump($options); 367 return '<p>' . __(' Settings for customize instructions', 'pet-match-pro-plugin') . '</p>';315 return '<p>' . __('View PetMatchPro Instructions', 'pet-match-pro-plugin') . '</p>'; 368 316 } // end general_options_callback 369 317 … … 411 359 'integration_partner', 412 360 Pet_Match_Pro_Public::$integrationPartners, 413 // array('PetPoint' => 'PetPoint', 'RescueGroups' => 'RescueGroups'),414 361 $this->pmpAdminInfo['integration_partner'], 415 362 'class' => $generalOptionsClass … … 458 405 array('N' => 'No', 'Y' => 'Yes', 'A' => 'Either'), 459 406 $helpText, 460 // $this->pmpAdminInfo['on_hold_status'],461 407 'class' => $generalOptionsClass 462 408 ) … … 479 425 'organization_id', 480 426 $helpText, 481 // $this->pmpAdminInfo['organization_id'],482 427 'class' => $generalOptionsClass 483 428 ) … … 505 450 'search_result_limit', 506 451 $helpText, 507 // $this->pmpAdminInfo['search_result_limit'],508 452 'class' => $generalOptionsClass 509 453 ) … … 539 483 'order_by', 540 484 $orderidValues, 541 // array('Breed' => 'Breed', 'ID' => 'ID', 'Name' => 'Name', 'Sex' => 'Sex'),542 485 $this->pmpAdminInfo['order_by'], 543 486 'class' => $generalOptionsClass … … 560 503 } 561 504 562 // if ( $this->integrationPartner == constant('RESCUEGROUPS') ) {563 // $sortOrderKey = constant('LEVEL_PREFIX_SEARCH_OPTION_VALUE') . $sortOrderField . '_adopt';564 // $sortOderValues = $pmpFieldValuesAdopt[$sortOrderKey];565 566 505 add_settings_field( 567 506 'sort_order', … … 577 516 ) 578 517 ); 579 // }580 518 581 519 /* New Setting to Control Display of Orderby Labels */ … … 671 609 ) 672 610 ); 673 674 //echo 'level_search_icon_fields_adopt = ' . $pmpOptionLevelsGeneral['level_search_icon_fields_adopt'] . '<br>'; 675 /* if ( (array_key_exists('level_search_icon_fields_adopt', $pmpOptionLevelsGeneral)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsGeneral['level_search_icon_fields_adopt']) && (!empty($this->pmpLicenseKey)) && ($showSearchIcons != '') ) { 676 //echo 'Enable level_search_icon_fields_adopt<br>'; 677 $classSearchIcons = 'pmp-search-icons-adopt'; 678 } else { 679 //echo 'Disable level_search_icon_fields_adopt<br>'; 680 $classSearchIcons = 'pmp-option-disable'; 681 } 682 683 add_settings_field( 684 'adoptable_animal_search_icon_fields', 685 __( 'Show Data Fields with Icons?', 'pet-match-pro-plugin' ), 686 array( $this, 'checkbox_element_callback'), 687 'pet-match-pro-general-options', 688 'general_settings_section', 689 array('pet-match-pro-general-options', 690 'adoptable_animal_search_icon_fields', 691 array('Enable' => 'Show Data Fields with Icons on Search Results'), 692 $this->pmpRGAdminInfo['adoptable_animal_search_icon_fields'], 693 'class' => $classSearchIcons 694 ) 695 ); 696 */ 697 698 // if ( (array_key_exists('level_detail_thumbnails', $pmpOptionLevelsGeneral)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsGeneral['level_detail_thumbnails']) && (!empty($this->pmpLicenseKey)) ) { 699 // $generalOptionsClass = 'pmp-general-option'; 700 // } else { 701 // $generalOptionsClass = 'pmp-option-disable'; 702 // } 703 704 // add_settings_field( 705 // 'detail_thumbnails', 706 // __('Thumbnails on Detail ', 'pet-match-pro-plugin'), 707 // array($this, 'select_element_callback'), 708 // 'pet-match-pro-general-options', 709 // 'general_settings_section', 710 // array('pet-match-pro-general-options', 711 // 'detail_thumbnails', 712 // array('0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6'), 713 // $this->pmpAdminInfo['detail_thumbnails'], 714 // 'class' => $generalOptionsClass 715 // ) 716 // ); 717 611 718 612 //echo 'level_animal_detail_icons_adopt = ' . $pmpOptionLevelsGeneral['level_animal_detail_icons_adopt'] . '<br>'; 719 613 if ( (array_key_exists('level_animal_detail_icons_adopt', $pmpOptionLevelsGeneral)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsGeneral['level_animal_detail_icons_adopt']) && (!empty($this->pmpLicenseKey)) ) { … … 735 629 array('Enable' => 'Show Icons on Animal Details'), 736 630 $this->pmpAdminInfo['adoptable_animal_detail_icons'], 737 // $active,738 631 'class' => $classDetailIcons 739 632 ) … … 831 724 832 725 //scan directory 833 //$templates = array_diff(scandir(plugin_dir_path(dirname(__FILE__)) . 'public/templates/pp/'), array('..', '.'));834 726 /* RMB - Check if Child Directory Exists, Otherwise Set to Plugin Default */ 835 727 $general_options = get_option('pet-match-pro-general-options'); 836 $this->integration_partner = $general_options['integration_partner'];837 728 $templateDir = constant('TEMPLATES_DIR') . '/'; 838 729 //$templateDir = 'templates/'; 839 if ($this->integration_partner == constant('PETPOINT')) { 840 //if($this->integration_partner == 'PetPoint'){ 730 if ($this->integrationPartner == constant('PETPOINT')) { 841 731 $templateDir = $templateDir . constant('PETPOINT_DIR') . '/'; 842 // $templateDir = $templateDir . 'pp/'; 843 } elseif ($this->integration_partner == constant('RESCUEGROUPS')) { 732 } elseif ($this->integrationPartner == constant('RESCUEGROUPS')) { 844 733 $templateDir = $templateDir . constant('RESCUEGROUPS_DIR') . '/'; 845 734 } … … 849 738 //echo 'Free License ID Level is ' . FreeLevel . '<br>'; 850 739 if ( (is_dir(get_stylesheet_directory(dirname(__FILE__)) . '/petmatchpro/' . $templateDir)) && ($this->PMPLicenseTypeID != constant('FREE_LEVEL') ) ) { /* RMB - Paid Feature */ 851 // if ( (is_dir(get_stylesheet_directory(dirname(__FILE__)) . '/petmatchpro/' . $templateDir)) && ($this->PMPLicenseTypeID != FreeLevel) ) { /* RMB - Paid Feature */852 740 $templateDir = get_stylesheet_directory(dirname(__FILE__)) . '/petmatchpro/' . $templateDir; 853 741 //echo 'Template Director is ' . $templateDir . '<br>'; … … 855 743 } elseif ($this->PMPLicenseTypeID != constant('FREE_LEVEL')) { 856 744 $templateDir = constant("PET_MATCH_PRO_PATH") . '/' . constant('PUBLIC_DIR') . '/' . $templateDir; 857 // $templateDir = constant("PET_MATCH_PRO_PATH") . '/public/' . $templateDir;858 745 $templates = array_diff(scandir($templateDir), array('..', '.')); 859 746 } else { … … 882 769 array('pet-match-pro-general-options', 883 770 'details_template_adopt', 884 // 'adoptable_details_template',885 771 $templateVals, 886 772 $this->pmpAdminInfo['details_template_adopt'], 887 // $pmpAdminInfo['adoptable_details_template'],888 773 'class' => $generalOptionsClass 889 774 ) … … 911 796 array('pet-match-pro-general-options', 912 797 'details_template_lost', 913 // 'lost_details_template',914 798 $templateVals, 915 799 $this->pmpAdminInfo['details_template_lost'], 916 // $pmpAdminInfo['lost_details_template'],917 800 'class' => $generalOptionsClass 918 801 ) … … 941 824 array('pet-match-pro-general-options', 942 825 'details_template_found', 943 // 'found_details_template',944 826 $templateVals, 945 827 $this->pmpAdminInfo['details_template_found'], 946 // $pmpAdminInfo['found_details_template'],947 828 'class' => $generalOptionsClass 948 829 ) … … 1140 1021 array('pet-match-pro-general-options', 1141 1022 'no_search_results_adopt', 1142 // 'no_animals_found',1143 1023 $this->pmpAdminInfo['no_search_results_adopt'], 1144 // $pmpAdminInfo['no_animals_found'],1145 1024 'class' => $generalOptionsClass 1146 1025 ) … … 1168 1047 array('pet-match-pro-general-options', 1169 1048 'no_search_results_lost', 1170 // 'lost_no_animals_found',1171 1049 $this->pmpAdminInfo['no_search_results_lost'], 1172 // $pmpAdminInfo['lost_no_animals_found'],1173 1050 'class' => $generalOptionsClass 1174 1051 ) … … 1197 1074 array('pet-match-pro-general-options', 1198 1075 'no_search_results_found', 1199 // 'found_no_animals_found',1200 1076 $this->pmpAdminInfo['no_search_results_found'], 1201 // $pmpAdminInfo['found_no_animals_found'],1202 1077 'class' => $generalOptionsClass 1203 1078 ) … … 1226 1101 array('pet-match-pro-general-options', 1227 1102 'no_search_results_featured', 1228 // 'featured_no_animals_found',1229 1103 $this->pmpAdminInfo['no_search_results_featured'], 1230 // $pmpAdminInfo['featured_no_animals_found'],1231 1104 'class' => $generalOptionsClass 1232 1105 ) … … 1239 1112 $generalOptionsClass = 'pmp-option-disable'; 1240 1113 } 1241 1242 // if ( $this->integrationPartner == constant('RESCUEGROUPS') ) { 1243 // $valuesFile = 'pmp-field-values-adopt.php'; 1244 // $requireFile = constant("PET_MATCH_PRO_PATH") . '/' . constant('INCLUDE_DIR') . '/' . constant('RESCUEGROUPS_DIR') . '/' . constant('PARTIALS_DIR') . '/' . $valuesFile; 1245 //echo 'Require File = ' . $requireFile . '<br>'; 1246 // require($requireFile); 1247 1248 // $descriptions = array(); 1249 // foreach ($pmpFieldValuesAdopt as $key=>$value) { 1250 //echo 'Processing Key ' . $key . '<br>'; 1251 // if (strpos($key, 'animaldescription') !== false) { 1252 // $field = str_replace('label_detail_', '', $key); 1253 // $field = str_replace('_adopt', '' , $field); 1254 // $descriptions[$field] = $value; 1255 // } 1256 // } 1257 //echo '<pre>DESCRIPTION FIELDS<br>'; print_r($descriptions); echo'</pre>'; 1258 1259 // add_settings_field( 1260 // 'description_field', 1261 // __('Animal Description Field', 'pet-match-pro-plugin'), 1262 // array($this, 'select_element_callback'), 1263 // 'pet-match-pro-general-options', 1264 // 'general_settings_section', 1265 // array('pet-match-pro-general-options', 1266 // 'description_field', 1267 // $descriptions, 1268 // $this->pmpAdminInfo['description_field'], 1269 // 'class' => $generalOptionsClass 1270 // ) 1271 // ); 1272 // } 1273 1114 1274 1115 add_settings_field( 1275 1116 'Default Animal Description ', … … 1310 1151 } 1311 1152 1312 public function initialize_contact_options() { 1313 /*add_settings_section( 1314 'contact_settings_section', 1315 '', 1316 array($this, 'contact_options_callback'), 1317 'pet-match-pro-contact-options' 1318 );*/ 1319 1153 public function initialize_contact_options() { 1320 1154 add_settings_section( 1321 1155 'contact_settings_section', // ID used to identify this section and with which to register options … … 1324 1158 'pet-match-pro-contact-options' // Page on which to add this section of options 1325 1159 ); 1326 1327 // $licenseKey = get_option('PMP_lic_Key');1328 //echo 'License Key = ' . $licenseKey . '<br>';1329 1330 /* Get Info Text for Use as Title Text in Settings */1331 // $homeDir = get_home_path();1332 1333 // $generalOptions = get_option('pet-match-pro-general-options');1334 // $integrationPartner = $generalOptions['integration_partner'];1335 //echo 'Integration Partner = ' . $integrationPartner . '<br>';1336 1337 // $partnerDir = '';1338 // if ($this->integrationPartner == constant('PETPOINT')) {1339 // $partnerDir = constant('PETPOINT_DIR');1340 // } elseif ($this->$integrationPartner == constant('RESCUEGROUPS')) {1341 // $partnerDir = constant('RESCUEGROUPS_DIR');1342 // }1343 //echo 'Integration Partner Directory = ' . $partnerDir . '<br>';1344 1345 // $adminInfoFile = 'pmp-admin-info.php';1346 // $pmpAdminInfo = array();1347 // if ( (is_dir(get_stylesheet_directory(dirname(__FILE__)) . '/petmatchpro/' . constant('ADMIN_DIR') . '/' . constant('PARTIALS_DIR') . '/')) && (is_file(get_stylesheet_directory(dirname(__FILE__)) . '/petmatchpro/' . constant('ADMIN_DIR') . '/' . constant('PARTIALS_DIR') . '/' . $adminInfoFile)) ) {1348 // $requireFile = get_stylesheet_directory(dirname(__FILE__)) . '/petmatchpro/' . constant('ADMIN_DIR') . '/' . constant('PARTIALS_DIR') . '/' . $adminInfoFile;1349 // } else {1350 // $requireFile = constant("PET_MATCH_PRO_PATH") . '/' . constant('ADMIN_DIR') . '/' . constant('PARTIALS_DIR') . '/' . $adminInfoFile;1351 // }1352 // require($requireFile);1353 1160 1354 1161 /* Get Field Visibility Levels by License Type */ … … 1792 1599 'pet-match-pro-contact-options' 1793 1600 ); 1794 1795 //$contactOptions = get_option('pet-match-pro-contact-options');1796 //echo '<pre>CONTACT OPTIONS<br>'; print_r($contactOptions); echo '</pre>';1797 1601 } 1798 1602 1603 public function initialize_color_options() { 1604 add_settings_section( 1605 'color_settings_section', // ID used to identify this section and with which to register options 1606 __('', 'pet-match-pro-plugin'), // Title to be displayed on the administration page 1607 array($this, 'color_options_callback'), // Callback used to render the description of the section 1608 'pet-match-pro-color-options' // Page on which to add this section of options 1609 ); 1610 1611 /* Get Field Visibility Levels by License Type */ 1612 $levelsFile = 'pmp-option-levels-color.php'; 1613 $requireFile = constant("PET_MATCH_PRO_PATH") . '/' . constant('ADMIN_DIR') . '/' . constant('PARTIALS_DIR') . '/' . $levelsFile; 1614 require($requireFile); 1615 //echo '<pre> ADMIN OPTION LEVEL VALUES '; print_r($pmpOptionLevelsColor); echo '</pre>'; 1616 1617 //echo 'PMP License Type ID = ' . $PMPLicenseTypeID . '<br>'; 1618 //$PMPLicenseTypeID = 4; 1619 1620 /* Get the Settings for Use in Formatting the Labels */ 1621 if ( (is_array($this->colorOptions)) && (count($this->colorOptions) > 0) ) { 1622 echo '<style id="pmp-color-options">'; 1623 foreach ($this->colorOptions as $key=>$value) { 1624 if (!empty($value)) { 1625 $classKey = str_replace("_", "-", $key); 1626 //echo 'Class Key is ' . $classKey . '<br>'; 1627 $classValue = 'table.form-table tr.pmp-color-' . $classKey . ' th {color:' . $value . '; background-color: #dcdcdc;} '; 1628 //echo 'Class Value is ' $classValue . '<br>'; 1629 echo $classValue; 1630 } 1631 } 1632 echo '</style> <!-- #pmp-color-options -->'; 1633 } 1634 1635 /* RMB - Add Setting for Search Form Submit Button */ 1636 if ( (array_key_exists('level_search_submit_text', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_search_submit_text']) && (!empty($this->pmpLicenseKey)) ) { 1637 $colorOptionsClass = 'pmp-color-search-submit-text'; 1638 } else { 1639 $colorOptionsClass = 'pmp-option-disable'; 1640 } 1641 1642 add_settings_field( 1643 'search_submit_text', 1644 __('Search Submit Button Text', 'pet-match-pro-plugin'), 1645 array($this, 'input_element_callback'), 1646 'pet-match-pro-color-options', 1647 'color_settings_section', 1648 array('pet-match-pro-color-options', 1649 'search_submit_text', 1650 $this->pmpAdminInfo['search_submit_text'], 1651 'class' => $colorOptionsClass 1652 ) 1653 ); 1654 1655 if ( (array_key_exists('level_search_submit', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_search_submit']) && (!empty($this->pmpLicenseKey)) ) { 1656 $colorOptionsClass1 = 'pmp-color-search-submit-background'; 1657 $colorOptionsClass2 = 'pmp-color-search-submit-border'; 1658 } else { 1659 $colorOptionsClass = 'pmp-option-disable'; 1660 } 1661 1662 add_settings_field( 1663 'search_submit_background', 1664 __('Search Submit Button Background', 'pet-match-pro-plugin'), 1665 array($this, 'input_element_callback'), 1666 'pet-match-pro-color-options', 1667 'color_settings_section', 1668 array('pet-match-pro-color-options', 1669 'search_submit_background', 1670 $this->pmpAdminInfo['search_submit_background'], 1671 'class' => $colorOptionsClass1 1672 ) 1673 ); 1674 1675 add_settings_field( 1676 'search_submit_border', 1677 __('Search Submit Button Border', 'pet-match-pro-plugin'), 1678 array($this, 'input_element_callback'), 1679 'pet-match-pro-color-options', 1680 'color_settings_section', 1681 array('pet-match-pro-color-options', 1682 'search_submit_border', 1683 $this->pmpAdminInfo['search_submit_border'], 1684 'class' => $colorOptionsClass2 1685 ) 1686 ); 1687 1688 if ( (array_key_exists('level_search_submit_hover_text', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_search_submit_hover_text']) && (!empty($this->pmpLicenseKey)) ) { 1689 $colorOptionsClass = 'pmp-color-search-submit-hover-text'; 1690 } else { 1691 $colorOptionsClass = 'pmp-option-disable'; 1692 } 1693 1694 add_settings_field( 1695 'search_submit_hover_text', 1696 __('Search Submit Button Hover Text', 'pet-match-pro-plugin'), 1697 array($this, 'input_element_callback'), 1698 'pet-match-pro-color-options', 1699 'color_settings_section', 1700 array('pet-match-pro-color-options', 1701 'search_submit_hover_text', 1702 $this->pmpAdminInfo['search_submit_hover_text'], 1703 'class' => $colorOptionsClass 1704 ) 1705 ); 1706 1707 if ( (array_key_exists('level_search_submit_hover', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_search_submit_hover']) && (!empty($this->pmpLicenseKey)) ) { 1708 $colorOptionsClass1 = 'pmp-color-search-submit-hover-background'; 1709 $colorOptionsClass2 = 'pmp-color-search-submit-hover-border'; 1710 } else { 1711 $colorOptionsClass = 'pmp-option-disable'; 1712 } 1713 1714 add_settings_field( 1715 'search_submit_hover_background', 1716 __('Search Submit Button Hover Background', 'pet-match-pro-plugin'), 1717 array($this, 'input_element_callback'), 1718 'pet-match-pro-color-options', 1719 'color_settings_section', 1720 array('pet-match-pro-color-options', 1721 'search_submit_hover_background', 1722 $this->pmpAdminInfo['search_submit_hover_background'], 1723 'class' => $colorOptionsClass1 1724 ) 1725 ); 1726 1727 add_settings_field( 1728 'search_submit_hover_border', 1729 __('Search Submit Button Hover Border', 'pet-match-pro-plugin'), 1730 array($this, 'input_element_callback'), 1731 'pet-match-pro-color-options', 1732 'color_settings_section', 1733 array('pet-match-pro-color-options', 1734 'search_submit_hover_border', 1735 $this->pmpAdminInfo['search_submit_hover_border'], 1736 'class' => $colorOptionsClass2 1737 ) 1738 ); 1739 1740 /* RMB - Add Setting for Search Title */ 1741 if ( (array_key_exists('level_search_title', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_search_title']) && (!empty($this->pmpLicenseKey)) ) { 1742 $colorOptionsClass = 'pmp-color-search-title'; 1743 } else { 1744 $colorOptionsClass = 'pmp-option-disable'; 1745 } 1746 1747 add_settings_field( 1748 'search_title', 1749 __('Search Title', 'pet-match-pro-plugin'), 1750 array($this, 'input_element_callback'), 1751 'pet-match-pro-color-options', 1752 'color_settings_section', 1753 array('pet-match-pro-color-options', 1754 'search_title', 1755 $this->pmpAdminInfo['search_title'], 1756 'class' => $colorOptionsClass 1757 ) 1758 ); 1759 1760 /* RMB - Add Setting for Search Name Result */ 1761 if ( (array_key_exists('level_search_result_name', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_search_result_name']) && (!empty($this->pmpLicenseKey)) ) { 1762 $colorOptionsClass = 'pmp-color-search-result-name'; 1763 } else { 1764 $colorOptionsClass = 'pmp-option-disable'; 1765 } 1766 1767 add_settings_field( 1768 'search_result_name', 1769 __('Search Result Name', 'pet-match-pro-plugin'), 1770 array($this, 'input_element_callback'), 1771 'pet-match-pro-color-options', 1772 'color_settings_section', 1773 array('pet-match-pro-color-options', 1774 'search_result_name', 1775 $this->pmpAdminInfo['search_result_name'], 1776 'class' => $colorOptionsClass 1777 ) 1778 ); 1779 1780 if ( (array_key_exists('level_search_result_name_hover', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_search_result_name_hover']) && (!empty($this->pmpLicenseKey)) ) { 1781 $colorOptionsClass = 'pmp-color-search-result-name-hover'; 1782 } else { 1783 $colorOptionsClass = 'pmp-option-disable'; 1784 } 1785 1786 add_settings_field( 1787 'search_result_name_hover', 1788 __('Search Result Name Hover', 'pet-match-pro-plugin'), 1789 array($this, 'input_element_callback'), 1790 'pet-match-pro-color-options', 1791 'color_settings_section', 1792 array('pet-match-pro-color-options', 1793 'search_result_name_hover', 1794 $this->pmpAdminInfo['search_result_name_hover'], 1795 'class' => $colorOptionsClass 1796 ) 1797 ); 1798 1799 /* RMB - Add Setting for Search Result Label */ 1800 if ( (array_key_exists('level_search_result_label', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_search_result_label']) && (!empty($this->pmpLicenseKey)) ) { 1801 $colorOptionsClass = 'pmp-color-search-result-label'; 1802 } else { 1803 $colorOptionsClass = 'pmp-option-disable'; 1804 } 1805 1806 add_settings_field( 1807 'search_result_label', 1808 __('Search Result Label', 'pet-match-pro-plugin'), 1809 array($this, 'input_element_callback'), 1810 'pet-match-pro-color-options', 1811 'color_settings_section', 1812 array('pet-match-pro-color-options', 1813 'search_result_label', 1814 $this->pmpAdminInfo['search_result_label'], 1815 'class' => $colorOptionsClass 1816 ) 1817 ); 1818 1819 /* RMB - Add Setting for Search Result Value */ 1820 if ( (array_key_exists('level_search_result', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_search_result']) && (!empty($this->pmpLicenseKey)) ) { 1821 $colorOptionsClass = 'pmp-color-search-result'; 1822 } else { 1823 $colorOptionsClass = 'pmp-option-disable'; 1824 } 1825 1826 add_settings_field( 1827 'search_result', 1828 __('Search Result Value', 'pet-match-pro-plugin'), 1829 array($this, 'input_element_callback'), 1830 'pet-match-pro-color-options', 1831 'color_settings_section', 1832 array('pet-match-pro-color-options', 1833 'search_result', 1834 $this->pmpAdminInfo['search_result'], 1835 'class' => $colorOptionsClass 1836 ) 1837 ); 1838 1839 /* RMB - Add Setting for Detail Result Buttons */ 1840 if ( (array_key_exists('level_detail_result_button_text', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_detail_result_button_text']) && (!empty($this->pmpLicenseKey)) ) { 1841 $colorOptionsClass = 'pmp-color-detail-result-button-text'; 1842 } else { 1843 $colorOptionsClass = 'pmp-option-disable'; 1844 } 1845 1846 add_settings_field( 1847 'detail_result_button_text', 1848 __('Detail Buttons Text', 'pet-match-pro-plugin'), 1849 array($this, 'input_element_callback'), 1850 'pet-match-pro-color-options', 1851 'color_settings_section', 1852 array('pet-match-pro-color-options', 1853 'detail_result_button_text', 1854 $this->pmpAdminInfo['detail_result_button_text'], 1855 'class' => $colorOptionsClass 1856 ) 1857 ); 1858 1859 if ( (array_key_exists('level_detail_result_button', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_detail_result_button']) && (!empty($this->pmpLicenseKey)) ) { 1860 $colorOptionsClass1 = 'pmp-color-detail-result-button-background'; 1861 $colorOptionsClass2 = 'pmp-color-detail-result-button-border'; 1862 } else { 1863 $colorOptionsClass = 'pmp-option-disable'; 1864 } 1865 1866 add_settings_field( 1867 'detail_result_button_background', 1868 __('Detail Buttons Background', 'pet-match-pro-plugin'), 1869 array($this, 'input_element_callback'), 1870 'pet-match-pro-color-options', 1871 'color_settings_section', 1872 array('pet-match-pro-color-options', 1873 'detail_result_button_background', 1874 $this->pmpAdminInfo['detail_result_button_background'], 1875 'class' => $colorOptionsClass1 1876 ) 1877 ); 1878 1879 add_settings_field( 1880 'detail_result_button_border', 1881 __('Detail Buttons Border', 'pet-match-pro-plugin'), 1882 array($this, 'input_element_callback'), 1883 'pet-match-pro-color-options', 1884 'color_settings_section', 1885 array('pet-match-pro-color-options', 1886 'detail_result_button_border', 1887 $this->pmpAdminInfo['detail_result_button_border'], 1888 'class' => $colorOptionsClass2 1889 ) 1890 ); 1891 1892 if ( (array_key_exists('level_detail_result_button_hover_text', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_detail_result_button_hover_text']) && (!empty($this->pmpLicenseKey)) ) { 1893 $colorOptionsClass = 'pmp-color-detail-result-button-hover-text'; 1894 } else { 1895 $colorOptionsClass = 'pmp-option-disable'; 1896 } 1897 1898 add_settings_field( 1899 'detail_result_button_hover_text', 1900 __('Detail Buttons Hover Text', 'pet-match-pro-plugin'), 1901 array($this, 'input_element_callback'), 1902 'pet-match-pro-color-options', 1903 'color_settings_section', 1904 array('pet-match-pro-color-options', 1905 'detail_result_button_hover_text', 1906 $this->pmpAdminInfo['detail_result_button_hover_text'], 1907 'class' => $colorOptionsClass 1908 ) 1909 ); 1910 1911 if ( (array_key_exists('level_detail_result_button_hover', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_detail_result_button_hover']) && (!empty($this->pmpLicenseKey)) ) { 1912 $colorOptionsClass1 = 'pmp-color-detail-result-button-hover-background'; 1913 $colorOptionsClass2 = 'pmp-color-detail-result-button-hover-border'; 1914 } else { 1915 $colorOptionsClass = 'pmp-option-disable'; 1916 } 1917 1918 add_settings_field( 1919 'detail_result_button_hover_background', 1920 __('Detail Buttons Hover Background', 'pet-match-pro-plugin'), 1921 array($this, 'input_element_callback'), 1922 'pet-match-pro-color-options', 1923 'color_settings_section', 1924 array('pet-match-pro-color-options', 1925 'detail_result_button_hover_background', 1926 $this->pmpAdminInfo['detail_result_button_hover_background'], 1927 'class' => $colorOptionsClass1 1928 ) 1929 ); 1930 1931 add_settings_field( 1932 'detail_result_button_hover_border', 1933 __('Detail Buttons Hover Border', 'pet-match-pro-plugin'), 1934 array($this, 'input_element_callback'), 1935 'pet-match-pro-color-options', 1936 'color_settings_section', 1937 array('pet-match-pro-color-options', 1938 'detail_result_button_hover_border', 1939 $this->pmpAdminInfo['detail_result_button_hover_border'], 1940 'class' => $colorOptionsClass2 1941 ) 1942 ); 1943 1944 if ( (array_key_exists('level_detail_result_title', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_detail_result_title']) && (!empty($this->pmpLicenseKey)) ) { 1945 $colorOptionsClass = 'pmp-color-detail-result-title'; 1946 } else { 1947 $colorOptionsClass = 'pmp-option-disable'; 1948 } 1949 1950 add_settings_field( 1951 'detail_result_title', 1952 __('Detail Result Title', 'pet-match-pro-plugin'), 1953 array($this, 'input_element_callback'), 1954 'pet-match-pro-color-options', 1955 'color_settings_section', 1956 array('pet-match-pro-color-options', 1957 'detail_result_title', 1958 $this->pmpAdminInfo['detail_result_title'], 1959 'class' => $colorOptionsClass 1960 ) 1961 ); 1962 1963 if ( (array_key_exists('level_detail_result_label', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_detail_result_label']) && (!empty($this->pmpLicenseKey)) ) { 1964 $colorOptionsClass = 'pmp-color-detail-result-label'; 1965 } else { 1966 $colorOptionsClass = 'pmp-option-disable'; 1967 } 1968 1969 add_settings_field( 1970 'detail_result_label', 1971 __('Detail Result Label', 'pet-match-pro-plugin'), 1972 array($this, 'input_element_callback'), 1973 'pet-match-pro-color-options', 1974 'color_settings_section', 1975 array('pet-match-pro-color-options', 1976 'detail_result_label', 1977 $this->pmpAdminInfo['detail_result_label'], 1978 'class' => $colorOptionsClass 1979 ) 1980 ); 1981 1982 if ( (array_key_exists('level_detail_result', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_detail_result']) && (!empty($this->pmpLicenseKey)) ) { 1983 $colorOptionsClass = 'pmp-color-detail-result'; 1984 } else { 1985 $colorOptionsClass = 'pmp-option-disable'; 1986 } 1987 1988 add_settings_field( 1989 'detail_result', 1990 __('Detail Result', 'pet-match-pro-plugin'), 1991 array($this, 'input_element_callback'), 1992 'pet-match-pro-color-options', 1993 'color_settings_section', 1994 array('pet-match-pro-color-options', 1995 'detail_result', 1996 $this->pmpAdminInfo['detail_result'], 1997 'class' => $colorOptionsClass 1998 ) 1999 ); 2000 2001 if ( (array_key_exists('level_detail_description_label', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_detail_description_label']) && (!empty($this->pmpLicenseKey)) ) { 2002 $colorOptionsClass = 'pmp-color-detail-description-label'; 2003 } else { 2004 $colorOptionsClass = 'pmp-option-disable'; 2005 } 2006 2007 add_settings_field( 2008 'detail_description_label', 2009 __('Detail Result Description Label', 'pet-match-pro-plugin'), 2010 array($this, 'input_element_callback'), 2011 'pet-match-pro-color-options', 2012 'color_settings_section', 2013 array('pet-match-pro-color-options', 2014 'detail_description_label', 2015 $this->pmpAdminInfo['detail_description_label'], 2016 'class' => $colorOptionsClass 2017 ) 2018 ); 2019 2020 if ( (array_key_exists('level_detail_description', $pmpOptionLevelsColor)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsColor['level_detail_description']) && (!empty($this->pmpLicenseKey)) ) { 2021 $colorOptionsClass = 'pmp-color-detail-description'; 2022 } else { 2023 $colorOptionsClass = 'pmp-option-disable'; 2024 } 2025 2026 add_settings_field( 2027 'detail_description', 2028 __('Detail Result Description', 'pet-match-pro-plugin'), 2029 array($this, 'input_element_callback'), 2030 'pet-match-pro-color-options', 2031 'color_settings_section', 2032 array('pet-match-pro-color-options', 2033 'detail_description', 2034 $this->pmpAdminInfo['detail_description'], 2035 'class' => $colorOptionsClass 2036 ) 2037 ); 2038 2039 register_setting( 2040 'pet-match-pro-color-options', 2041 'pet-match-pro-color-options' 2042 ); 2043 } 2044 1799 2045 public function initialize_API_license_form() { 1800 //delete_option('pet-match-pro-license');1801 2046 } 1802 2047 … … 1850 2095 'instruction_settings_section' 1851 2096 ); 1852 1853 /* Get Partner Directory for Use in File Names */1854 // $generalOptions = get_option('pet-match-pro-general-options');1855 // $integrationPartner = $generalOptions['integration_partner'];1856 // if ($this->integrationPartner == constant('PETPOINT')) {1857 // if ($partnerAPI == 'PetPoint') {1858 // $partnerDir = constant('PETPOINT_DIR') . '/' ;1859 // } elseif ($this->integrationPartner == constant('RESCUEGROUPS')) {1860 // $partnerDir = constant('RESCUEGROUPS_DIR') . '/' ;1861 // } else {1862 // $partnerDir = '';1863 // }1864 2097 1865 2098 /* Get Adoptable Search Shortcode Instructions */ … … 2290 2523 //update_option( 'pet-match-pro-license', $default_array ); 2291 2524 } // end if 2292 //$isValid = $this->responseObj->is_valid;2293 //$isValid = 'Test';2294 //$license_title = $this->responseObj->license_title;2295 //$license_key = $this->responseObj->license_key;2296 2525 require_once plugin_dir_path(dirname(__FILE__)) . constant('ADMIN_DIR') . '/' . constant('PARTIALS_DIR') . '/activate_license_form.php'; 2297 //require_once plugin_dir_path(dirname(__FILE__)) . 'admin/partials/activate_license_form.php';2298 2526 } 2299 2527 … … 2304 2532 $license_param = $this->responseObj->lic_param; 2305 2533 require_once plugin_dir_path(dirname(__FILE__)) . constant('ADMIN_DIR') . '/' . constant('PARTIALS_DIR') . '/deactivate_license_form.php'; 2306 // require_once plugin_dir_path(dirname(__FILE__)) . 'admin/partials/deactivate_license_form.php';2307 2534 } 2308 2535 … … 2319 2546 if ( ($args[2]) ) { 2320 2547 echo '<input type="text" id="' . $args[1] . '" title="' . $args[2] . '" name="' . $args[0] . '[' . $args[1] . ']" value="' . $inputValue . '" />'; 2321 // echo '<input type="text" id="' . $args[1] . '" title="' . $args[2] . '" name="' . $args[0] . '[' . $args[1] . ']" value="' . $options[$args[1]] . '" />';2322 2548 } else { 2323 2549 echo '<input type="text" id="' . $args[1] . '" name="' . $args[0] . '[' . $args[1] . ']" value="' . $inputValue . '" />'; 2324 // echo '<input type="text" id="' . $args[1] . '" name="' . $args[0] . '[' . $args[1] . ']" value="' . $options[$args[1]] . '" />';2325 2550 } 2326 2551 } // end input_element_callback … … 2368 2593 if (is_numeric($key)) { 2369 2594 $html .= '<input type="checkbox" id="' . $args[0] . '[' . $args[1] . '][]" title="' . $args[3] . '" name="' . $args[0] . '[' . $args[1] . '][]" value="' . $value . '" ' . $check . ' />'; 2370 //$html .= '<input type="checkbox" id="' . $args[0] . '[' . $args[1] . '][]" title="' . $args[3] . '" name="' . $args[0] . '[' . $args[1] . '][]" value="' . $value . '" ' . $check . ' ' . $args[4] . ' />';2371 2595 $html .= ' <label for="' . $args[0] . '[' . $args[1] . ']">' . $value . ' </label>'; 2372 2596 } else { 2373 2597 $html .= '<input type="checkbox" id="' . $args[0] . '[' . $args[1] . '][]" title="' . $args[3] . '" name="' . $args[0] . '[' . $args[1] . '][]" value="' . $key . '" ' . $check . ' />'; 2374 //$html .= '<input type="checkbox" id="' . $args[0] . '[' . $args[1] . '][]" title="' . $args[3] . '" name="' . $args[0] . '[' . $args[1] . '][]" value="' . $key . '" ' . $check . ' ' . $args[4] . ' />';2375 2598 $html .= ' <label for="' . $args[0] . '[' . $args[1] . ']">' . $value . ' </label>'; 2376 2599 } … … 2379 2602 } 2380 2603 private function get_file_data($file_path){ 2381 2382 // $file_handle = fopen($requireFile, 'r'); // Open the file for reading2383 2384 // if ($file_handle) {2385 2386 // $searchAdopt = fread($file_handle, filesize($requireFile)); // Read the file contents2387 2388 // fclose($file_handle); // Close the file handle2389 2390 // // Now, $file_contents contains the contents of the file2391 // // You can use $file_contents as needed2392 // } else {2393 // echo 'Failed to open file for reading.';2394 // }2395 // Initialize the WP_Filesystem2396 2397 2604 // Attempt to get access to the filesystem 2398 2605 if ( WP_Filesystem() ) { … … 2413 2620 } 2414 2621 } 2415 2416 2622 } 2623 2417 2624 public function radio_element_callback($args) { 2418 2625 $options = get_option($args[0]); -
petmatchpro/trunk/admin/partials/pmp-admin-info.php
r3050057 r3055603 77 77 $this->pmpAdminInfo['sponsor_link'] = 'Enter external URL to visit sponsor website.'; 78 78 $this->pmpAdminInfo['sponsor_image'] = 'Enter website or external URL to sponsor image or banner.'; 79 $this->pmpAdminInfo['website_support_email'] = 'Enter email address for visitors to request website support.'; 79 80 80 $this->pmpAdminInfo['website_support_email'] = 'Enter email address for visitors to request website support.'; 81 $this->pmpAdminInfo['search_submit_text'] = 'Enter hex or RGB color value for Search Submit Button Text.'; 82 $this->pmpAdminInfo['search_submit_background'] = 'Enter hex or RGB color value for Search Submit Button Background.'; 83 $this->pmpAdminInfo['search_submit_border'] = 'Enter hex or RGB color value for Search Submit Button Border.'; 84 $this->pmpAdminInfo['search_submit_hover_text'] = 'Enter hex or RGB color value for Search Submit Button Hover State Text.'; 85 $this->pmpAdminInfo['search_submit_hover_background'] = 'Enter hex or RGB color value for Search Submit Button Hover State Background.'; 86 $this->pmpAdminInfo['search_submit_hover_border'] = 'Enter hex or RGB color value for Search Submit Button Hover State Border.'; 87 $this->pmpAdminInfo['search_title'] = 'Enter hex or RGB color value for Search Results Title.'; 88 $this->pmpAdminInfo['search_result_name'] = 'Enter hex or RGB color value for Search Result Name.'; 89 $this->pmpAdminInfo['search_result_name_hover'] = 'Enter hex or RGB color value for Search Result Name Hover State.'; 90 $this->pmpAdminInfo['search_result_label'] = 'Enter hex or RGB color value for Search Result Label.'; 91 $this->pmpAdminInfo['search_result'] = 'Enter hex or RGB color value for Search Result Value.'; 92 $this->pmpAdminInfo['detail_result_button_text'] = 'Enter hex or RGB color value for Details Button Text.'; 93 $this->pmpAdminInfo['detail_result_button_background'] = 'Enter hex or RGB color value for Details Button Background.'; 94 $this->pmpAdminInfo['detail_result_button_border'] = 'Enter hex or RGB color value for Details Button Border.'; 95 $this->pmpAdminInfo['detail_result_button_hover_text'] = 'Enter hex or RGB color value for Details Button Hover State Text.'; 96 $this->pmpAdminInfo['detail_result_button_hover_background'] = 'Enter hex or RGB color value for Details Button Hover State Background.'; 97 $this->pmpAdminInfo['detail_result_button_hover_border'] = 'Enter hex or RGB color value for Details Button Hover State Border.'; 98 $this->pmpAdminInfo['detail_result_title'] = 'Enter hex or RGB color value for Detail Result Title.'; 99 $this->pmpAdminInfo['detail_result_label'] = 'Enter hex or RGB color value for Detail Result Label.'; 100 $this->pmpAdminInfo['detail_result'] = 'Enter hex or RGB color value for Detail Result Value.'; 101 $this->pmpAdminInfo['detail_description_label'] = 'Enter hex or RGB color value for Detail Description Label.'; 102 $this->pmpAdminInfo['detail_description'] = 'Enter hex or RGB color value for Detail Description Copy.'; 81 103 ?> -
petmatchpro/trunk/includes/class-pet-match-pro.php
r3050057 r3055603 191 191 //load a message that will say whatever or do something for defaults 192 192 } 193 $this->loader->add_action( 'admin_init', $plugin_settings, 'initialize_color_options' ); 193 194 } 194 195 -
petmatchpro/trunk/includes/pp/class-pet-match-pro-pp-api.php
r3053866 r3055603 44 44 private $generalOptions; 45 45 private $partialsDir; 46 private $partialsPublicDir; 46 47 private $filterFunction; 47 48 private $animalDetailFunction; … … 49 50 private $allAPIFunction; 50 51 public $displayIcons; 51 public $integration _partner;52 public $integrationPartner; 52 53 53 54 public function __construct($authKey, $activated) { … … 69 70 $PMPGeneralOptions = get_option('pet-match-pro-general-options'); 70 71 $this->generalOptions = $PMPGeneralOptions; 72 $this->integrationPartner = $this->generalOptions['integration_partner']; 71 73 //echo '<pre>GENERAL OPTIONS<br>'; print_r($this->generalOptions); echo '<pre>'; 72 74 if ( (array_key_exists('details_page_adopt', $this->generalOptions)) && (is_numeric($this->generalOptions['details_page_adopt'])) && (intval($this->generalOptions['details_page_adopt']) > 0) ) { … … 144 146 145 147 $this->partialsDir = constant('PET_MATCH_PRO_PATH') . '/' . constant('INCLUDE_DIR') . '/' . constant('PETPOINT_DIR') . '/' . constant('PARTIALS_DIR') . '/'; 148 $this->partialsPublicDir = constant('PET_MATCH_PRO_PATH') . '/' . constant('PUBLIC_DIR') . '/' . constant('PARTIALS_DIR') . '/'; 146 149 147 150 /* Include Class Defining Functions for Processing Animal Searches */ … … 692 695 //echo '<pre>Results from ' . $firstMethod . ' SEARCH '; print_r($firstxmlWSArray); echo '</pre><br>'; 693 696 } else { 694 $firstoutputWS = array(); 697 $firstoutputWS = []; 698 $firstxmlWSArray = []; 695 699 // $firstoutputWS = ''; 696 700 } … … 719 723 //echo '<pre>Results from ' . $nextMethod . ' SEARCH '; print_r($nextxmlWSArray); echo '</pre><br>'; 720 724 } else { 721 $nextxmlWSArray = array(); 725 $nextxmlWSArray = []; 726 $nextxmlWSArray = []; 722 727 // $nextxmlWSArray = ''; 723 728 } … … 767 772 } 768 773 769 //echo '<pre>Results from Combining Arrays '; print_r($xmlWSArray); echo '</pre><br>';774 //echo '<pre>Results from Combining Arrays<br>'; print_r($xmlWSArray); echo '</pre><br>'; 770 775 771 776 if ( (is_countable($xmlWSArray)) && (array_key_exists('XmlNode',$xmlWSArray)) ) { … … 780 785 if ($mergeCount > 0) { 781 786 foreach ($xmlWSArray as $ID => $value) { 782 //echo '<pre>Procecssing Merged Array ID ' . $ID . ' with Value '; print_r($value); echo '</pre><br>';787 //echo '<pre>Procecssing Merged Array ID ' . $ID . ' with Value<br>'; print_r($value); echo '</pre><br>'; 783 788 $dateValue = date("Y-m-d",strtotime($value['an']['Date'])); 784 789 //echo 'Date Field is ' . $value['an']['Date'] . ', convert to date as ' . $dateValue . '<br>'; … … 786 791 $xmlWSArray[$ID]['an']['Date'] = $dateValue; 787 792 } 788 //echo '<pre>Results from Formatting Date in Combined Array '; print_r($xmlWSArray); echo '</pre><br>';793 //echo '<pre>Results from Formatting Date in Combined Array<br>'; print_r($xmlWSArray); echo '</pre><br>'; 789 794 790 795 /* Sort Values Based on Field Specified */ … … 964 969 } 965 970 $results = array_combine(array_map('strtolower', $keysArray), $valuesArray); 971 //echo '<pre>RESULTS<br>'; print_r($results); echo '</pre>'; 966 972 //to lower case just to match keys 967 973 if (!array_key_exists(constant('ERROR'), $searchResultDetails)) { … … 982 988 //echo 'Set Label Value to ' . $DetailsOutput[$key]['label'] . '<br>'; 983 989 } 984 985 if (strlen(preg_replace('/\s+/', '', $results[$key])) == 0) { 986 $DetailsOutput[$key]['value'] = constant('EMPTY_VALUE'); 987 } else { 988 $DetailsOutput[$key]['value'] = $results[$key]; 989 } 990 //echo 'Preparing to Process Results Key ' . $key . '<br>'; 991 if (array_key_exists($key, $results)) { 992 $DetailsOutput[$key]['value'] = $results[$key]; 993 } else { 994 $DetailsOutput[$key]['value'] = constant('EMPTY_VALUE'); 995 } 996 // if (strlen(preg_replace('/\s+/', '', $results[$key])) == 0) { 997 // $DetailsOutput[$key]['value'] = constant('EMPTY_VALUE'); 998 // } else { 999 // $DetailsOutput[$key]['value'] = $results[$key]; 1000 // } 990 1001 //for sex in whole world used on found and lost 991 1002 if ($key == constant('PETPOINT_SEX')) { … … 1025 1036 1026 1037 /* RMB - Remove Time from Date Fields */ 1027 if (str_contains($key, 'date')) { 1038 if ( (array_key_exists($key, $results)) && (str_contains($key, 'date')) ) { 1039 // if (str_contains($key, 'date')) { 1028 1040 $DetailsOutput[$key]['value'] = date("m-d-Y",strtotime($results[$key])); 1029 1041 } … … 1041 1053 } 1042 1054 } 1043 if(!is_admin()) { 1055 1056 if (!isset($DetailPageURL)) { 1057 if ($firstSuffix == 'lost') { 1058 $DetailPageURL = $this->lostDetailPageURL; 1059 $searchMethod = 'lostDetails'; 1060 } else { 1061 $DetailPageURL = $this->foundDetailPageURL; 1062 $searchMethod = 'foundDetails'; 1063 } 1064 } 1065 1066 if(!is_admin()) { 1044 1067 $detailsPage = $DetailPageURL . '?method=' . $searchMethod . '&animalID=' . $results['id']; 1045 1068 } … … 1177 1200 /* Obtain License Type to Secure Features */ 1178 1201 $licenseTypeID = $this->PMPLicenseTypeID; 1202 1203 /* Include Style Updates from Colors Tab */ 1204 $colorsFile = 'pet-match-pro-public-color-css.php'; 1205 echo '<style id="pmp-color-options-css">'; 1206 include $this->partialsPublicDir . $colorsFile; 1207 echo '</style> <!-- #pmp-color-options-css -->'; 1208 1179 1209 /*Include Custom CSS from Admin for Paid Licenses */ 1180 1210 if ($licenseTypeID != constant('FREE_LEVEL')) { … … 1709 1739 /* Set Image OnClick Parameter */ 1710 1740 // $species = $details[constant('PETPOINT_SPECIES')]; 1711 $species = $details['speciesid']; 1741 if (array_key_exists('speciesid', $details)) { 1742 $species = $details['speciesid']; 1743 } else { 1744 if (array_key_exists('species', $details)) { 1745 $species = $details['species']; 1746 } else { 1747 $species = 'species'; 1748 } 1749 } 1712 1750 $clickID = 'pmp-animal-image-' . strtolower($species) . '-' . str_replace(" ", "-", strtolower($DetailsOutput['name']['value'])); 1713 1751 $clickText = 'Learn More About ' . ucfirst($DetailsOutput['name']['value']); … … 1795 1833 /* Obtain License Type to Secure Features */ 1796 1834 $licenseTypeID = $this->PMPLicenseTypeID; 1835 1836 /* Include Style Updates from Colors Tab */ 1837 $colorsFile = 'pet-match-pro-public-color-css.php'; 1838 echo '<style id="pmp-color-options-css">'; 1839 include $this->partialsPublicDir . $colorsFile; 1840 echo '</style> <!-- #pmp-color-options-css -->'; 1797 1841 1798 1842 /*Include Custom CSS from Admin for Paid Licenses */ … … 1928 1972 /* RMB - Remove Time from Date Fields */ 1929 1973 if (str_contains($key, 'date')) { 1974 //echo 'Removing Time from Key ' . $key . '<br>'; 1930 1975 $animalDetails[$key]['value'] = date("m-d-Y",strtotime($detailsItem[$key])); 1931 1976 } … … 2029 2074 /* RMB - Check if Child Directory Exists, Otherwise Set to Plugin Default */ 2030 2075 $general_options = get_option('pet-match-pro-general-options'); 2031 $this->integration_partner = $general_options['integration_partner'];2076 //$this->integrationPartner = $general_options['integration_partner']; 2032 2077 $templateDir = constant('TEMPLATES_DIR') . '/'; 2033 2078 // $templateDir = 'templates/'; 2034 if($this->integration _partner == 'PetPoint'){2079 if($this->integrationPartner == constant('PETPOINT')){ 2035 2080 $templateDir = $templateDir . constant('PETPOINT_DIR') . '/'; 2036 2081 } -
petmatchpro/trunk/includes/rg/class-pet-match-pro-rg-api.php
r3053008 r3055603 25 25 public $contactOptions; 26 26 private $partialsDir; 27 private $partialsPublicDir; 27 28 private $filterFunction; 28 29 private $animalDetailFunction; … … 93 94 94 95 $this->partialsDir = constant('PET_MATCH_PRO_PATH') . '/' . constant('INCLUDE_DIR') . '/' . constant('RESCUEGROUPS_DIR') . '/' . constant('PARTIALS_DIR') . '/'; 96 $this->partialsPublicDir = constant('PET_MATCH_PRO_PATH') . '/' . constant('PUBLIC_DIR') . '/' . constant('PARTIALS_DIR') . '/'; 95 97 96 98 /* Include Class Defining Functions for Processing Animal Searches */ … … 598 600 $resultCount = intval($results['foundRows']); 599 601 //echo 'Array Count = ' . $resultCount . '<br>'; 600 602 603 /* Include Style Updates from Colors Tab */ 604 $colorsFile = 'pet-match-pro-public-color-css.php'; 605 echo '<style id="pmp-color-options-css">'; 606 include $this->partialsPublicDir . $colorsFile; 607 echo '</style> <!-- #pmp-color-options-css -->'; 608 601 609 /*Include Custom CSS from Admin for Paid Licenses */ 602 610 if ($this->PMPLicenseTypeID != constant('FREE_LEVEL')) { … … 712 720 /* Identify Location of Icon Images */ 713 721 $iconPath = constant('PET_MATCH_PRO_PATH') . '/' . constant('INCLUDE_DIR') . '/' . constant('IMAGES_DIR') . '/'; 714 722 715 723 // Sets the counter to zero to use to loop through array count 716 724 $counter = 0; … … 848 856 $TDresult .= '<div class ="pmp-search-result pmp-animal-' . strtolower($key) . '"><a href="' . $detailsPage . '" class="pmp-animal-name-link" id="' . $clickID . '" onclick="' . $nameOnClick . '" >' . $clickText . '</a></div><!-- .pmp-search-result -->'; 849 857 } 850 $TDresult .= '<div class ="pmp-search-result pmp-animal-details-no-labels">';858 // $TDresult .= '<div class ="pmp-search-result pmp-animal-details-no-labels">'; 851 859 } 852 860 elseif ($labels != 'Enable') { /* RMB */ 853 861 //echo 'Processing Key ' . $levelKey . ' with Level Value ' . $fieldLevels[$levelKey] . '<br>'; 862 $TDresult .= '<div class ="pmp-search-result pmp-animal-details-no-labels">'; 854 863 if ($this->PMPLicenseTypeID <= $fieldLevels[$levelKey]) { 855 864 $TDresult .= '<span class ="pmp-search-result-detail pmp-animal-' . strtolower($key) . '-detail">' . $this->searchOutput[$key]['value'] . '</span> |'; /* RMB */ … … 858 867 $TDresult .= '<span class ="pmp-search-result-detail pmp-animal-' . strtolower($key) . '-detail"><a class="pmp-text-link pmp-notice-upgrade-license" href="' . constant('PMP_LOGIN') . '" target="_blank" title="Login to PetMatchPro.com">Upgrade</a> Required</span> |'; 859 868 } 869 $TDresult .= '</div><!-- .pmp-animal-details-no-labels -->'; 860 870 } else { /* RMB */ 861 871 $DetailLabel = '<div class ="pmp-search-result-label pmp-animal-' . strtolower($key) . '-label">' . $this->searchOutput[$key]['label'] . ': </div>'; /* RMB */ … … 946 956 //echo '<pre> OUTPUT DETAILS CALLED DETAILS<br>'; print_r($results); echo '</pre>'; 947 957 $resultCount = intval($results['foundRows']); 948 958 959 /* Include Style Updates from Colors Tab */ 960 $colorsFile = 'pet-match-pro-public-color-css.php'; 961 echo '<style id="pmp-color-options-css">'; 962 include $this->partialsPublicDir . $colorsFile; 963 echo '</style> <!-- #pmp-color-options-css -->'; 964 949 965 /*Include Custom CSS from Admin for Paid Licenses */ 950 966 if ($this->PMPLicenseTypeID != constant('FREE_LEVEL')) { -
petmatchpro/trunk/pet-match-pro.php
r3053866 r3055603 13 13 * Plugin Name: PetMatchPro 14 14 * Description: Integrates animal search and details from your PetPoint/Petango or RescueGroups account into your website with simple shortcodes. 15 * Version: 4. 6.515 * Version: 4.7.1 16 16 * Author: PetMatchPro 17 17 * Author URI: https://PetMatchPro.com … … 28 28 * Current plugin version. 29 29 */ 30 define('PET_MATCH_PRO_VERSION', '4. 6.5');30 define('PET_MATCH_PRO_VERSION', '4.7.1'); 31 31 32 32 /* Define Global Variables */
Note: See TracChangeset
for help on using the changeset viewer.