Overview
Comment:Corrections liens wiki
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0bcba85e3bf9b3d34b0fc2db3e2581f450de5ef1
User & Date: bohwaz on 2014-01-20 00:34:43
Other Links: manifest | tags
Context
2014-01-27
17:06
Mise à jour 0.6 avec début transactions/activités/cotisations check-in: 4d7949c651 user: bohwaz tags: trunk
2014-01-20
00:34
Corrections liens wiki check-in: 0bcba85e3b user: bohwaz tags: trunk
00:27
suppression de tirets au début ou à la fin de l'url check-in: 6249bd62de user: bohwaz tags: trunk
Changes

Modified src/include/lib.template.php from [b15486d91d] to [b7a6d505ca].

181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
    $str = utils::htmlSpip($str);
    $str = utils::htmlGarbage2xhtml($str);
    return $str;
}

function tpl_liens_wiki($str, $prefix)
{
    return preg_replace_callback('!<a href="([^/.]+)">!i', function ($matches) use ($prefix) {
        return '<a href="' . $prefix . Wiki::transformTitleToURI($matches[1]) . '">';
    }, $str);
}

function tpl_pagination($params)
{
    if (!isset($params['url']) || !isset($params['page']) || !isset($params['bypage']) || !isset($params['total']))







|







181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
    $str = utils::htmlSpip($str);
    $str = utils::htmlGarbage2xhtml($str);
    return $str;
}

function tpl_liens_wiki($str, $prefix)
{
    return preg_replace_callback('!<a href="([^/.:@]+)">!i', function ($matches) use ($prefix) {
        return '<a href="' . $prefix . Wiki::transformTitleToURI($matches[1]) . '">';
    }, $str);
}

function tpl_pagination($params)
{
    if (!isset($params['url']) || !isset($params['page']) || !isset($params['bypage']) || !isset($params['total']))

Modified src/include/lib.utils.php from [4548303020] to [cd368939e7].

369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
...
385
386
387
388
389
390
391
392
393
394

395
396
397
398
399
400
401
            self::$g2x = new \garbage2xhtml;
            self::$g2x->core_attributes = array('class', 'id', 'title');
        }

        return self::$g2x->process($str);
    }

    static public function htmlSpip($str)
    {
        // Intertitres
        $str = preg_replace('/(?<!\\\\)\{{3}(\V*)\}{3}/', '<h3>$1</h3>', $str);

        // Gras
        $str = preg_replace('/(?<!\\\\)\{{2}(\V*)\}{2}/', '<strong>$1</strong>', $str);

................................................................................
        $str = preg_replace('/(?<!\\\\)\{(\V*)\}/', '<em>$1</em>', $str);

        // Espaces typograhiques
        $str = preg_replace('/\h*([?!;:»])(\s+|$)/u', '&nbsp;$1$2', $str);
        $str = preg_replace('/(^|\s+)([«])\h*/u', '$1$2&nbsp;', $str);

        // Liens
        $str = preg_replace('/(?<!\\\\)\[([^-]+)->([^\]]+)\]/', '<a href="$2">$1</a>', $str);
        $str = preg_replace('/(?<!\\\\)\[([^\]]+)\]/', '<a href="$1">$1</a>', $str);


        $str = preg_replace('/<a href="((?!http).*@.*)">/iU', '<a href="mailto:$1">', $str);

        return $str;
    }

    static public function mail($to, $subject, $content, $additional_headers = array())
    {







|







 







|
|

>







369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
...
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
            self::$g2x = new \garbage2xhtml;
            self::$g2x->core_attributes = array('class', 'id', 'title');
        }

        return self::$g2x->process($str);
    }

    static public function htmlSpip($str, $prefix = '')
    {
        // Intertitres
        $str = preg_replace('/(?<!\\\\)\{{3}(\V*)\}{3}/', '<h3>$1</h3>', $str);

        // Gras
        $str = preg_replace('/(?<!\\\\)\{{2}(\V*)\}{2}/', '<strong>$1</strong>', $str);

................................................................................
        $str = preg_replace('/(?<!\\\\)\{(\V*)\}/', '<em>$1</em>', $str);

        // Espaces typograhiques
        $str = preg_replace('/\h*([?!;:»])(\s+|$)/u', '&nbsp;$1$2', $str);
        $str = preg_replace('/(^|\s+)([«])\h*/u', '$1$2&nbsp;', $str);

        // Liens
        $str = preg_replace('/(?<!\\\\)\[(.+?)->(.+?)\]/', '<a href="$2">$1</a>', $str);
        $str = preg_replace('/(?<!\\\\)\[(.+?)\]/', '<a href="$1">$1</a>', $str);

        // Adresses email
        $str = preg_replace('/<a href="((?!http).*@.*)">/iU', '<a href="mailto:$1">', $str);

        return $str;
    }

    static public function mail($to, $subject, $content, $additional_headers = array())
    {

Modified src/templates/admin/index.tpl from [3ef801d675] to [eaecc4ec22].

25
26
27
28
29
30
31
32
33
34
35
        {if empty($user.date_cotisation)}<b class="error">jamais réglée</b>
        {elseif $verif_cotisation === true}<b class="confirm">À jour :-)</b>
        {else}<b class="alert">En retard !</b>{/if}
    </li>
</ul>

<div class="wikiContent">
    {$page.contenu.contenu|format_wiki|liens_wiki:'?'}
</div>

{include file="admin/_foot.tpl"}







|



25
26
27
28
29
30
31
32
33
34
35
        {if empty($user.date_cotisation)}<b class="error">jamais réglée</b>
        {elseif $verif_cotisation === true}<b class="confirm">À jour :-)</b>
        {else}<b class="alert">En retard !</b>{/if}
    </li>
</ul>

<div class="wikiContent">
    {$page.contenu.contenu|format_wiki|liens_wiki:'wiki/?'}
</div>

{include file="admin/_foot.tpl"}