Project

General

Profile

Revision 79397eb3

ID79397eb307af2cf4bb9f3ed86dc10be42ef9e2f8
Parent 0d761a49
Child 8b28e91d

Added by Romain Chollet about 7 years ago

[#1572] Chargement du champ vigilo_template en ajax

Change-Id: I2874cda44e4f06a0f5f5c6dc3c9081229f73627f
Reviewed-on: https://vigilo-dev.si.c-s.fr/review/2322
Reviewed-by: Francois POIROTTE <>
Tested-by: Francois POIROTTE <>

View differences:

inc/vigilotemplate.class.php
14 14
        foreach($hosttemplates_files as $file) {
15 15
            $filepath = $hosttdir . DIRECTORY_SEPARATOR . $file;
16 16
            $test_filepath = preg_match("/(.*).xml$/", $filepath);
17

  
17 18
            if (is_file($filepath) AND !empty($test_filepath)) {
18 19
                preg_match_all($pattern, file_get_contents($filepath), $matches);
20

  
19 21
                foreach ($matches[1] as $match) {
20 22
                    $templates[] = $match;
21 23
                }
......
27 29
        return $templates;
28 30
    }
29 31

  
32
    static function getAjaxArrayTemplates() {
33

  
34
        $templates = PluginVigiloVigiloTemplate::getAllTemplates();
35
        $id = 0;
36
        $ret = array();
37

  
38
        foreach($templates as $t) {
39
            $ret[] = array("id" => $id, "text" => $t);
40
            $id++;
41
        }
42

  
43
        return $ret;
44
    }
45

  
30 46
    static function getVigiloTemplateNameByID($id) {
31 47

  
32 48
        if (is_numeric($id)) {

Also available in: Unified diff