2021-10-29 14:04:26 +03:00
|
|
|
|
<?php defined('BASEPATH') or exit('No direct script access allowed');
|
|
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------------
|
2023-12-31 21:46:27 +03:00
|
|
|
|
* IFLRandevu - İzmir Fen Lisesi Randevu Portalı
|
2021-10-29 14:04:26 +03:00
|
|
|
|
*
|
|
|
|
|
* @package EasyAppointments
|
|
|
|
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
2021-12-18 19:43:45 +03:00
|
|
|
|
* @copyright Copyright (c) Alex Tselegidis
|
2021-10-29 14:04:26 +03:00
|
|
|
|
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
|
|
|
|
* @link https://easyappointments.org
|
|
|
|
|
* @since v1.4.0
|
|
|
|
|
* ---------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Easy!Appointments loader.
|
|
|
|
|
*
|
|
|
|
|
* @property EA_Benchmark $benchmark
|
|
|
|
|
* @property EA_Cache $cache
|
|
|
|
|
* @property EA_Calendar $calendar
|
|
|
|
|
* @property EA_Config $config
|
|
|
|
|
* @property EA_DB_forge $dbforge
|
|
|
|
|
* @property EA_DB_query_builder $db
|
|
|
|
|
* @property EA_DB_utility $dbutil
|
|
|
|
|
* @property EA_Email $email
|
|
|
|
|
* @property EA_Encrypt $encrypt
|
|
|
|
|
* @property EA_Encryption $encryption
|
|
|
|
|
* @property EA_Exceptions $exceptions
|
|
|
|
|
* @property EA_Hooks $hooks
|
|
|
|
|
* @property EA_Input $input
|
|
|
|
|
* @property EA_Lang $lang
|
|
|
|
|
* @property EA_Loader $load
|
|
|
|
|
* @property EA_Log $log
|
|
|
|
|
* @property EA_Migration $migration
|
|
|
|
|
* @property EA_Output $output
|
|
|
|
|
* @property EA_Profiler $profiler
|
|
|
|
|
* @property EA_Router $router
|
|
|
|
|
* @property EA_Security $security
|
|
|
|
|
* @property EA_Session $session
|
|
|
|
|
* @property EA_Upload $upload
|
|
|
|
|
* @property EA_URI $uri
|
|
|
|
|
*/
|
2023-11-29 12:24:09 +03:00
|
|
|
|
class EA_Loader extends CI_Loader
|
|
|
|
|
{
|
2021-11-15 10:53:59 +03:00
|
|
|
|
/**
|
2021-11-17 10:41:51 +03:00
|
|
|
|
* Override the original view loader method so that layouts are also supported.
|
|
|
|
|
*
|
2021-11-15 10:53:59 +03:00
|
|
|
|
* @param string $view View filename.
|
|
|
|
|
* @param array $vars An associative array of data to be extracted for use in the view.
|
|
|
|
|
* @param bool $return Whether to return the view output or leave it to the Output class.
|
2021-11-17 10:41:51 +03:00
|
|
|
|
*
|
2021-11-15 11:47:51 +03:00
|
|
|
|
* @return object|string
|
2021-11-15 10:53:59 +03:00
|
|
|
|
*/
|
2023-11-29 12:24:09 +03:00
|
|
|
|
public function view($view, $vars = [], $return = false)
|
2021-11-15 10:53:59 +03:00
|
|
|
|
{
|
2021-11-17 10:41:51 +03:00
|
|
|
|
$layout = config('layout');
|
|
|
|
|
|
|
|
|
|
$is_layout_page = empty($layout); // This is a layout page if "layout" was undefined before the page got rendered.
|
2023-11-29 12:24:09 +03:00
|
|
|
|
|
|
|
|
|
$result = $this->_ci_load([
|
|
|
|
|
'_ci_view' => $view,
|
|
|
|
|
'_ci_vars' => $this->_ci_prepare_view_vars($vars),
|
2023-12-22 13:35:41 +03:00
|
|
|
|
'_ci_return' => $return,
|
2023-11-29 12:24:09 +03:00
|
|
|
|
]);
|
2021-11-15 10:53:59 +03:00
|
|
|
|
|
|
|
|
|
$layout = config('layout');
|
|
|
|
|
|
2023-11-29 12:24:09 +03:00
|
|
|
|
if ($layout && $is_layout_page) {
|
|
|
|
|
$result = $this->_ci_load([
|
|
|
|
|
'_ci_view' => $layout['filename'],
|
|
|
|
|
'_ci_vars' => $this->_ci_prepare_view_vars($vars),
|
2023-12-22 13:35:41 +03:00
|
|
|
|
'_ci_return' => $return,
|
2023-11-29 12:24:09 +03:00
|
|
|
|
]);
|
2021-11-15 10:53:59 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
|
}
|
2021-10-29 14:04:26 +03:00
|
|
|
|
}
|