Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 45... Línea 45...
45
 
45
 
Línea 46... Línea 46...
46
        $url = new moodle_url('/badges/badge_json.php', array('id' => $badge->id));
46
        $url = new moodle_url('/badges/badge_json.php', array('id' => $badge->id));
47
 
47
 
48
        $json['name'] = $badge->name;
-
 
49
        $json['description'] = $badge->description;
-
 
50
        if ($badge->imageauthorname ||
-
 
51
                $badge->imageauthoremail ||
-
 
52
                $badge->imageauthorurl ||
48
        $json['name'] = $badge->name;
53
                $badge->imagecaption) {
49
        $json['description'] = $badge->description;
54
            $urlimage = moodle_url::make_pluginfile_url($context->id,
50
        $urlimage = moodle_url::make_pluginfile_url($context->id,
55
                'badges', 'badgeimage', $badge->id, '/', 'f3')->out(false);
51
            'badges', 'badgeimage', $badge->id, '/', 'f3')->out(false);
56
            $json['image'] = array();
-
 
57
            $json['image']['id'] = $urlimage;
-
 
58
            if ($badge->imageauthorname || $badge->imageauthoremail || $badge->imageauthorurl) {
-
 
59
                $authorimage = new moodle_url('/badges/image_author_json.php', array('id' => $badge->id));
-
 
60
                $json['image']['author'] = $authorimage->out(false);
52
        $json['image'] = [];
61
            }
53
        $json['image']['id'] = $urlimage;
62
            if ($badge->imagecaption) {
-
 
63
                $json['image']['caption'] = $badge->imagecaption;
-
 
64
            }
-
 
65
        } else {
54
        if ($badge->imagecaption) {
Línea 66... Línea 55...
66
            $json['image'] = $urlimage;
55
            $json['image']['caption'] = $badge->imagecaption;
67
        }
56
        }
68
 
57
 
Línea 93... Línea 82...
93
                    'version' => $related->version, '@language' => $related->language);
82
                    'version' => $related->version, '@language' => $related->language);
94
            }
83
            }
95
             $json['related'] = $relateds;
84
             $json['related'] = $relateds;
96
        }
85
        }
Línea 97... Línea -...
97
 
-
 
98
        $endorsement = $badge->get_endorsement();
-
 
99
        if (!empty($endorsement)) {
-
 
100
            $endorsementurl = new moodle_url('/badges/endorsement_json.php', array('id' => $badge->id));
-
 
101
            $json['endorsement'] = $endorsementurl->out(false);
-
 
102
        }
-
 
103
 
86
 
104
        $alignments = $badge->get_alignments();
87
        $alignments = $badge->get_alignments();
105
        if (!empty($alignments)) {
88
        if (!empty($alignments)) {
106
            foreach ($alignments as $item) {
89
            foreach ($alignments as $item) {
107
                $alignment = array('targetName' => $item->targetname, 'targetUrl' => $item->targeturl);
90
                $alignment = array('targetName' => $item->targetname, 'targetUrl' => $item->targeturl);