The hTheme helper provides a collection of functions that facilitate theme management in Osclass. These functions allow you to generate URLs for theme administration, render theme or plugin files on the front-end, and handle the enqueuing and removal of scripts and styles. Additionally, the helper includes utilities for resending flash messages and printing bulk action selectors.
osc_admin_render_theme_url($file = '') – Returns the URL for the current theme administration options. The provided file path should be relative.
osc_render_file($file = '') – Renders the specified file. This function first sanitizes the file path and then includes the file from the current theme’s plugins directory or from the plugins directory.
osc_render_file_url($file = '') – Returns the URL for rendering a custom file in the front-end. The file path is sanitized before being appended to the base URL.
osc_theme_get_info($theme) – Returns an array with information about the specified front-office theme. Provide the theme’s folder name (e.g., bender, sigma, delta).
osc_resend_flash_messages($section = 'pubMessages') – Re-sends all flash messages stored in the given section. Useful for custom theme or plugin files to ensure that flash messages are displayed properly.
osc_enqueue_script($id) – Enqueues a JavaScript file by its identifier so that it will be loaded.
osc_remove_script($id) – Removes a previously enqueued script from the queue.
osc_register_script($id, $url, $dependencies = null, $attributes = null) – Registers a script to be loaded. Parameters include:
osc_unregister_script($id) – Unregisters a previously registered script, so it will not be loaded.
osc_load_scripts() – Prints the HTML tags necessary to load all enqueued scripts. It also runs hooks for additional script loading in both the front office and admin area.
osc_enqueue_style($id, $url) – Enqueues a CSS file by its identifier. The URL of the stylesheet is specified.
osc_remove_style($id) – Removes a previously enqueued stylesheet from the queue.
osc_load_styles() – Prints the HTML tags necessary to load all enqueued styles.
osc_print_bulk_actions($id, $name, $options, $class = '') – Outputs an HTML <select> element for bulk actions. Parameters include: