$breadcrumb = getBreadcrumb( !empty($bread) ? $bread : null, !empty($concatBreadcrumb) ? $concatBreadcrumb : false ); ?> <?php if(!empty($breadcrumb)): ?> <div class="container my-3"> <nav class="breadcrumb-container" aria-label="breadcrumb"> <?php echo $breadcrumb ?> </nav> </div> <?php endif; ?> <?php // END: Breadcrumbs ?><main id="main"> <?php // BEGIN: Content ?> <?php $anchorsNumber = 1; $chekForPoliticalFields = ($instance['role']['political'] || in_array($instance['role']['name'], ['P.O.', 'E.Q.', 'Dirigente', 'Segretario generale'])); ?> <main> <section class="my-5"> <div class="container"> <div class="row variable-gutters _reverse"> <div class="col-lg-8"> <div class="row"> <div class="d-flex align-items-center mb-4" style="gap:1rem;"> <div class="avatar size-xxl" style="display:block"> <img class="img-evidenza-personale" title="Foto Personale" src="<?php echo baseUrl('media/' . $_institution_info['short_institution_name'] . '/assets/images/' . $instance['photo']) ?>" onerror="this.onerror=null;this.src='/assets/admin/img/avatar.png';"> alt="Foto di <?php echo escapeXss(convertEncodeQuotes($instance['full_name'])) ?>"> </div> <div> <h1 class="mb-0 h2"> <?php echo !empty($pageName) && in_array($currentPageId, [238,239,242]) ? ($pageName . '<br> <hr>') : '' ?> <?php echo htmlEscape(convertEncodeQuotes(!empty($h1) ? $h1 : ( !empty($instance['firstname']) ? $instance['title'] . ' ' . $instance['lastname'] . ' ' . $instance['firstname'] : $instance['title'] . ' ' . $instance['full_name']))) ?> </h1>
self::$dirs = $dirs; } else { if ($theme !== null) { self::$theme = $theme; } else { self::$theme = config('theme', null, 'app'); } self::$theme = APP_PATH . 'Themes' . DIRECTORY_SEPARATOR . self::$theme . DIRECTORY_SEPARATOR; } $cachedFile = self::cache($file); extract($data, EXTR_SKIP); require($cachedFile); } /** * @param $file * @return string * @throws Exception */ public static function cache($file): string { if (!file_exists(self::$cachePath)) { mkdir(self::$cachePath, 0744); } $cachedFile = self::$cachePath . (str_replace(['/', self::$ext], ['_', ''], $file . self::$extCache)); $currentTime = time(); $hasCache = false; if (!self::$cacheEnabled && !file_exists($cachedFile)) {
} return $data; } } if (!function_exists('render')) { /** * @param string $layout * @param array $data * @param null $theme * @param bool $overwrite * @param array $dirs * @return void * @throws Exception */ function render(string $layout = '', array $data = [], $theme = null, bool $overwrite = false, array $dirs = []): void { \System\Layout::view($layout, $data, $theme, $overwrite, $dirs); } } if (!function_exists('trace')) { /** * @param string|array|object|null|bool $var * @param bool $exit * @param bool $v_dump * @param bool $label */ function trace(string|array|object|null|bool $var = '', bool $exit = false, bool $v_dump = true, bool $label = false): void { if ($label !== false) { echo "<div style='display: block;'><h2 style='color: red;'>" . $label . '</h2></div>'; } echo ('<pre>');
} } return $data; } } if (!function_exists('renderFront')) { /** * Funzione per la vista * @param string $layout File della vista da renderizzare * @param array $data Dati da passare alla vista * @param null $theme Tema da utilizzare per il render * @return void * @throws Exception */ function renderFront(string $layout = '', array $data = [], $theme = null): void { render($layout, $data, $theme); } } if (!function_exists('getInstitutionLogo')) { /** * Funzione che restituisce il logo dell'ente di appartenenza del dominio * Utilizzata nel front-end * * @return string * @throws Exception */ function getInstitutionLogo(): string { $institution = patOsInstituteInfo(); if (!empty($institution['simple_logo_file']) && file_exists('media/' . $institution['short_institution_name'] . '/assets/images/' . $institution['simple_logo_file'])) { return !empty($institution) ? 'src="' . baseUrl('media/' . $institution['short_institution_name'] . '/assets/images/' . $institution['simple_logo_file']) . '"alt="' . $institution['full_name_institution'] . '"' : '';
$data['pageName'] = !empty($currentPage['label']) ? $currentPage['label'] : $currentPage['name']; $data['menuPages'] = $sectionFO; $data['paragraphs'] = $contents; $data['table'] = !empty($table) ? $table->generate() : $table; $data['instance'] = $personnel; $data['noRequiredPublication'] = !empty($currentPage['no_required']); $data['allowSearch'] = true; $data['openData'] = true; $data['linkDownloadOpenData'] = !empty($currentPage['controller_open_data']) ? $currentPage['id'] : null; //Mostra il link alla gestione degli elementi di quest'archivio nel front-office se si è loggati $data['archive'] = !empty($currentPage['archive_name']) ? $currentPage['archive_name'] : null; $data['editRecord'] = true; $data['notEditable'] = empty($personnel); $data['snodo'] = !$existPersonnel; $data['rangeOpenData'] = 2000; //Inclusione di eventuali librerie esterne Action::getInstance()->do_action('i_seo_md_f_p', ['element' => &$personnel, 'data' => &$data]); Action::getInstance()->do_action('e_t_a_s', ['pageId' => $currentPageId, 'data' => &$data]); renderFront(config('vfo', null, 'app') . ($existPersonnel ? '/personnel/details' : '/pivot/pivot'), $data, 'frontend'); } /** * @description Metodo chiamato per la pagina "Archivio", * nella sezione Organizzazione -> Titolari di incarichi politici, di amministrazione, di direzione o di governo -> Presidente Consiglio Comunale * ID sezione 252 * * @url /page/page_id/page_name * @return void * @throws Exception * @noinspection DuplicatedCode */ public function presidentCityCouncilArchive(): void { Action::getInstance()->do_action('i_a_p_i_f_o', ['m' => __FUNCTION__]); $this->pivot(); } /** * @description Metodo chiamato per la pagina "Dotazione organica",
static::executeMiddleware($route); $callback = $route['callback']; if (is_callable($callback)) { return call_user_func_array($callback, $params); } elseif (strpos((string)$callback, '@') !== false) { list($controller, $method) = explode('@', $callback); if (class_exists($controller)) { $object = new $controller; if (method_exists($object, $method)) { return call_user_func_array([$object, $method], $params); } else { if (ENVIRONMENT === 'development') { throw new \BadFunctionCallException('[Route/invoke] - il Metodo ' . $method . 'non esiste nel Controlloer ' . $controller); } else { // echo showError('Error', '[Route/invoke] - il Metodo ' . $method . 'non esiste nel Controlloer ' . $controller); echo show404(); die(); } } } else { if (ENVIRONMENT === 'development') { throw new \ReflectionException('[Route/invoke] - Classe ' . $controller . ' non trovata'); } else { // echo showError('Error', '[Route/invoke] - Classe ' . $controller . ' non trovata'); echo show404();
$matched = false; } } if ((string)$route['method'] !== (string)static::getMethod($route['method'])) { $matched = false; } else { $matched = true; } if ($matched === true) { static::$routeFound = true; return static::invoke($route, $params); } } } // Rotta non trovata, stampo l'errore 404 if (static::$routeFound === false) { if (!HAS_API) { // WEB echo show404(); } else { // API $response = new \System\JsonResponse(); $response->error('error', 'Ops.. Risorsa non trovata'); $response->setStatusCode(404); $response->response(); }
if ($forceHeaders === true) { header('Content-Type: text/html; charset=' . CHARSET); } /** * Inizializzazione delle Rotte */ // Rotte WEB require_once(APP_PATH . 'Routes' . DIRECTORY_SEPARATOR . 'Web.php'); // Rotte per RESTFul API require_once(APP_PATH . 'Routes' . DIRECTORY_SEPARATOR . 'Api.php'); /** * Esecuzione delle rotte ed "Entry point" dell'applicazione. */ \System\Route::handle(); //---------------------------------------------------------------------------------------------------------------------- /** * Eventi lanciati in post route */ \System\Event::call('post_route', []); //---------------------------------------------------------------------------------------------------------------------- /** * Eventi lanciati in post system */ \System\Event::call('post_system', []); } else { define('CRONTAB_NOW', time()); /** * Eventi lanciati in pre system
// Constante del percorso della cartella config define('CONFIG_PATH', APP_PATH . 'Config' . DIRECTORY_SEPARATOR); // Constante del percorso della cartella di Logs define('LOGS_PATH', APP_PATH . 'Logs' . DIRECTORY_SEPARATOR); // Constante del percorso della cartella dei moduli define('MODULES_PATH', APP_PATH . 'Modules' . DIRECTORY_SEPARATOR); // Constante del percorso della cartella dei temi (Viste) define('THEME_PATH', APP_PATH . 'Themes' . DIRECTORY_SEPARATOR); // Custom configs if (file_exists(CONFIG_PATH . 'constants.php')) { require_once CONFIG_PATH . 'constants.php'; } // Includo il Bootstrap (inizializzazione) dell'avvio dell'applicazione. require_once PATH . 'core/Bootstrap.php'; // Commentare la riga successiva per il Debug di tutte le rotte instanziate nell'applicazione. // d(\System\Route::allRoutes());