getExtensionById('taoQtiItem'); } /** * Get all styles available from the registry * * @return array */ public function getAllStyles() { $styles = []; foreach (self::getRegistry()->getMap() as $id => $styleData) { $styles[$id] = $styleData; } return $styles; } /** * Check if the array contains sufficient style data * * @param array $data * @return boolean */ public function isValidStyleData($data) { return isset($data['label']) && !empty($data['label']); } /** * Register a style * * @param string $id * @param array $styleData */ public function register($id, $styleData) { if (self::getRegistry()->isRegistered($id)) { common_Logger::w('Style already registered'); } if ($this->isValidStyleData($styleData)) { self::getRegistry()->set($id, $styleData); } else { common_Logger::w('Invalid style data format'); } } }