- Project structure
- Database schema
- Fixed list fields
- Debugging ResourceSpace
- Writing your own plugins
- Context help links
- Custom fields ("user" defined)
- Query caching
- All user permissions
- Client side API calls
- Modals
- Sending user notifications
- Progressive Web App
- Managing (PHP) code dependencies
- Managing (JS) code dependencies
- OpenAPI documentation
- Table: activity_log
- Table: annotation
- Table: annotation_node
- Table: collection
- Table: collection_keyword
- Table: collection_log
- Table: collection_resource
- Table: collection_savedsearch
- Table: comment
- Table: daily_stat
- Table: dash_tile
- Table: dynamic_tree_node
- Table: external_access_keys
- Table: filter
- Table: filter_rule
- Table: filter_rule_node
- Table: ip_lockout
- Table: job_queue
- Table: keyword
- Table: keyword_related
- Table: mail_log
- Table: message
- Table: node
- Table: node_keyword
- Table: plugins
- Table: preview_size
- Table: report
- Table: report_periodic_emails
- Table: report_periodic_emails_unsubscribe
- Table: request
- Table: research_request
- Table: resource
- Table: resource_alt_files
- Table: resource_custom_access
- Table: resource_dimensions
- Table: resource_keyword
- Table: resource_log
- Table: resource_node
- Table: resource_related
- Table: resource_type
- Table: resource_type_field
- Table: resource_type_field_resource_type
- Table: search_log
- Table: site_text
- Table: slideshow
- Table: sysvars
- Table: tab
- Table: user
- Table: user_collection
- Table: user_dash_tile
- Table: user_message
- Table: user_preferences
- Table: user_rating
- Table: user_report
- Table: user_userlist
- Table: usergroup
- Table: usergroup_collection
- Table: usergroup_dash_tile
Custom fields ("user" defined)
ResourceSpace can be configured with custom fields. An example of this feature already being used using this system can be seen on Research Request.
A custom field structure looks like below:
array(
"id" => 1,
"title" => "~en:Roles~fr:Rôles",
"type" => FIELD_TYPE_CHECK_BOX_LIST,
"required" => true,
"options" => array("IT", "~en:Customer Success~fr:Succès Client", "Sales", "Support", "Admin")
)
A field is considered valid as long as it has the following keys/properties:
- id - a numeric and unique number. This is used to easily generate HTML properties such as ID or name.
- title - an i18l string or just a normal string. This is rendered as the label.
- type - the field type. This key is using the ResourceSpace metadata field type constants (e.g FIELD_TYPE_TEXT_BOX_SINGLE_LINE)
- required - true if the field is required, false otherwise
- options - Required key if the type is part of the $FIXED_LIST_FIELD_TYPES. List of options. An option can be an i18l string.
Note: if a field is missing any of the required keys, upon validation - using get_valid_custom_fields(), it will be dropped from the list of fields.
On the page where you want to use custom fields, use the process_custom_fields_submission() at the top of the page. This will prepare default values or return the posted data for each field.
To render the fields just call render_custom_fields() passing the processed custom fields. The custom fields will be rendered based on the type. If the type isn't supported, the field will be displayed as a single line text box.