Overview
Comment:Change render __construct API: don't require all arguments
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk | stable
Files: files | file ages | folders
SHA3-256: b1585f051e0bd6c43aecefa0a739662f668ece25cb2e042918eb37e9a7f63986
User & Date: bohwaz on 2021-09-16 19:05:05
Other Links: manifest | tags
Context
2021-09-16
19:05
Change render __construct API: don't require all arguments Leaf check-in: b1585f051e user: bohwaz tags: trunk, stable
17:59
Fix links to export of services for a user, fixes [62ee3968bcd21896ec81dcf0cf8a4552b6d9c3f8] check-in: 5d14370670 user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Template.php from [7374ce76d8] to [70a5d756f1].

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
		$this->register_modifier('dump', ['KD2\ErrorManager', 'dump']);
		$this->register_modifier('get_country_name', ['Garradin\Utils', 'getCountryName']);
		$this->register_modifier('format_tel', [$this, 'formatPhoneNumber']);
		$this->register_modifier('abs', 'abs');
		$this->register_modifier('display_champ_membre', [$this, 'displayChampMembre']);

		$this->register_modifier('format_skriv', function ($str) {
			$skriv = new Skriv(null);
			return $skriv->render((string) $str);
		});

		foreach (CommonModifiers::MODIFIERS_LIST as $key => $name) {
			$this->register_modifier(is_int($key) ? $name : $key, is_int($key) ? [CommonModifiers::class, $name] : $name);
		}








|







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
		$this->register_modifier('dump', ['KD2\ErrorManager', 'dump']);
		$this->register_modifier('get_country_name', ['Garradin\Utils', 'getCountryName']);
		$this->register_modifier('format_tel', [$this, 'formatPhoneNumber']);
		$this->register_modifier('abs', 'abs');
		$this->register_modifier('display_champ_membre', [$this, 'displayChampMembre']);

		$this->register_modifier('format_skriv', function ($str) {
			$skriv = new Skriv;
			return $skriv->render((string) $str);
		});

		foreach (CommonModifiers::MODIFIERS_LIST as $key => $name) {
			$this->register_modifier(is_int($key) ? $name : $key, is_int($key) ? [CommonModifiers::class, $name] : $name);
		}

Modified src/include/lib/Garradin/Web/Render/AbstractRender.php from [4ca4df51b9] to [5c2f7cfe96].

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
	protected $context;
	protected $link_prefix;
	protected $link_suffix;
	protected $user_prefix;

	protected $file;

	public function __construct(?File $file, ?string $user_prefix)
	{
		$this->file = $file;

		if ($file) {
			$this->isRelativeTo($file);
		}








|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
	protected $context;
	protected $link_prefix;
	protected $link_suffix;
	protected $user_prefix;

	protected $file;

	public function __construct(?File $file = null, ?string $user_prefix = null)
	{
		$this->file = $file;

		if ($file) {
			$this->isRelativeTo($file);
		}

Modified src/include/lib/Garradin/Web/Render/Skriv.php from [f232e4ffa3] to [ce5e528272].

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

use const Garradin\{ADMIN_URL, WWW_URL};

class Skriv extends AbstractRender
{
	protected $skriv;

	public function __construct(?File $file, ?string $user_prefix)
	{
		parent::__construct($file, $user_prefix);

		$this->skriv = new SkrivLite;
		$this->skriv->registerExtension('file', [$this, 'SkrivFile']);
		$this->skriv->registerExtension('fichier', [$this, 'SkrivFile']);
		$this->skriv->registerExtension('image', [$this, 'SkrivImage']);







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

use const Garradin\{ADMIN_URL, WWW_URL};

class Skriv extends AbstractRender
{
	protected $skriv;

	public function __construct(?File $file = null, ?string $user_prefix = null)
	{
		parent::__construct($file, $user_prefix);

		$this->skriv = new SkrivLite;
		$this->skriv->registerExtension('file', [$this, 'SkrivFile']);
		$this->skriv->registerExtension('fichier', [$this, 'SkrivFile']);
		$this->skriv->registerExtension('image', [$this, 'SkrivImage']);