<commit_before><?php
class ProudGeneralSettingsPage
{
    /**
     * Holds the values to be used in the fields callbacks
     */
    private $options;

    /**
     * Start up
     */
    public function __construct()
    {
      add_action( 'admin_menu', array($this, 'create_menu') );
      $this->key = 'proudsettings';
      $this->fields = null;
    }

    // create custom plugin settings menu
    

    public function create_menu() {

      add_menu_page(
        'Settings', 
        'Settings', 
        'edit_proud_options', 
        $this->key, array($this, 'settings_page'), 
        plugins_url('/images/icon.png', __FILE__) 
      );
      /*add_submenu_page( 
          'integrations',
          'General Settings',
          'General Settings',
          'manage_options',
          'alertbar',
          array($this, 'settings_page')
      );*/

      $this->options = [
        'city',
        'state',
        'lat',
        'lng',

        'external_link_window',
        'agency_label',
      ];
    }


    private function build_fields(  ) {
      wp_enqueue_script( 'google-places-api', '//maps.googleapis.com/maps/api/js?key=AIzaSyBBF8futzrzbs--ZOtqQ3qd_PFnVFQYKo4&libraries=places' );
      
      $this->fields = [
        
        'search_title' => [
          '#type' => 'html',
          '#html' => '<h3>' . __pcHelp('Location') . '</h3>',
        ],
        'city_input' => [
          '#type' => 'text',
          '#title' => __pcHelp('Autopopulate'),
          '#name' => 'city_input',
        ],
        'search_title' => [
          '#type' => 'html',
          '#html' => 
            "<script type='text/javascript'>(function($) {
              google.maps.event.addDomListener(window, 'load', function () {
                var places = new google.maps.places.Autocomplete(document.getElementById('city_input'), options);
                google.maps.event.addListener(places, 'place_changed', function () {
                  $('#city-input-wrapper-header').addClass('active');
                  var place = places.getPlace();
                  console.log(place);
                  //window.location = 'https://demo.proudcity.com/get/' + place.address_components[2].long_name + '/' + place.address_components[0].long_name;
                });
              });
            });</script>",
        ],
        'city' => [
          '#type' => 'text',
          '#title' => __pcHelp('City'),
          '#description' => __('Example: "Oakland" or "San Francisco"'),<commit_msg>Reworking forms, fixing perms issues<commit_after><?php
class ProudGeneralSettingsPage
{
    /**
     * Holds the values to be used in the fields callbacks
     */
    private $options;

    /**
     * Start up
     */
    public function __construct()
    {
      add_action( 'admin_menu', array($this, 'create_menu') );
      $this->key = 'proudsettings';
      $this->fields = null;
    }

    // create custom plugin settings menu
    

    public function create_menu() {

      add_menu_page(
        'Settings', 
        'Settings', 
        'edit_proud_options', 
        $this->key, array($this, 'settings_page'), 
        plugins_url('/images/icon.png', __FILE__) 
      );
      /*add_submenu_page( 
          'integrations',
          'General Settings',
          'General Settings',
          'manage_options',
          'alertbar',
          array($this, 'settings_page')
      );*/

      $this->options = [
        'city',
        'state',
        'lat',
        'lng',

        'external_link_window',
        'agency_label',
      ];
    }


    private function build_fields(  ) {
      wp_enqueue_script( 'google-places-api', '//maps.googleapis.com/maps/api/js?key=AIzaSyBBF8futzrzbs--ZOtqQ3qd_PFnVFQYKo4&libraries=places' );
      
      $this->fields = [
        
        'search_title' => [
          '#type' => 'html',
          '#html' => '<h3>' . __pcHelp('Location') . '</h3>',
        ],
        'city_input' => [
          '#type' => 'text',
          '#title' => __pcHelp('Autopopulate'),
          '#name' => 'city_input',
        ],
        'city_input_script' => [
          '#type' => 'html',
          '#html' => 
            "<script type='text/javascript'>(function($) {
              google.maps.event.addDomListener(window, 'load', function () {
                var places = new google.maps.places.Autocomplete(document.getElementById('city_input'), options);
                google.maps.event.addListener(places, 'place_changed', function () {
                  $('#city-input-wrapper-header').addClass('active');
                  var place = places.getPlace();
                  console.log(place);
                  //window.location = 'https://demo.proudcity.com/get/' + place.address_components[2].long_name + '/' + place.address_components[0].long_name;
                });
              });
            })(jQuery);</script>",
        ],
        'city' => [
          '#type' => 'text',
          '#title' => __pcHelp('City'),
          '#description' => __('Example: "Oakland" or "San Francisco"'),
{'fraction_non_alphanumeric': 0.16238132911392406, 'fraction_numerical': 0.002768987341772152, 'mean_word_length': 1.8554488989271598, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 49, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2933283', 'n_tokens_mistral': 1533, 'n_tokens_neox': 1498, 'n_words': 245}