Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.
   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 all the defined constants to do with portfolios.
  19   *
  20   * @package core_portfolio
  21   * @copyright 2008 Penny Leach <penny@catalyst.net.nz>, Martin Dougiamas
  22   * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23   */
  24  
  25  defined('MOODLE_INTERNAL') || die();
  26  
  27  //EXPORT STAGE CONSTANTS
  28  
  29  
  30  /**
  31   * PORTFOLIO_STAGE_CONFIG - display a form to the user this one might not be
  32   *                          used if neither the plugin, or the caller has any config.
  33   */
  34  define('PORTFOLIO_STAGE_CONFIG', 1);
  35  
  36  /**
  37   * PORTFOLIO_STAGE_CONFIRM - summarise the form and ask for confirmation
  38   *                           if we skipped PORTFOLIO_STAGE_CONFIG,
  39   *                           just confirm the send.
  40   */
  41  define('PORTFOLIO_STAGE_CONFIRM', 2);
  42  
  43  /**
  44   * PORTFOLIO_STAGE_QUEUEORWAIT - either queue the event and skip to PORTFOLIO_STAGE_FINISHED
  45   */
  46  define('PORTFOLIO_STAGE_QUEUEORWAIT', 3);
  47  
  48  /**
  49   * PORTFOLIO_STAGE_PACKAGE - package up the various bits during this stage both the caller
  50   *                           and the plugin get their package methods called
  51   */
  52  define('PORTFOLIO_STAGE_PACKAGE', 4);
  53  
  54  /**
  55   * PORTFOLIO_STAGE_SEND - the portfolio plugin must send the file
  56   */
  57  define('PORTFOLIO_STAGE_SEND', 5);
  58  
  59  /**
  60   * PORTFOLIO_STAGE_CLEANUP - cleanup the temporary area
  61   */
  62  define('PORTFOLIO_STAGE_CLEANUP', 6);
  63  
  64  /**
  65   * PORTFOLIO_STAGE_FINISHED - display the "finished notification"
  66   */
  67  define('PORTFOLIO_STAGE_FINISHED', 7);
  68  
  69  
  70  
  71  
  72  // EXPORT FORMAT CONSTANTS
  73  // These should always correspond to a string in the portfolio module, called format_{$value}
  74  
  75  
  76  /**
  77   * PORTFOLIO_FORMAT_FILE - the most basic fallback format. this should always be supported
  78   *                         in remote system.s
  79   */
  80  define('PORTFOLIO_FORMAT_FILE', 'file');
  81  
  82  /**
  83   * PORTFOLIO_FORMAT_MBKP - the plugin needs to be able to write a complete backup
  84   *                         the caller need to be able to export the particular XML bits to insert
  85   *                         into moodle.xml (?and the file bits if necessary)
  86   */
  87  define('PORTFOLIO_FORMAT_MBKP', 'mbkp');
  88  
  89  /**
  90   * PORTFOLIO_FORMAT_RICHHTML - like html but with attachments.
  91   */
  92  define('PORTFOLIO_FORMAT_RICHHTML', 'richhtml');
  93  
  94  /**
  95   * PORTFOLIO_FORMAT_PLAINHTML - a single html representation - no attachments
  96   */
  97  define('PORTFOLIO_FORMAT_PLAINHTML', 'plainhtml');
  98  
  99  /**
 100   * PORTFOLIO_FORMAT_IMAGE - subtype of file
 101   */
 102  define('PORTFOLIO_FORMAT_IMAGE', 'image');
 103  
 104  /**
 105   * PORTFOLIO_FORMAT_VIDEO - subtype of file
 106   */
 107  define('PORTFOLIO_FORMAT_VIDEO', 'video');
 108  
 109  /**
 110   * PORTFOLIO_FORMAT_TEXT - subtype of file
 111   */
 112  define('PORTFOLIO_FORMAT_TEXT', 'text');
 113  
 114  /**
 115   * PORTFOLIO_FORMAT_PDF - subtype of file
 116   */
 117  define('PORTFOLIO_FORMAT_PDF', 'pdf');
 118  
 119  /**
 120   * PORTFOLIO_FORMAT_DOCUMENT - subtype of file
 121   */
 122  define('PORTFOLIO_FORMAT_DOCUMENT', 'document');
 123  
 124  /**
 125   * PORTFOLIO_FORMAT_SPREADSHEET - subtype of file
 126   */
 127  define('PORTFOLIO_FORMAT_SPREADSHEET', 'spreadsheet');
 128  
 129  /**
 130   * PORTFOLIO_FORMAT_PRESENTATION - subtype of file
 131   */
 132  define('PORTFOLIO_FORMAT_PRESENTATION', 'presentation');
 133  
 134  /**
 135   * PORTFOLIO_FORMAT_RICH - just used to say, "we support all these"
 136   */
 137  define('PORTFOLIO_FORMAT_RICH', 'rich');
 138  
 139  /**
 140   * PORTFOLIO_FORMAT_LEAP2A - supported by mahara and and others {http://wiki.cetis.ac.uk/LEAP_2.0}
 141   */
 142  define('PORTFOLIO_FORMAT_LEAP2A', 'leap2a');
 143  
 144  // EXPORT TIME LEVELS
 145  // These should correspond to a string in the portfolio module, called time_{$value}
 146  
 147  /**
 148   * PORTFOLIO_TIME_LOW - no delay. don't even offer the user the option
 149   *                      of not waiting for the transfer
 150   */
 151  define('PORTFOLIO_TIME_LOW', 'low');
 152  
 153  /**
 154   * PORTFOLIO_TIME_MODERATE - a small delay. user can still easily opt to
 155   *                           watch this transfer and wait.
 156   */
 157  define('PORTFOLIO_TIME_MODERATE', 'moderate');
 158  
 159  /**
 160   * PORTFOLIO_TIME_HIGH - slow. the user really should not be given the option
 161   *                       to choose this.
 162   */
 163  define('PORTFOLIO_TIME_HIGH', 'high');
 164  
 165  /**
 166   * PORTFOLIO_TIME_FORCEQUEUE - very slow, or immediate transfers not supported
 167   */
 168  define('PORTFOLIO_TIME_FORCEQUEUE', 'queue');
 169  
 170   // BUTTON FORMATS
 171   // Available ways to add the portfolio export to a page
 172  
 173  /**
 174   * PORTFOLIO_ADD_FULL_FORM - a whole form, containing a drop down menu (where necessary)
 175   *                           and a submit button
 176   */
 177  define('PORTFOLIO_ADD_FULL_FORM', 1);
 178  
 179  
 180  /**
 181   * PORTFOLIO_ADD_ICON_FORM - a whole form, containing a drop down menu (where necessary)
 182   *                           but has an icon instead of a button to submit
 183   */
 184  define('PORTFOLIO_ADD_ICON_FORM', 2);
 185  
 186  /**
 187   * PORTFOLIO_ADD_ICON_LINK - just an icon with a link around it (yuk, as will result in a long url
 188   *                           only use where necessary)
 189   */
 190  define('PORTFOLIO_ADD_ICON_LINK', 3);
 191  
 192  /**
 193   * PORTFOLIO_ADD_TEXT_LINK - just some text with a link around it (yuk, as will result in a long url
 194   * only use where necessary)
 195   */
 196  define('PORTFOLIO_ADD_TEXT_LINK', 4);
 197  
 198  /**
 199   * PORTFOLIO_ADD_FAKE_URL - hacky way to turn the button class into a url to redirect to
 200   *                          this replaces the old portfolio_fake_add_url function
 201   */
 202  define('PORTFOLIO_ADD_FAKE_URL', 5);
 203  
 204  /**
 205   * PORTFOLIO_ADD_MOODULE_URL - hacky way to turn the button class into a moodle_url to redirect to
 206   *                             this replaces the old portfolio_fake_add_url function
 207   */
 208  define('PORTFOLIO_ADD_MOODLE_URL', 6);