Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.
   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   4  // Moodle is free software: you can redistribute it and/or modify
   5  // it under the terms of the GNU General Public License as published by
   6  // the Free Software Foundation, either version 3 of the License, or
   7  // (at your option) any later version.
   8  //
   9  // Moodle is distributed in the hope that it will be useful,
  10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  // GNU General Public License for more details.
  13  //
  14  // You should have received a copy of the GNU General Public License
  15  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  /**
  18   * This file contains the definition for the renderable assign header.
  19   *
  20   * @package   mod_assign
  21   * @copyright 2020 Matt Porritt <mattp@catalyst-au.net>
  22   * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23   */
  24  namespace mod_assign\output;
  25  
  26  /**
  27   * This file contains the definition for the renderable assign header.
  28   *
  29   * @package   mod_assign
  30   * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
  31   * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  32   */
  33  class assign_header implements \renderable {
  34      /** @var \stdClass The assign record.  */
  35      public $assign;
  36      /** @var mixed \context|null the context record.  */
  37      public $context;
  38      /** @var bool $showintro Show or hide the intro. */
  39      public $showintro;
  40      /** @var int coursemoduleid The course module id. */
  41      public $coursemoduleid;
  42      /** @var string $subpage Optional subpage (extra level in the breadcrumbs). */
  43      public $subpage;
  44      /** @var string $preface Optional preface (text to show before the heading). */
  45      public $preface;
  46      /** @var string $postfix Optional postfix (text to show after the intro). */
  47      public $postfix;
  48      /** @var \moodle_url|null $subpageurl link for the sub page */
  49      public $subpageurl;
  50      /** @var bool $activity optional show activity text. */
  51      public $activity;
  52  
  53      /**
  54       * Constructor
  55       *
  56       * @param \stdClass        $assign          The assign database record.
  57       * @param \context|null    $context         The course module context.
  58       * @param bool             $showintro       Show or hide the intro.
  59       * @param int              $coursemoduleid  The course module id.
  60       * @param string           $subpage         An optional sub page in the navigation.
  61       * @param string           $preface         An optional preface to show before the heading.
  62       * @param string           $postfix         An optional postfix to show after the intro.
  63       * @param \moodle_url|null $subpageurl      An optional sub page URL link for the subpage.
  64       * @param bool             $activity        Optional show activity text if true.
  65       */
  66      public function __construct(
  67          \stdClass $assign,
  68          $context,
  69          $showintro,
  70          $coursemoduleid,
  71          $subpage = '',
  72          $preface = '',
  73          $postfix = '',
  74          \moodle_url $subpageurl = null,
  75          bool $activity = false
  76      ) {
  77          $this->assign = $assign;
  78          $this->context = $context;
  79          $this->showintro = $showintro;
  80          $this->coursemoduleid = $coursemoduleid;
  81          $this->subpage = $subpage;
  82          $this->preface = $preface;
  83          $this->postfix = $postfix;
  84          $this->subpageurl = $subpageurl;
  85          $this->activity = $activity;
  86      }
  87  }