Plugin Directory

Changeset 3055603


Ignore:
Timestamp:
03/20/2024 08:14:46 PM (2 years ago)
Author:
petmatchpro
Message:

Add Admin Color Tab settings.

Location:
petmatchpro/trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • petmatchpro/trunk/CHANGE-LOG.txt

    r3053866 r3055603  
     1Version 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
    118Version 4.6.5- March 18, 2024
    219+ /includes/pp/class-pet-match-pro-pp-api.php
  • petmatchpro/trunk/README.txt

    r3053866 r3055603  
    66Requires at least: 5.0
    77Tested up to: 6.4
    8 Stable tag: 4.6.5
     8Stable tag: 4.7.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • petmatchpro/trunk/admin/class-pet-match-pro-admin-settings.php

    r3053008 r3055603  
    4242    public  $pmpLicenseKey;
    4343    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;
    5545   
    5646    public function instruction_title() {
     
    6454        $this->pmpLicenseKey = get_option("PMP_lic_Key", "");
    6555        $liceEmail = get_option("PMP_lic_email", "");
     56       
    6657        PetMatchProBase::addOnDelete(function () {
    6758            delete_option('PMP_lic_Key');
     
    7263        $this->generalOptions = get_option('pet-match-pro-general-options');
    7364        $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         
    7669        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***
    8170            add_action('admin_menu', [$this, 'setup_plugin_options_menu_active']);
    8271            add_action('admin_post_PetMatchPro_el_deactivate_license', [$this, 'action_deactivate_license']);
     
    9887            add_action('PMP_activate_lic', [$this, 'action_activate_license']);
    9988            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 //            }
    10689            $this->pmp_activated = false;
    10790            update_option('PMP_License_Type', "");
     
    10992            $this->PMPLicenseTypeID = (int) get_option('PMP_License_Type_ID');                         
    11093        }
    111         //$this->api_activated = $api_activated;
    112         //if ( empty($this->PMPLicenseTypeID) ) {
    113         //  $this->PMPLicenseTypeID = constant('FREE_LEVEL');
    114         //}       
    11594        if ( $this->PMPLicenseTypeID == 0 ) {
    11695            $this->PMPLicenseTypeID = constant('FREE_LEVEL');
     
    135114        }
    136115        //echo 'Require File = ' . $requireFile . '<br>';
    137         //die;
    138116        require($requireFile);
    139           // include_once($requireFile);
    140117        //echo '<pre>INFO SETTINGS'; print_r($pmpAdminInfo); echo '</pre>';
    141118    }
     
    144121     */
    145122    public function setup_plugin_options_menu_active() {
    146     //$logoPath = constant("PET_MATCH_PRO_PATH") . '/assets/icon-256x256.png';   
    147123    $logoPath = plugins_url('petmatchpro/' . constant('ASSETS_DIR') . '/' . 'icon-25x25.png');   
    148124        add_menu_page(
     
    207183            } else if ($active_tab == 'label_options') {
    208184                $active_tab = 'label_options';
     185            } else if ($active_tab == 'color_options') {
     186                $active_tab = 'color_options';                               
    209187            } else if ($active_tab == 'instructions') {
    210188                $active_tab = 'instructions';
     
    222200                <a href="?page=pet-match-pro-options&subpage=label_options"
    223201                   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>
    224204                <a href="?page=pet-match-pro-options&subpage=instructions"
    225205                   class="nav-tab <?php echo $active_tab == 'instructions' ? 'nav-tab-active' : ''; ?>"><?php _e('Instructions', 'pet-match-pro-plugin'); ?></a>
     
    251231                    );                                                       
    252232                    //Based on the Partner API load filter options
    253 //                  $partner_api = $general_options['integration_partner'];
    254233                    if ($this->integrationPartner == constant('PETPOINT')) {
    255  //                   if ($partner_api == 'PetPoint') {
    256234                        //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;
    261235                        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' );
    265236                        submit_button('Save Filters');
    266237                    } elseif ($this->integrationPartner == constant('RESCUEGROUPS')) {
    267238                        //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;
    273239                        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' );
    277240                        submit_button('Save Filters');
    278241                    } else {
     
    295258                        'pet-match-pro-label-options'
    296259                    );               
    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-';
    304260                    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;
    311261                        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' );
    315262                        submit_button('Save Labels');
    316263                    } 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;
    323264                        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' );
    327265                        submit_button('Save Labels');
    328266                    } else {
     
    330268                        echo 'Select a Partner API from the General Options tab to load label options.';
    331269                    }
     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');                   
    332279                } elseif ($active_tab == 'instructions') {
    333280                    register_setting(
     
    347294        $options = get_option('pet-match-pro-general-options');
    348295        //var_dump($options);
    349         return '<p>' . __('General configuration to make things run', 'pet-match-pro-plugin') . '</p>';
    350     } // end general_options_callback
     296        return '<p>' . __('General PetMatchPro Configuration', 'pet-match-pro-plugin') . '</p>';
     297    }
    351298   
    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_callback   
    357 
    358299    public function contact_options_callback() {
    359300        $options = get_option('pet-match-pro-contact-options');
    360301        //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>';
    362309    } // end general_options_callback
     310
    363311
    364312    public function instructions_callback() {
    365313        $options = get_option('pet-match-pro-instructions');
    366314        //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>';
    368316    } // end general_options_callback
    369317   
     
    411359                    'integration_partner',
    412360                    Pet_Match_Pro_Public::$integrationPartners,
    413 //                    array('PetPoint' => 'PetPoint', 'RescueGroups' => 'RescueGroups'),
    414361                    $this->pmpAdminInfo['integration_partner'],
    415362                    'class' => $generalOptionsClass
     
    458405                array('N' => 'No', 'Y' => 'Yes', 'A' => 'Either'),
    459406                $helpText,
    460 //                $this->pmpAdminInfo['on_hold_status'],
    461407                'class' => $generalOptionsClass
    462408            )
     
    479425                     'organization_id',
    480426                     $helpText,
    481 //                   $this->pmpAdminInfo['organization_id'],
    482427                     'class' => $generalOptionsClass
    483428                )
     
    505450                     'search_result_limit',
    506451                     $helpText,
    507 //                   $this->pmpAdminInfo['search_result_limit'],
    508452                     'class' => $generalOptionsClass
    509453                )
     
    539483                    'order_by',
    540484                    $orderidValues,
    541 //                    array('Breed' => 'Breed', 'ID' => 'ID', 'Name' => 'Name', 'Sex' => 'Sex'),
    542485                    $this->pmpAdminInfo['order_by'],
    543486                    'class' => $generalOptionsClass             
     
    560503        }
    561504
    562 //      if ( $this->integrationPartner == constant('RESCUEGROUPS') ) {
    563 //          $sortOrderKey = constant('LEVEL_PREFIX_SEARCH_OPTION_VALUE') . $sortOrderField . '_adopt';
    564 //          $sortOderValues = $pmpFieldValuesAdopt[$sortOrderKey];
    565 
    566505        add_settings_field(
    567506            'sort_order',
     
    577516            )
    578517        );
    579 //      }
    580518           
    581519        /* New Setting to Control Display of Orderby Labels */
     
    671609            )
    672610        );
    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                               
    718612        //echo 'level_animal_detail_icons_adopt = ' . $pmpOptionLevelsGeneral['level_animal_detail_icons_adopt'] . '<br>';
    719613        if ( (array_key_exists('level_animal_detail_icons_adopt', $pmpOptionLevelsGeneral)) && ($this->PMPLicenseTypeID <= $pmpOptionLevelsGeneral['level_animal_detail_icons_adopt']) && (!empty($this->pmpLicenseKey)) ) {
     
    735629                array('Enable' => 'Show Icons on Animal Details'),
    736630                $this->pmpAdminInfo['adoptable_animal_detail_icons'],
    737 //                $active,
    738631                'class' => $classDetailIcons
    739632            )
     
    831724       
    832725        //scan directory
    833         //$templates = array_diff(scandir(plugin_dir_path(dirname(__FILE__)) . 'public/templates/pp/'), array('..', '.'));       
    834726        /* RMB - Check if Child Directory Exists, Otherwise Set to Plugin Default */     
    835727        $general_options = get_option('pet-match-pro-general-options');
    836         $this->integration_partner = $general_options['integration_partner'];
    837728        $templateDir = constant('TEMPLATES_DIR') . '/';
    838729        //$templateDir = 'templates/';
    839         if ($this->integration_partner == constant('PETPOINT')) {
    840         //if($this->integration_partner == 'PetPoint'){
     730        if ($this->integrationPartner == constant('PETPOINT')) {
    841731            $templateDir = $templateDir . constant('PETPOINT_DIR') . '/';
    842 //          $templateDir = $templateDir . 'pp/';
    843         } elseif ($this->integration_partner == constant('RESCUEGROUPS')) {
     732        } elseif ($this->integrationPartner == constant('RESCUEGROUPS')) {
    844733            $templateDir = $templateDir . constant('RESCUEGROUPS_DIR') . '/';
    845734        }
     
    849738        //echo 'Free License ID Level is ' . FreeLevel . '<br>';
    850739        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 */
    852740            $templateDir = get_stylesheet_directory(dirname(__FILE__)) . '/petmatchpro/' . $templateDir;
    853741            //echo 'Template Director is ' . $templateDir . '<br>';
     
    855743        } elseif ($this->PMPLicenseTypeID != constant('FREE_LEVEL'))  {
    856744            $templateDir = constant("PET_MATCH_PRO_PATH") . '/' . constant('PUBLIC_DIR') . '/' . $templateDir;
    857 //          $templateDir = constant("PET_MATCH_PRO_PATH") . '/public/' . $templateDir;
    858745            $templates = array_diff(scandir($templateDir), array('..', '.')); 
    859746        } else {
     
    882769                array('pet-match-pro-general-options',
    883770                    'details_template_adopt',
    884 //                  'adoptable_details_template',
    885771                    $templateVals,
    886772                    $this->pmpAdminInfo['details_template_adopt'],
    887 //                  $pmpAdminInfo['adoptable_details_template'],
    888773                    'class' => $generalOptionsClass         
    889774                )
     
    911796                array('pet-match-pro-general-options',
    912797                    'details_template_lost',
    913 //                  'lost_details_template',
    914798                    $templateVals,
    915799                    $this->pmpAdminInfo['details_template_lost'],
    916 //                  $pmpAdminInfo['lost_details_template'],
    917800                    'class' => $generalOptionsClass                             
    918801                )
     
    941824                array('pet-match-pro-general-options',
    942825                    'details_template_found',
    943 //                  'found_details_template',
    944826                    $templateVals,
    945827                    $this->pmpAdminInfo['details_template_found'],
    946 //                  $pmpAdminInfo['found_details_template'],
    947828                    'class' => $generalOptionsClass                           
    948829                )
     
    11401021                array('pet-match-pro-general-options',
    11411022                    'no_search_results_adopt',
    1142 //                  'no_animals_found',
    11431023                    $this->pmpAdminInfo['no_search_results_adopt'],
    1144 //                  $pmpAdminInfo['no_animals_found'],
    11451024                    'class' => $generalOptionsClass
    11461025                )
     
    11681047                array('pet-match-pro-general-options',
    11691048                    'no_search_results_lost',
    1170 //                  'lost_no_animals_found',
    11711049                    $this->pmpAdminInfo['no_search_results_lost'],
    1172 //                  $pmpAdminInfo['lost_no_animals_found'],
    11731050                    'class' => $generalOptionsClass
    11741051                )
     
    11971074                array('pet-match-pro-general-options',
    11981075                    'no_search_results_found',
    1199 //                  'found_no_animals_found',
    12001076                    $this->pmpAdminInfo['no_search_results_found'],
    1201 //                  $pmpAdminInfo['found_no_animals_found'],
    12021077                    'class' => $generalOptionsClass
    12031078                )
     
    12261101                array('pet-match-pro-general-options',
    12271102                    'no_search_results_featured',
    1228 //                  'featured_no_animals_found',
    12291103                    $this->pmpAdminInfo['no_search_results_featured'],
    1230 //                  $pmpAdminInfo['featured_no_animals_found'],
    12311104                    'class' => $generalOptionsClass
    12321105                )
     
    12391112            $generalOptionsClass = 'pmp-option-disable';
    12401113        }
    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                           
    12741115            add_settings_field(
    12751116                'Default Animal Description ',
     
    13101151}
    13111152
    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() {       
    13201154        add_settings_section(
    13211155            'contact_settings_section',                        // ID used to identify this section and with which to register options
     
    13241158            'pet-match-pro-contact-options'                    // Page on which to add this section of options
    13251159        );
    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);
    13531160
    13541161        /* Get Field Visibility Levels by License Type */
     
    17921599            'pet-match-pro-contact-options'
    17931600        );
    1794        
    1795         //$contactOptions = get_option('pet-match-pro-contact-options');
    1796         //echo '<pre>CONTACT OPTIONS<br>'; print_r($contactOptions); echo '</pre>';
    17971601    }
    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   
    17992045    public function initialize_API_license_form() {
    1800         //delete_option('pet-match-pro-license');
    18012046    }
    18022047
     
    18502095            'instruction_settings_section'
    18512096            );
    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 //        }
    18642097
    18652098        /* Get Adoptable Search Shortcode Instructions */
     
    22902523            //update_option( 'pet-match-pro-license', $default_array );
    22912524        } // 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;
    22962525        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';       
    22982526    }
    22992527
     
    23042532        $license_param = $this->responseObj->lic_param;
    23052533        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';
    23072534    }
    23082535
     
    23192546        if ( ($args[2]) ) {
    23202547            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]] . '" />';
    23222548        } else {
    23232549            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]] . '" />';
    23252550        }   
    23262551    } // end input_element_callback
     
    23682593            if (is_numeric($key)) {
    23692594                $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] . ' />';
    23712595                $html .= '&nbsp;<label for="' . $args[0] . '[' . $args[1] . ']">' . $value . '   </label>';
    23722596            } else {
    23732597                $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] . ' />';
    23752598                $html .= '&nbsp;<label for="' . $args[0] . '[' . $args[1] . ']">' . $value . '   </label>';
    23762599            }
     
    23792602    }
    23802603    private function get_file_data($file_path){
    2381        
    2382         // $file_handle = fopen($requireFile, 'r'); // Open the file for reading
    2383 
    2384         // if ($file_handle) {
    2385            
    2386         //     $searchAdopt = fread($file_handle, filesize($requireFile)); // Read the file contents
    2387            
    2388         //     fclose($file_handle); // Close the file handle
    2389 
    2390         //     // Now, $file_contents contains the contents of the file
    2391         //     // You can use $file_contents as needed
    2392         // } else {
    2393         //     echo 'Failed to open file for reading.';
    2394         // }
    2395         // Initialize the WP_Filesystem
    2396        
    23972604        // Attempt to get access to the filesystem
    23982605        if ( WP_Filesystem() ) {
     
    24132620            }
    24142621        }
    2415 
    24162622    }
     2623   
    24172624    public function radio_element_callback($args) {
    24182625        $options = get_option($args[0]);
  • petmatchpro/trunk/admin/partials/pmp-admin-info.php

    r3050057 r3055603  
    7777$this->pmpAdminInfo['sponsor_link'] = 'Enter external URL to visit sponsor website.';
    7878$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.';
    7980
    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.';
    81103?>
  • petmatchpro/trunk/includes/class-pet-match-pro.php

    r3050057 r3055603  
    191191            //load a message that will say whatever or do something for defaults
    192192        }
     193        $this->loader->add_action( 'admin_init', $plugin_settings, 'initialize_color_options' );       
    193194    }
    194195
  • petmatchpro/trunk/includes/pp/class-pet-match-pro-pp-api.php

    r3053866 r3055603  
    4444    private $generalOptions;
    4545    private $partialsDir;
     46    private $partialsPublicDir;
    4647    private $filterFunction;
    4748    private $animalDetailFunction;
     
    4950    private $allAPIFunction;
    5051    public $displayIcons;     
    51     public $integration_partner;
     52    public $integrationPartner;
    5253   
    5354    public function __construct($authKey, $activated) {
     
    6970        $PMPGeneralOptions = get_option('pet-match-pro-general-options');
    7071        $this->generalOptions = $PMPGeneralOptions;
     72        $this->integrationPartner = $this->generalOptions['integration_partner'];       
    7173        //echo '<pre>GENERAL OPTIONS<br>'; print_r($this->generalOptions); echo '<pre>';
    7274        if ( (array_key_exists('details_page_adopt', $this->generalOptions)) && (is_numeric($this->generalOptions['details_page_adopt'])) && (intval($this->generalOptions['details_page_adopt']) > 0) ) {
     
    144146       
    145147        $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') . '/';       
    146149
    147150        /* Include Class Defining Functions for Processing Animal Searches */
     
    692695            //echo '<pre>Results from ' . $firstMethod . ' SEARCH '; print_r($firstxmlWSArray); echo '</pre><br>';
    693696        } else {
    694             $firstoutputWS = array();
     697            $firstoutputWS = [];
     698            $firstxmlWSArray = [];
    695699//          $firstoutputWS = '';
    696700        }
     
    719723            //echo '<pre>Results from ' . $nextMethod . ' SEARCH '; print_r($nextxmlWSArray); echo '</pre><br>';
    720724        } else {
    721             $nextxmlWSArray = array();
     725            $nextxmlWSArray = [];
     726            $nextxmlWSArray = [];
    722727//          $nextxmlWSArray = '';
    723728        }
     
    767772        }
    768773
    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>';
    770775               
    771776        if ( (is_countable($xmlWSArray)) && (array_key_exists('XmlNode',$xmlWSArray)) ) {
     
    780785        if ($mergeCount > 0) {
    781786            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>';
    783788                $dateValue = date("Y-m-d",strtotime($value['an']['Date']));
    784789                //echo 'Date Field is ' . $value['an']['Date'] . ', convert to date as ' . $dateValue . '<br>';
     
    786791                $xmlWSArray[$ID]['an']['Date'] = $dateValue;
    787792            }
    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>';
    789794
    790795            /* Sort Values Based on Field Specified */
     
    964969            }
    965970            $results = array_combine(array_map('strtolower', $keysArray), $valuesArray);
     971            //echo '<pre>RESULTS<br>'; print_r($results); echo '</pre>';
    966972            //to lower case just to match keys
    967973            if (!array_key_exists(constant('ERROR'), $searchResultDetails)) {
     
    982988                        //echo 'Set Label Value to ' . $DetailsOutput[$key]['label'] . '<br>';
    983989                    }
    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//                  }
    9901001                    //for sex in whole world used on found and lost
    9911002                    if ($key == constant('PETPOINT_SEX')) {
     
    10251036
    10261037                    /* 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')) {                   
    10281040                        $DetailsOutput[$key]['value'] = date("m-d-Y",strtotime($results[$key]));
    10291041                    }
     
    10411053                }
    10421054            }
    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()) {           
    10441067                $detailsPage = $DetailPageURL . '?method=' . $searchMethod . '&animalID=' . $results['id'];           
    10451068            }
     
    11771200        /* Obtain License Type to Secure Features */   
    11781201        $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       
    11791209        /*Include Custom CSS from Admin for Paid Licenses */
    11801210        if ($licenseTypeID != constant('FREE_LEVEL')) {
     
    17091739                    /* Set Image OnClick Parameter */
    17101740//                  $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                    }
    17121750                    $clickID = 'pmp-animal-image-' . strtolower($species) . '-' . str_replace(" ", "-", strtolower($DetailsOutput['name']['value']));
    17131751                    $clickText = 'Learn More About ' . ucfirst($DetailsOutput['name']['value']);
     
    17951833        /* Obtain License Type to Secure Features */   
    17961834        $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 -->';
    17971841
    17981842        /*Include Custom CSS from Admin for Paid Licenses */
     
    19281972                    /* RMB - Remove Time from Date Fields */
    19291973                    if (str_contains($key, 'date')) {
     1974                        //echo 'Removing Time from Key ' . $key . '<br>';
    19301975                        $animalDetails[$key]['value'] = date("m-d-Y",strtotime($detailsItem[$key]));
    19311976                    }           
     
    20292074        /* RMB - Check if Child Directory Exists, Otherwise Set to Plugin Default */
    20302075        $general_options = get_option('pet-match-pro-general-options');
    2031         $this->integration_partner = $general_options['integration_partner'];
     2076        //$this->integrationPartner = $general_options['integration_partner'];
    20322077        $templateDir = constant('TEMPLATES_DIR') . '/';
    20332078//          $templateDir = 'templates/';
    2034         if($this->integration_partner == 'PetPoint'){
     2079        if($this->integrationPartner == constant('PETPOINT')){
    20352080            $templateDir = $templateDir . constant('PETPOINT_DIR') . '/';
    20362081        }
  • petmatchpro/trunk/includes/rg/class-pet-match-pro-rg-api.php

    r3053008 r3055603  
    2525    public $contactOptions;
    2626    private $partialsDir;
     27    private $partialsPublicDir;
    2728    private $filterFunction;
    2829    private $animalDetailFunction;
     
    9394
    9495        $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') . '/';
    9597
    9698        /* Include Class Defining Functions for Processing Animal Searches */
     
    598600        $resultCount = intval($results['foundRows']);
    599601        //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
    601609        /*Include Custom CSS from Admin for Paid Licenses */
    602610        if ($this->PMPLicenseTypeID != constant('FREE_LEVEL')) {
     
    712720        /* Identify Location of Icon Images */
    713721        $iconPath = constant('PET_MATCH_PRO_PATH') . '/' . constant('INCLUDE_DIR') . '/' . constant('IMAGES_DIR') . '/';
    714            
     722
    715723        // Sets the counter to zero to use to loop through array count
    716724        $counter = 0;       
     
    848856                            $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 -->';
    849857                        }   
    850                         $TDresult .= '<div class ="pmp-search-result pmp-animal-details-no-labels">';               
     858//                        $TDresult .= '<div class ="pmp-search-result pmp-animal-details-no-labels">';               
    851859                    }
    852860                    elseif ($labels != 'Enable') { /* RMB */
    853861                        //echo 'Processing Key ' . $levelKey . ' with Level Value ' . $fieldLevels[$levelKey] . '<br>';
     862                        $TDresult .= '<div class ="pmp-search-result pmp-animal-details-no-labels">';                                       
    854863                        if ($this->PMPLicenseTypeID <= $fieldLevels[$levelKey]) {
    855864                            $TDresult .= '<span class ="pmp-search-result-detail pmp-animal-' . strtolower($key) . '-detail">' . $this->searchOutput[$key]['value'] . '</span> |'; /* RMB */
     
    858867                            $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> |';                 
    859868                        }
     869                        $TDresult .= '</div><!-- .pmp-animal-details-no-labels -->';
    860870                    } else { /* RMB */
    861871                        $DetailLabel = '<div class ="pmp-search-result-label pmp-animal-' . strtolower($key) . '-label">' . $this->searchOutput[$key]['label'] . ': </div>'; /* RMB */               
     
    946956        //echo '<pre> OUTPUT DETAILS CALLED DETAILS<br>'; print_r($results); echo '</pre>';
    947957        $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
    949965        /*Include Custom CSS from Admin for Paid Licenses */
    950966        if ($this->PMPLicenseTypeID != constant('FREE_LEVEL')) {
  • petmatchpro/trunk/pet-match-pro.php

    r3053866 r3055603  
    1313 * Plugin Name:       PetMatchPro
    1414 * Description:        Integrates animal search and details from your PetPoint/Petango or RescueGroups account into your website with simple shortcodes.
    15  * Version:           4.6.5
     15 * Version:           4.7.1
    1616 * Author:            PetMatchPro
    1717 * Author URI:        https://PetMatchPro.com
     
    2828 * Current plugin version.
    2929 */
    30 define('PET_MATCH_PRO_VERSION', '4.6.5');
     30define('PET_MATCH_PRO_VERSION', '4.7.1');
    3131
    3232/* Define Global Variables */
Note: See TracChangeset for help on using the changeset viewer.