easyappointments/application/helpers/render_helper.php

70 lines
1.8 KiB
PHP
Raw Normal View History

<?php defined('BASEPATH') or exit('No direct script access allowed');
/* ----------------------------------------------------------------------------
2022-01-18 15:05:42 +03:00
* Easy!Appointments - Online Appointment Scheduler
*
* @package EasyAppointments
* @author A.Tselegidis <alextselegidis@gmail.com>
2021-12-18 19:43:45 +03:00
* @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.
2020-12-05 12:55:20 +03:00
*
* @return string
*/
function render_timezone_dropdown(string $attributes = ''): string
{
2020-12-02 23:08:49 +03:00
$CI = get_instance();
2020-12-02 23:08:49 +03:00
$CI->load->library('timezones');
2020-12-02 23:08:49 +03:00
$timezones = $CI->timezones->to_grouped_array();
return $CI->load->view('components/timezone_dropdown', [
2022-01-18 11:40:13 +03:00
'attributes' => $attributes,
'timezones' => $timezones
], 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();
2022-01-18 11:40:13 +03:00
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();
2022-01-18 11:40:13 +03:00
html_vars([
'attributes' => $attributes,
]);
return $CI->load->view('components/global_variables_script', html_vars(), TRUE);
}