Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 12... Línea 12...
12
// GNU General Public License for more details.
12
// GNU General Public License for more details.
13
//
13
//
14
// You should have received a copy of the GNU General Public License
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea -...
16
 
-
 
17
/**
-
 
18
 * Perform some custom name mapping for template file names (strip leading component/).
-
 
19
 *
-
 
20
 * @package    core
-
 
21
 * @category   output
-
 
22
 * @copyright  2015 Damyon Wiese
-
 
23
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
24
 */
-
 
25
 
16
 
Línea 26... Línea -...
26
namespace core\output;
-
 
27
 
-
 
28
use coding_exception;
17
namespace core\output;
29
 
18
 
30
/**
19
/**
-
 
20
 * Perform some custom name mapping for template file names.
31
 * Perform some custom name mapping for template file names.
21
 *
32
 *
22
 * @package core
33
 * @copyright  2015 Damyon Wiese
23
 * @copyright  2015 Damyon Wiese
34
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35
 * @since      2.9
25
 * @since      2.9
36
 */
-
 
37
class mustache_filesystem_loader extends \Mustache_Loader_FilesystemLoader {
26
 */
38
 
27
class mustache_filesystem_loader extends \Mustache_Loader_FilesystemLoader {
39
    /**
28
    /**
40
     * Provide a default no-args constructor (we don't really need anything).
29
     * Provide a default no-args constructor (we don't really need anything).
41
     */
30
     */
Línea 47... Línea 36...
47
     * Uses the leading component to restrict us specific directories.
36
     * Uses the leading component to restrict us specific directories.
48
     *
37
     *
49
     * @param string $name
38
     * @param string $name
50
     * @return string Template file name
39
     * @return string Template file name
51
     */
40
     */
52
    protected function getFileName($name) {
41
    protected function getfilename($name) {
53
        // Call the Moodle template finder.
42
        // Call the Moodle template finder.
54
        return mustache_template_finder::get_template_filepath($name);
43
        return mustache_template_finder::get_template_filepath($name);
55
    }
44
    }
Línea 56... Línea 45...
56
 
45
 
Línea 60... Línea 49...
60
     *
49
     *
61
     * Always check path for mustache_filesystem_loader.
50
     * Always check path for mustache_filesystem_loader.
62
     *
51
     *
63
     * @return bool Whether to check `is_dir` and `file_exists`
52
     * @return bool Whether to check `is_dir` and `file_exists`
64
     */
53
     */
65
    protected function shouldCheckPath() {
54
    protected function shouldcheckpath() {
66
        return true;
55
        return true;
67
    }
56
    }
Línea 68... Línea 57...
68
 
57
 
69
    /**
58
    /**