Пример #1
0
 /**
  * Array of patterns this field supports
  */
 protected function patterns()
 {
     $fieldname = $this->_field->name;
     $patterns = parent::patterns();
     $patterns["[[{$fieldname}]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:link]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:image]]"] = array(false);
     $patterns["[[{$fieldname}:imageflex]]"] = array(false);
     $patterns["[[{$fieldname}:media]]"] = array(false);
     return $patterns;
 }
Пример #2
0
 /**
  * Overriding {@link dataformfieldrenderer::get_pattern_import_settings()}
  * to return import settings only for username, id, idnumber.
  *
  * @param moodleform $mform
  * @param string $pattern
  * @return array
  */
 public function get_pattern_import_settings(&$mform, $patternname, $header)
 {
     $allowedpatternparts = array('username', 'id', 'idnumber');
     $fieldname = $this->_field->name;
     $patternpart = trim(str_replace($fieldname, '', $patternname), ':');
     if (!in_array($patternpart, $allowedpatternparts)) {
         return array(array(), array());
     }
     return parent::get_pattern_import_settings($mform, $patternname, $header);
 }
Пример #3
0
 /**
  * Array of patterns this field supports
  */
 protected function patterns()
 {
     $fieldname = $this->_field->name;
     $patterns = parent::patterns();
     $patterns["[[{$fieldname}]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:rate]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:rating]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:view]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:view:url]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:view:inline]]"] = array(true, $fieldname);
     // These patterns return the aggregage value wrapped in html for ajax display updates.
     $patterns["[[{$fieldname}:view:avg]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:view:count]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:view:max]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:view:min]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:view:sum]]"] = array(true, $fieldname);
     // These patterns return raw value of the aggregage.
     $patterns["[[{$fieldname}:avg]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:count]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:max]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:min]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:sum]]"] = array(true, $fieldname);
     return $patterns;
 }
Пример #4
0
 /**
  * Array of patterns this field supports
  */
 protected function patterns()
 {
     $fieldname = $this->_field->name;
     $patterns = parent::patterns();
     $patterns["[[{$fieldname}]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:addnew]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:options]]"] = array(false);
     $patterns["[[{$fieldname}:cat]]"] = array(false);
     $patterns["[[{$fieldname}:key]]"] = array(false);
     return $patterns;
 }
Пример #5
0
 /**
  * Array of patterns this field supports
  */
 protected function patterns()
 {
     $fieldname = $this->_field->name;
     $patterns = parent::patterns();
     $patterns["[[{$fieldname}]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:date]]"] = array(true, $fieldname);
     // Minute (M).
     $patterns["[[{$fieldname}:minute]]"] = array(false);
     // Hour (H).
     $patterns["[[{$fieldname}:hour]]"] = array(false);
     // Day (a).
     $patterns["[[{$fieldname}:day]]"] = array(false);
     $patterns["[[{$fieldname}:d]]"] = array(false);
     // Week (W).
     $patterns["[[{$fieldname}:week]]"] = array(false);
     // Month (b).
     $patterns["[[{$fieldname}:month]]"] = array(false);
     $patterns["[[{$fieldname}:m]]"] = array(false);
     // Year (G).
     $patterns["[[{$fieldname}:year]]"] = array(false);
     $patterns["[[{$fieldname}:Y]]"] = array(false);
     return $patterns;
 }
Пример #6
0
 /**
  * Array of patterns this field supports
  */
 protected function patterns()
 {
     $fieldname = $this->_field->name;
     $patterns = parent::patterns();
     $patterns["[[{$fieldname}]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:url]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:alt]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:size]]"] = array(false);
     $patterns["[[{$fieldname}:download]]"] = array(false);
     $patterns["[[{$fieldname}:downloadcount]]"] = array(false);
     return $patterns;
 }
Пример #7
0
 /**
  * Array of patterns this field supports
  */
 protected function patterns()
 {
     $fieldname = $this->_field->name;
     $patterns = parent::patterns();
     $patterns["[[{$fieldname}]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:count]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:inline]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:add]]"] = array(false, $fieldname);
     return $patterns;
 }
Пример #8
0
 /**
  * Overriding {@link dataformfieldrenderer::get_pattern_import_settings()}
  * to allow only the base pattern.
  */
 public function get_pattern_import_settings(&$mform, $patternname, $header)
 {
     // Only [[fieldname]] can be imported.
     if ($patternname != $this->_field->name) {
         return array(array(), array());
     }
     return parent::get_pattern_import_settings($mform, $patternname, $header);
 }
Пример #9
0
 /**
  * Array of patterns this field supports
  */
 protected function patterns()
 {
     $fieldname = $this->_field->name;
     $patterns = parent::patterns();
     $patterns["[[{$fieldname}]]"] = array(true, $fieldname);
     $patterns["[[{$fieldname}:unit]]"] = array(false, $fieldname);
     $patterns["[[{$fieldname}:value]]"] = array(false, $fieldname);
     $patterns["[[{$fieldname}:seconds]]"] = array(false, $fieldname);
     $patterns["[[{$fieldname}:interval]]"] = array(false, $fieldname);
     return $patterns;
 }