['zebra_forms'][ ]['field_specs'] // // variable, to the form. // // --- // // Note that the main routine for getting the field's value (to be // displayed in the form), is:- // get_field_value_for_zebra_form() // // from file: add-edit-record_create-zebra-form_get_field_value.php // // --- // // RETURNS // o On SUCCESS! // array( // $zebra_form (= reference to Zebra Form object instance) // $selected_datasets_dmdd_updated // ) // // o On FAILURE // $error_message STRING // ------------------------------------------------------------------------- // ========================================================================= // create_zebra_form_object_instance() // ----------------------------------- // // ======================================= // PROCESSING OVERVIEW (USING PSEUDO CODE) // ======================================= // // // 1. Instantiate the form... // // $zebra_form = new \Zebra_Form( // // // 2. Get the dataset record to be displayed/edited in the // // form... // // if ( ) { // // $the_record_to_be_displayed/edited_in_the form // = NULL ; // // } elseif ( ) { // // $the_record_to_be_displayed/edited_in_the form // = get_record_to_be_edited(...) // // } // // // 3. Loop over the Zebra Form field definitions (in the dataset // // definition) - adding each field in turn to the form... // // foreach ( categories // [dataset_name_singular] => category // [dataset_name_plural] => categories // [dataset_title_singular] => Category // [dataset_title_plural] => Categories // [basepress_dataset_handle] => Array( // [nice_name] => researchAssistant_byFernTec_categories // [unique_key] => 6934fccc-c552-46b0-8db5-87a022f7c...af7adf54 // [version] => 0.1 // ) // // [dataset_records_table] => Array( // // [columns] => Array( // // [0] => Array( // [column_title] => Project // [data_field_slug] => project_title // [question_sortable] => 1 // [data_field_slug_to_sort_by] => // [column_slug] => // ) // // [1] => Array( // [column_title] => Title // [data_field_slug] => title // [question_sortable] => 1 // [data_field_slug_to_sort_by] => // [column_slug] => // ) // // [2] => Array( // [column_title] => Action // [data_field_slug] => action // [question_sortable] => // [column_slug] => // ) // // ) // // [data_field_defs] => Array( // // [0] => Array( // [data_field_slug] => project_title // [value_from] => Array( // [method] => foreign-field // [instance] => title // [args] => Array( // [parent_key] => projects // ) // ) // ) // // [1] => Array( // [data_field_slug] => title // [value_from] => Array( // [method] => array-storage-field-slug // [instance] => title // ) // ) // // [2] => Array( // [data_field_slug] => // [value_from] => Array( // [method] => special-type // [instance] => action // ) // ) // // ) // // [rows_per_page] => 10 // [default_data_field_slug_to_orderby] => title // [default_order] => asc // [actions] => Array( // [edit] => edit // [delete] => delete // ) // [action_separator] => // // ) // // [zebra_form] => Array( // // [form_specs] => Array( // [name] => add_edit_category // [method] => POST // [action] => // [attributes] => Array( // [target] => _parent // ) // [clientside_validation] => 1 // ) // // [field_specs] => Array( // // [0] => Array( // [form_field_name] => parent_key // [zebra_control_type] => select // [label] => Project // [value_from] => Array( // [add] => Array( // [method] => literal // [args] => // ) // // [edit] => Array( // [method] => array-storage-field-slug // [args] => parent_key // ) // ) // [attributes] => Array() // [rules] => Array( // [required] => Array( // [0] => error // [1] => Field is required // ) // ) // [type_specific_args] => Array( // [options_getter_function] => Array( // [function_name] => \researchAssistant_byFernTec_datasetManagerDatasetDefs_categories\get_options_for_project_selector // [extra_args] => // ) // ) // [constraints] => Array( // [0] => Array( // [method] => unique-key // ) // ) // ) // // ... // // [5] => Array( // [form_field_name] => cancel // [zebra_control_type] => button // [label] => Cancel // [attributes] => Array( // [onclick] => window.parent.location.href="http://localhost/plugdev/wp-admin//admin.php?page=researchAssistant&action=manage-dataset&dataset_slug=categories" // ) // [rules] => Array() // [type_specific_args] => Array( // [caption] => Cancel // [type] => button // ) // [constraints] => Array() // ) // // ) // // [focus_field_slug] => 1 // // [checked_defaulted_ok] => 1 // // ) // // [array_storage_record_structure] => Array( // // [0] => Array( // [slug] => created_server_datetime_UTC // [value_from] => Array( // [method] => created-server-datetime-utc // ) // ) // // ... // // [6] => Array( // [slug] => notes_slash_comments // [value_from] => Array( // [method] => post // [instance] => notes_slash_comments // ) // ) // // [checked_defaulted_ok] => 1 // // ) // // [array_storage_key_field_slug] => key // // ) // // ------------------------------------------------------------------------- //\greatKiwi_basepressLogger\pr( $selected_datasets_dmdd ) ; // ========================================================================= // Init. // ========================================================================= $ns = __NAMESPACE__ ; $fn = __FUNCTION__ ; // ========================================================================= // Get the CORE PLUGAPP DIRS... // ========================================================================= // ------------------------------------------------------------------------- // \greatKiwi_byFernTec_adSwapper_local_v0x1x210_appsAPI\ // get_core_plugapp_dirs( // $path_in_plugin , // $app_handle = NULL // ) // - - - - - - - - - - - - - - - // Returns the dirspecs of the main dirs used in a given app. Ie:- // // array( // 'plugin_root_dir' => "xxx" , // 'plugins_includes_dir' => "xxx" , // 'plugins_app_defs_dir' => "xxx" , // 'dataset_manager_includes_dir' => "xxx" , // (1) // 'apps_dot_app_dir' => "xxx" , // (2) // 'apps_plugin_stuff_dir' => "xxx" // (3) // 'custom_pages_dir' => "xxx" // (4) // ) // // (1) This is where most of the "Dataset Manager" includes files // are stored. // // (2) If $app_handle === NULL, the returned 'apps_dot_app_dir' // is NULL too. // // (3) If $app_handle === NULL, the returned 'apps_plugin_stuff_dir' // is NULL too. // // (4) If $app_handle === NULL, the returned 'custom_pages_dir' // is NULL too. // // --- // // $path_in_plugin should be a file, directory or link path in the // plugin (or "app") from which this function is called. Typically, // one uses __FILE__ for this purpose. Eg:- // // \greatKiwi_byFernTec_adSwapper_local_v0x1x210_appsAPI\get_single_app_defs_root_dir( __FILE__ ) ; // // --- // // $app_handle should be either:- // // o A single "app slug" - eg; "research-assistant" - as a // STRING. For which the returned dirspec might be (eg):- // // /home/joe/.../plugins/some-plugin/app-defs/research-assistant.app // // Or:- // // o An array of (nested) app slugs. Eg:- // // array( // 'some-app' , // 'child-app' , // 'grandchild-app' // [...] // ) // // For which the returned dirspec might be (eg):- // // /home/joe/.../plugins/some-plugin/app-defs/some-app.app/child-app.app/grandchild-app.app // // Exits with an error message if the directory can't be returned (eg; // doesn't exist). // // NOTE! // ----- // These "apps" and "datasets" (etc) are typically defined in a directory // tree structure like (eg):- // // /plugins/this-plugin/ // +-- app-defs/ // | +-- some-app.app/ // | | +-- child-app.app/ // | | +-- grandchild-app.app // | | +-- etc... // | +-- another-app.app/ // | +-- ... // +-- includes/ // +-- js/ // +-- admin/ // +-- remote/ // +-- ...etc... // +-- this-plugin.php // +-- ...etc... // // ------------------------------------------------------------------------- $path_in_plugin = __FILE__ ; // ------------------------------------------------------------------------- if ( array_key_exists( 'application' , $_GET ) && trim( $_GET['application'] ) !== '' ) { $app_handle = $_GET['application'] ; } else { return <<