easyappointments/application/helpers/render_helper.php
2022-01-18 09:40:13 +01:00

71 lines
1.8 KiB
PHP

<?php defined('BASEPATH') or exit('No direct script access allowed');
/* ----------------------------------------------------------------------------
* Easy!Appointments - Open Source Web Scheduler
*
* @package EasyAppointments
* @author A.Tselegidis <alextselegidis@gmail.com>
* @copyright Copyright (c) Alex Tselegidis
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
* @link https://easyappointments.org
* @since v1.4.0
* ---------------------------------------------------------------------------- */
/**
* Render the HTML output of a timezone dropdown element.
*
* @param string $attributes HTML element attributes of the dropdown.
*
* @return string
*/
function render_timezone_dropdown(string $attributes = ''): string
{
$CI = get_instance();
$CI->load->library('timezones');
$timezones = $CI->timezones->to_grouped_array();
html_vars([
'attributes' => $attributes,
'timezones' => $timezones
]);
return $CI->load->view('components/timezone_dropdown', html_vars(), TRUE);
}
/**
* Render the language script tag.
*
* @param string $attributes HTML element attributes of the script element.
*
* @return string
*/
function render_language_script(string $attributes = ''): string
{
$CI = get_instance();
html_vars([
'attributes' => $attributes,
]);
return $CI->load->view('components/language_script', html_vars(), TRUE);
}
/**
* Render the global variables script tag.
*
* @param string $attributes HTML element attributes of the script element.
*
* @return string
*/
function render_global_variables_script(string $attributes = ''): string
{
$CI = get_instance();
html_vars([
'attributes' => $attributes,
]);
return $CI->load->view('components/global_variables_script', html_vars(), TRUE);
}