Skip to content
Snippets Groups Projects
Select Git revision
  • 36750bac78681bee98d84016b8f0536d770382f6
  • master default protected
  • pymilter-1.0.4
  • pymilter-1.0.3
  • pymilter-1.0.2
  • pymilter-1.0.1
  • pymilter-1_0
  • milter-0_8_18
  • pymilter-0_9_8
  • pymilter-0_9_7
  • pymilter-0_9_6
  • pymilter-0_9_5
  • pymilter-0_9_4
  • pymilter-0_9_2
  • pymilter-0_9_1
  • pymilter-0_9_0
  • pymilter-0_8_12
  • pymilter-0_8_11
  • pymilter-0_8_10
  • pymilter-0_8_9
  • milter-0_8_8
  • milter-0_8_7
22 results

dns.py

Blame
  • admin_setting_html.php 2.30 KiB
    <?php
    // This file is part of Moodle - http://moodle.org/
    //
    // Moodle is free software: you can redistribute it and/or modify
    // it under the terms of the GNU General Public License as published by
    // the Free Software Foundation, either version 3 of the License, or
    // (at your option) any later version.
    //
    // Moodle is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU General Public License for more details.
    //
    // You should have received a copy of the GNU General Public License
    // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
    
    defined('MOODLE_INTERNAL') || die();
    
    /**
     * No setting - just html
     * Note: since admin_setting is not namespaced, this can not be namespaced and put into a class
     */
    class admin_setting_html extends admin_setting {
    
        private $hubinfo;
    
        /**
         * not a setting, just html
         *
         * @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins.
         */
        public function __construct($name, $translation, $hubinfo) {
            $this->nosave  = true;
            $this->hubinfo = $hubinfo;
            parent::__construct($name, $translation, '', '');
        }
    
        /**
         * Always returns true
         * @return bool Always returns true
         */
        public function get_setting() {
            return true;
        }
    
        /**
         * Always returns true
         * @return bool Always returns true
         */
        public function get_defaultsetting() {
            return true;
        }
    
        /**
         * Never write settings
         * @return string Always returns an empty string
         */
        public function write_setting($data) {
            // Do not write any setting.
            return '';
        }
    
        /**
         * Returns an HTML string
         * @return string Returns an HTML string
         */
        public function output_html($data, $query = '') {
            global $OUTPUT;
            $registrationurl = new moodle_url('/mod/hvp/content_hub_registration.php');
            if ($this->hubinfo === false) {
              $this->hubinfo = (object) [];
            }
            $this->hubinfo->registrationurl = $registrationurl->out(false);
            return $OUTPUT->render_from_template('mod_hvp/content_hub_registration_box', $this->hubinfo);
        }
    }