Overview
Comment:Fix attachments URL
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: 433acb66efd1e56254d2f48c3f10b7499f000effeb00f4d055c436148d6922bd
User & Date: bohwaz on 2021-04-10 20:13:06
Other Links: manifest | tags
Context
2021-04-11
13:28
Force quota refresh in advanced check-in: 94587ef7d6 user: bohwaz tags: trunk
2021-04-10
20:13
Fix attachments URL check-in: 433acb66ef user: bohwaz tags: trunk, stable
13:32
Restore old behaviour where last article is shown in full on front page check-in: 77387d2a6e user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Template.php from [3fde8a20c2] to [21d17fbeae].

6
7
8
9
10
11
12

13
14
15
16
17
18
19
...
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
use KD2\HTTP;
use KD2\Translate;
use Garradin\Membres\Session;
use Garradin\Entities\Accounting\Account;
use Garradin\Entities\Users\Category;
use Garradin\UserTemplate\CommonModifiers;
use Garradin\Web\Render\Skriv;


class Template extends \KD2\Smartyer
{
	static protected $_instance = null;

	static public function getInstance()
	{
................................................................................
	{
		$config = Config::getInstance();

		$couleur1 = $config->get('couleur1') ?: ADMIN_COLOR1;
		$couleur2 = $config->get('couleur2') ?: ADMIN_COLOR2;
		$admin_background = ADMIN_BACKGROUND_IMAGE;

		if ($f = $config->get('admin_background')) {
			$admin_background = WWW_URL . $f;
		}

		// Transformation Hexa vers décimal
		$couleur1 = implode(', ', sscanf($couleur1, '#%02x%02x%02x'));
		$couleur2 = implode(', ', sscanf($couleur2, '#%02x%02x%02x'));

		$out = '







>







 







|
|







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
use KD2\HTTP;
use KD2\Translate;
use Garradin\Membres\Session;
use Garradin\Entities\Accounting\Account;
use Garradin\Entities\Users\Category;
use Garradin\UserTemplate\CommonModifiers;
use Garradin\Web\Render\Skriv;
use Garradin\Files\Files;

class Template extends \KD2\Smartyer
{
	static protected $_instance = null;

	static public function getInstance()
	{
................................................................................
	{
		$config = Config::getInstance();

		$couleur1 = $config->get('couleur1') ?: ADMIN_COLOR1;
		$couleur2 = $config->get('couleur2') ?: ADMIN_COLOR2;
		$admin_background = ADMIN_BACKGROUND_IMAGE;

		if (($f = $config->get('admin_background')) && ($file = Files::get($f))) {
			$admin_background = $file->url() . '?' . $file->modified->getTimestamp();
		}

		// Transformation Hexa vers décimal
		$couleur1 = implode(', ', sscanf($couleur1, '#%02x%02x%02x'));
		$couleur2 = implode(', ', sscanf($couleur2, '#%02x%02x%02x'));

		$out = '

Modified src/include/lib/Garradin/Web/Render/Skriv.php from [c909ffc27e] to [0996e6e8e0].

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

		// "Image.jpg"
		if ($pos === false) {
			return WWW_URL . $prefix . '/' . $uri;
		}
		// "bla/Image.jpg" outside of web context
		elseif (self::$context !== File::CONTEXT_WEB && $pos !== 0) {
			return WWW_URL . '/' . self::$context . '/' . $uri;
		}
		// "bla/Image.jpg" in web context or absolute link, eg. "/transactions/2442/42.jpg"
		else {
			return WWW_URL . '/' . ltrim($uri, '/');
		}
	}

	static public function resolveLink(string $uri) {
		$first = substr($uri, 0, 1);
		if ($first == '/' || $first == '!') {
			return Utils::getLocalURL($uri);







|



|







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

		// "Image.jpg"
		if ($pos === false) {
			return WWW_URL . $prefix . '/' . $uri;
		}
		// "bla/Image.jpg" outside of web context
		elseif (self::$context !== File::CONTEXT_WEB && $pos !== 0) {
			return WWW_URL . self::$context . '/' . $uri;
		}
		// "bla/Image.jpg" in web context or absolute link, eg. "/transactions/2442/42.jpg"
		else {
			return WWW_URL . ltrim($uri, '/');
		}
	}

	static public function resolveLink(string $uri) {
		$first = substr($uri, 0, 1);
		if ($first == '/' || $first == '!') {
			return Utils::getLocalURL($uri);