HEX
Server: Apache
System: Linux webd004.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User: frenchy (106757)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/frenchy/www/extracts/var/www/french-american.org/repo/app/functions/timber.inc.php
<?php

/**
 * Timber starter-theme
 * https://github.com/timber/starter-theme
 *
 * @package  WordPress
 * @subpackage  Timber
 * @since   Timber 0.1
 */

if (!class_exists('Timber')) {
	add_action('admin_notices', function () {
		echo '<div class="error"><p>Timber n\'est pas activé. Veuillez l\'activer : <a href="' . esc_url(admin_url('plugins.php#timber')) . '">' . esc_url(admin_url('plugins.php')) . '</a></p></div>';
	});

	add_filter('template_include', function ($template) {
		return get_stylesheet_directory() . '/no-timber/index.html';
	});

	return;
}

/**
 * Sets the directories (inside your theme) to find .twig files
 */
Timber::$dirname = array('templates', 'views');

/**
 * By default, Timber does NOT autoescape values. Want to enable Twig's autoescape?
 * No prob! Just set this value to true
 */
Timber::$autoescape = false;


/**
 * We're going to configure our theme inside of a subclass of Timber\Site
 * You can move this to its own file and include here via php's include("MySite.php")
 */
class StarterSite extends Timber\Site
{
	/** Add timber support. */
	public function __construct()
	{
		add_filter('timber/context', array($this, 'add_to_context'));

		parent::__construct();
	}

	/** This is where you add some context
	 *
	 * @param string $context context['this'] Being the Twig's {{ this }}.
	 */
	public function add_to_context($context)
	{
		$context['menu'] = new Timber\Menu();
		$context['site'] = $this;
		$context['admin_ajax'] = admin_url('admin-ajax.php');
		$context['is_front_page'] = is_front_page();
		$context['is_home'] = is_home();

		// Déclarations des menus
		$context['menu_principal'] = new Timber\Menu(2);
		$context['menu_footer'] = new Timber\Menu(3);

		// cookie
		$context['cookies'] = isset($_COOKIE['FAFFR-COOKIE-ACCEPT']) ? $_COOKIE['FAFFR-COOKIE-ACCEPT'] : false;

		return $context;
	}
}

new StarterSite();