Record Structure // [toolbar_ui_type] => dropdown // [cookie_name] => NULL , // [default_cookie_value] => NULL , // [cookie_names_by_pv_slug] => array( // 'sites-to-advertise' => 'ad-swapper-sites-to-advertise' , // 'sites-to-advertise-on' => 'ad-swapper-sites-to-advertise-on' // ) , // [default_cookie_values_by_pv_slug] => array( // 'sites-to-advertise' => 'yes-yes' , // 'sites-to-advertise-on' => 'yes-yes' // ) , // [titles_by_value] => NULL // [custom_get_toolbar_html_function] => // [custom_get_toolbar_html_function_args] => // [custom_get_titles_by_value_function] => // [custom_get_titles_by_value_function_args] => // [custom_record_filtering_function] => // [custom_record_filtering_function_args] => // [get_help_html_function] => , // [get_help_html_function_args] => , // [foreign_dataset_field_args] => Array( // [foreign_dataset_slug] => validata_record_structures // [foreign_match_field_slug] => key // [foreign_title_field_slug] => slug // [this_match_field_slug] => record_structure_key // ) // ) // // // NOTES // ===== // 1. "toolbar_ui_type" must be one of:- // "dropdown", "buttons", "custom" // // 2. If "toolbar_ui_type" is "custom", then // "custom_get_toolbar_html_function" MUST be specified. // // 3. "xxx_function":- // o Can be NULL or an empty string if NO such function is // specified. And:- // o Must include the (absolute) namespace name (of the function // concerned) // // 4. "xxx_function_args" can be any PHP type. It will be passed to the // "xxx_function" as is. // // 5. "default_cookie_value" is the value to be used if the filter COOKIE // HASN'T been set yet. Should be a string. Defaults to the empty // string (""). // // 6. If there's NO:- // "custom_get_titles_by_value_function" // // then we'll (try to) get the titles by value from the:- // "foreign_dataset_field_args" // // 7. If there's NO:- // "custom_record_filtering_function" // // then we'll (try to) filter the records using the:- // "foreign_dataset_field_args" // // 8. If a valid:- // "get_help_html_function" // // is specified - and the "toolbar-ui-type" is either "dropdown" or // "button" - then a "toggle help" button/link will be displayed on // the filter toolbar. Which will show/hide the specified help HTML // in a DIV immediately below the filter toolbar. If // "toolbar-ui-type" is "custom" then the help text will only appear // if supported by the "custom_get_toolbar_html_function" function. // ------------------------------------------------------------------------- //\greatKiwi_byFernTec_adSwapper_local_v0x1x210_testDebug\pr( // $filter_details , // '$filter_details' // ) ; // ========================================================================= // If a PAGE VARIANT was specified (in $_GET['pv']), get and validate it... // ========================================================================= if ( array_key_exists( 'pv' , $_GET ) && in_array( $_GET['pv'] , array( 'sites-to-advertise' , 'sites-to-advertise-on' ) , TRUE ) ) { $selected_pv = $_GET['pv'] ; } else { $selected_pv = '' ; } // ------------------------------------------------------------------------- if ( $selected_pv !== '' ) { // --------------------------------------------------------------------- if ( ! array_key_exists( 'page_variants' , $selected_datasets_dmdd['dataset_records_table'] ) || ! is_array( $selected_datasets_dmdd['dataset_records_table']['page_variants'] ) || ! array_key_exists( $selected_pv , $selected_datasets_dmdd['dataset_records_table']['page_variants'] ) ) { $selected_pv = '' ; } // --------------------------------------------------------------------- } // ========================================================================= // Check/default the "toolbar ui type"... // ========================================================================= if ( array_key_exists( 'toolbar_ui_type' , $filter_details ) ) { // --------------------------------------------------------------------- if ( ! in_array( $filter_details['toolbar_ui_type'] , array( 'dropdown' , 'buttons' , 'custom' ) , TRUE ) ) { $ln = __LINE__ - 7 ; $msg = << "Title 1" // "value-2" => "Title 2" // ... // "value-N" => "Title N" // ) // // Where the "Title X" will be:- // o The // // // // // // ------------------------------------------------------------------------- $select_options = '' ; // ------------------------------------------------------------------------- foreach ( $filter_titles_by_value as $this_value => $this_title ) { // --------------------------------------------------------------------- if ( $this_value === $currently_selected_filter_value ) { $selected = ' SELECTED' ; } else { $selected = '' ; } // --------------------------------------------------------------------- $select_options .= << {$this_title} EOT; // --------------------------------------------------------------------- } // ========================================================================= // toggle help ? // ========================================================================= if ( $help_html === '' ) { // --------------------------------------------------------------------- $toggle_help_link = '' ; // --------------------------------------------------------------------- $help_text_container = '' ; // --------------------------------------------------------------------- $help_js = '' ; // --------------------------------------------------------------------- } else { // --------------------------------------------------------------------- $toggle_help_link = <<toggle help EOT; // --------------------------------------------------------------------- $help_text_container = <<