Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 387... Línea 387...
387
    function has_config() {
387
    function has_config() {
388
        return false;
388
        return false;
389
    }
389
    }
Línea 390... Línea 390...
390
 
390
 
391
    /**
-
 
392
     * Default behavior: save all variables as $CFG properties
-
 
393
     * You don't need to override this if you 're satisfied with the above
-
 
394
     *
-
 
395
     * @deprecated since Moodle 2.9 MDL-49385 - Please use Admin Settings functionality to save block configuration.
-
 
396
     */
-
 
397
    function config_save($data) {
-
 
398
        throw new coding_exception('config_save() can not be used any more, use Admin Settings functionality to save block configuration.');
-
 
399
    }
-
 
400
 
-
 
401
    /**
391
    /**
402
     * Which page types this block may appear on.
392
     * Which page types this block may appear on.
403
     *
393
     *
404
     * The information returned here is processed by the
394
     * The information returned here is processed by the
405
     * {@link blocks_name_allowed_in_format()} function. Look there if you need
395
     * {@link blocks_name_allowed_in_format()} function. Look there if you need
Línea 444... Línea 434...
444
     */
434
     */
445
    function html_attributes() {
435
    function html_attributes() {
446
        $attributes = array(
436
        $attributes = array(
447
            'id' => 'inst' . $this->instance->id,
437
            'id' => 'inst' . $this->instance->id,
448
            'class' => 'block_' . $this->name() . ' block',
438
            'class' => 'block_' . $this->name() . ' block',
449
            'role' => $this->get_aria_role()
-
 
450
        );
439
        );
-
 
440
        $ariarole = $this->get_aria_role();
-
 
441
        if ($ariarole) {
-
 
442
            $attributes['role'] = $ariarole;
-
 
443
        }
451
        if ($this->hide_header()) {
444
        if ($this->hide_header()) {
452
            $attributes['class'] .= ' no-header';
445
            $attributes['class'] .= ' no-header';
453
        }
446
        }
454
        if ($this->instance_can_be_docked() && get_user_preferences('docked_block_instance_' . $this->instance->id, 0)) {
447
        if ($this->instance_can_be_docked() && get_user_preferences('docked_block_instance_' . $this->instance->id, 0)) {
455
            $attributes['class'] .= ' dock_on_load';
448
            $attributes['class'] .= ' dock_on_load';
Línea 737... Línea 730...
737
     *
730
     *
738
     * Region is the default, but this should be overridden by a block is there is a region child, or even better
731
     * Region is the default, but this should be overridden by a block is there is a region child, or even better
739
     * a landmark child.
732
     * a landmark child.
740
     *
733
     *
741
     * Options are as follows:
734
     * Options are as follows:
-
 
735
     *    - application
742
     *    - landmark
736
     *    - landmark
743
     *      - application
-
 
744
     *      - banner
-
 
745
     *      - complementary
-
 
746
     *      - contentinfo
-
 
747
     *      - form
737
     *      - form
748
     *      - main
-
 
749
     *      - navigation
738
     *      - navigation
750
     *      - search
739
     *      - search
751
     *
740
     *
-
 
741
     * Please do not use top-level landmark roles such as 'banner', 'complementary', 'contentinfo', or 'main'. Read more at
-
 
742
     * {@link https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/ ARIA Authoring Practices Guide - Landmark Regions}
-
 
743
     *
752
     * @return string
744
     * @return string
753
     */
745
     */
754
    public function get_aria_role() {
746
    public function get_aria_role() {
755
        return 'complementary';
747
        return 'region';
756
    }
748
    }
Línea 757... Línea 749...
757
 
749
 
758
    /**
750
    /**
759
     * This method can be overriden to add some extra checks to decide whether the block can be added or not to a page.
751
     * This method can be overriden to add some extra checks to decide whether the block can be added or not to a page.