Пример #1
0
 /**
  * Return an array where the keys are the internal names of the behaviours
  * in preferred order and the values are a human-readable name.
  *
  * @param string $currentbehaviour
  * @return array model name => lang string for this behaviour name.
  */
 public static function get_behaviour_options($currentbehaviour)
 {
     $config = question_bank::get_config();
     $archetypes = self::get_archetypal_behaviours();
     // If no admin setting return all behavious
     if (empty($config->disabledbehaviours) && empty($config->behavioursortorder)) {
         return $archetypes;
     }
     if (empty($config->behavioursortorder)) {
         $order = '';
     } else {
         $order = $config->behavioursortorder;
     }
     if (empty($config->disabledbehaviours)) {
         $disabled = '';
     } else {
         $disabled = $config->disabledbehaviours;
     }
     return self::sort_behaviours($archetypes, $order, $disabled, $currentbehaviour);
 }