Differences From Artifact [70aece96a9]:

To Artifact [f693f6847c]:


498
499
500
501
502
503
504
505
506
507
508
509
510
511
512

    public function fetch($template, $no_display = false)
    {
        $this->currentTemplate = $template;

        $path = file_exists(GARRADIN_DATA_ROOT . '/squelettes/' . $template)
            ? GARRADIN_DATA_ROOT . '/squelettes/' . $template
            : GARRADIN_DATA_ROOT . '/squelettes-dist/' . $template;

        $tpl_id = basename(dirname($path)) . '/' . $template;

        if (!self::compile_check($tpl_id, $path))
        {
            if (!file_exists($path))
            {







|







498
499
500
501
502
503
504
505
506
507
508
509
510
511
512

    public function fetch($template, $no_display = false)
    {
        $this->currentTemplate = $template;

        $path = file_exists(GARRADIN_DATA_ROOT . '/squelettes/' . $template)
            ? GARRADIN_DATA_ROOT . '/squelettes/' . $template
            : GARRADIN_ROOT . '/squelettes-dist/' . $template;

        $tpl_id = basename(dirname($path)) . '/' . $template;

        if (!self::compile_check($tpl_id, $path))
        {
            if (!file_exists($path))
            {
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
    static public function getSource($template)
    {
        if (!preg_match('!^[\w\d_-]+(?:\.[\w\d_-]+)*$!', $template))
            return false;

        $path = file_exists(GARRADIN_DATA_ROOT . '/squelettes/' . $template)
            ? GARRADIN_DATA_ROOT . '/squelettes/' . $template
            : GARRADIN_DATA_ROOT . '/squelettes-dist/' . $template;

        if (!file_exists($path))
            return false;

        return file_get_contents($path);
    }








|







660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
    static public function getSource($template)
    {
        if (!preg_match('!^[\w\d_-]+(?:\.[\w\d_-]+)*$!', $template))
            return false;

        $path = file_exists(GARRADIN_DATA_ROOT . '/squelettes/' . $template)
            ? GARRADIN_DATA_ROOT . '/squelettes/' . $template
            : GARRADIN_ROOT . '/squelettes-dist/' . $template;

        if (!file_exists($path))
            return false;

        return file_get_contents($path);
    }

695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
        return true;
    }

    static public function listSources()
    {
        $sources = array();

        $dir = dir(GARRADIN_DATA_ROOT . '/squelettes-dist');

        while ($file = $dir->read())
        {
            if ($file[0] != '.')
                $sources[] = $file;
        }








|







695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
        return true;
    }

    static public function listSources()
    {
        $sources = array();

        $dir = dir(GARRADIN_ROOT . '/squelettes-dist');

        while ($file = $dir->read())
        {
            if ($file[0] != '.')
                $sources[] = $file;
        }