Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 563... Línea 563...
563
     * @param string $content - the content to displayed
563
     * @param string $content - the content to displayed
564
     * @param string $rgb - the background color of the box
564
     * @param string $rgb - the background color of the box
565
     * @return string HTML code
565
     * @return string HTML code
566
     */
566
     */
567
    public function colored_box_with_pre_tag($title, $content, $rgb = 'FEEBE5') {
567
    public function colored_box_with_pre_tag($title, $content, $rgb = 'FEEBE5') {
568
        //TODO MDL-31192 this tag removes xhtml strict error but cause warning
-
 
569
        $coloredbox = html_writer::start_tag('div', array());
568
        $coloredbox = html_writer::start_tag('div', array());
570
        $coloredbox .= html_writer::start_tag('div',
569
        $coloredbox .= html_writer::start_tag('div',
571
                        array('style' => "border:solid 1px #DEDEDE;background:#" . $rgb
570
                        array('style' => "border:solid 1px #DEDEDE;background:#" . $rgb
572
                            . ";color:#222222;padding:4px;"));
571
                            . ";color:#222222;padding:4px;"));
573
        $coloredbox .= html_writer::start_tag('pre', array());
572
        $coloredbox .= html_writer::start_tag('pre', array());
Línea 704... Línea 703...
704
            $documentationhtml .= get_string('arguments', 'webservice');
703
            $documentationhtml .= get_string('arguments', 'webservice');
705
            $documentationhtml .= html_writer::end_tag('span');
704
            $documentationhtml .= html_writer::end_tag('span');
706
            $documentationhtml .= $br;
705
            $documentationhtml .= $br;
707
            foreach ($description->parameters_desc->keys as $paramname => $paramdesc) {
706
            foreach ($description->parameters_desc->keys as $paramname => $paramdesc) {
708
                // a argument documentation
707
                // a argument documentation
709
                $documentationhtml .= html_writer::start_tag('span', array('style' => 'font-size:80%'));
708
                $documentationhtml .= html_writer::start_tag('div', ['style' => 'font-size:80%']);
Línea 710... Línea 709...
710
 
709
 
711
                if ($paramdesc->required == VALUE_REQUIRED) {
710
                if ($paramdesc->required == VALUE_REQUIRED) {
712
                    $required = get_string('required', 'webservice');
711
                    $required = get_string('required', 'webservice');
713
                }
712
                }
Línea 750... Línea 749...
750
                                    get_string('restparam', 'webservice'),
749
                                    get_string('restparam', 'webservice'),
751
                                    htmlentities($this->rest_param_description_html(
750
                                    htmlentities($this->rest_param_description_html(
752
                                                    $paramdesc, $paramname), ENT_COMPAT),
751
                                                    $paramdesc, $paramname), ENT_COMPAT),
753
                                    'FEEBE5');
752
                                    'FEEBE5');
754
                }
753
                }
755
                $documentationhtml .= html_writer::end_tag('span');
754
                $documentationhtml .= html_writer::end_tag('div');
756
            }
755
            }
757
            $documentationhtml .= $br . $br;
756
            $documentationhtml .= $br . $br;
Línea 758... Línea 757...
758
 
757
 
759
 
758
 
760
            // function response documentation
759
            // function response documentation
761
            $documentationhtml .= html_writer::start_tag('span', array('style' => 'color:#EA33A6'));
760
            $documentationhtml .= html_writer::start_tag('span', array('style' => 'color:#EA33A6'));
762
            $documentationhtml .= get_string('response', 'webservice');
761
            $documentationhtml .= get_string('response', 'webservice');
763
            $documentationhtml .= html_writer::end_tag('span');
762
            $documentationhtml .= html_writer::end_tag('span');
764
            $documentationhtml .= $br;
763
            $documentationhtml .= $br;
765
            // function response description
764
            // function response description
766
            $documentationhtml .= html_writer::start_tag('span', array('style' => 'font-size:80%'));
765
            $documentationhtml .= html_writer::start_tag('div', ['style' => 'font-size:80%']);
767
            if (!empty($description->returns_desc->desc)) {
766
            if (!empty($description->returns_desc->desc)) {
768
                $documentationhtml .= $description->returns_desc->desc;
767
                $documentationhtml .= $description->returns_desc->desc;
769
                $documentationhtml .= $br . $br;
768
                $documentationhtml .= $br . $br;
Línea 793... Línea 792...
793
                                    get_string('restcode', 'webservice'),
792
                                    get_string('restcode', 'webservice'),
794
                                    htmlentities($restresponse, ENT_COMPAT),
793
                                    htmlentities($restresponse, ENT_COMPAT),
795
                                    'FEEBE5');
794
                                    'FEEBE5');
796
                }
795
                }
797
            }
796
            }
798
            $documentationhtml .= html_writer::end_tag('span');
797
            $documentationhtml .= html_writer::end_tag('div');
799
            $documentationhtml .= $br . $br;
798
            $documentationhtml .= $br . $br;
Línea 800... Línea 799...
800
 
799
 
801
            // function errors documentation for REST protocol
800
            // function errors documentation for REST protocol
802
            if (!empty($activatedprotocol['rest'])) {
801
            if (!empty($activatedprotocol['rest'])) {
803
                $documentationhtml .= html_writer::start_tag('span', array('style' => 'color:#EA33A6'));
802
                $documentationhtml .= html_writer::start_tag('span', array('style' => 'color:#EA33A6'));
804
                $documentationhtml .= get_string('errorcodes', 'webservice');
803
                $documentationhtml .= get_string('errorcodes', 'webservice');
805
                $documentationhtml .= html_writer::end_tag('span');
804
                $documentationhtml .= html_writer::end_tag('span');
806
                $documentationhtml .= $br . $br;
805
                $documentationhtml .= $br . $br;
807
                $documentationhtml .= html_writer::start_tag('span', array('style' => 'font-size:80%'));
806
                $documentationhtml .= html_writer::start_tag('div', ['style' => 'font-size:80%']);
808
                $errormessage = get_string('invalidparameter', 'debug');
807
                $errormessage = get_string('invalidparameter', 'debug');
809
                $restexceptiontext = <<<EOF
808
                $restexceptiontext = <<<EOF
810
<?xml version="1.0" encoding="UTF-8"?>
809
<?xml version="1.0" encoding="UTF-8"?>
811
<EXCEPTION class="invalid_parameter_exception">
810
<EXCEPTION class="invalid_parameter_exception">
Línea 816... Línea 815...
816
                $documentationhtml .= $this->colored_box_with_pre_tag(
815
                $documentationhtml .= $this->colored_box_with_pre_tag(
817
                                get_string('restexception', 'webservice'),
816
                                get_string('restexception', 'webservice'),
818
                                htmlentities($restexceptiontext, ENT_COMPAT),
817
                                htmlentities($restexceptiontext, ENT_COMPAT),
819
                                'FEEBE5');
818
                                'FEEBE5');
Línea 820... Línea 819...
820
 
819
 
821
                $documentationhtml .= html_writer::end_tag('span');
820
                $documentationhtml .= html_writer::end_tag('div');
822
            }
821
            }
Línea 823... Línea 822...
823
            $documentationhtml .= $br . $br;
822
            $documentationhtml .= $br . $br;
824
 
823