Index: branches/RL2/extensions/Gadgets/backend/Gadget.php |
— | — | @@ -63,7 +63,32 @@ |
64 | 64 | |
65 | 65 | /*** Public static methods ***/ |
66 | 66 | |
| 67 | + // Would like to do const PROPERTIES_BASE = array( ... ); here, but: |
| 68 | + // Fatal error: Arrays are not allowed in class constants |
| 69 | + // public static final $propertiesBase also doesn't work, so: |
67 | 70 | /** |
| 71 | + * Get the array representation of an empty gadget. |
| 72 | + * This would have been a constant or something if PHP hadn't sucked |
| 73 | + */ |
| 74 | + public static function getPropertiesBase() { |
| 75 | + return array( |
| 76 | + 'settings' => array( |
| 77 | + 'rights' => array(), |
| 78 | + 'default' => false, |
| 79 | + 'hidden' => false, |
| 80 | + 'shared' => false, |
| 81 | + 'category' => '', |
| 82 | + ), |
| 83 | + 'module' => array( |
| 84 | + 'scripts' => array(), |
| 85 | + 'styles' => array(), |
| 86 | + 'dependencies' => array(), |
| 87 | + 'messages' => array(), |
| 88 | + ), |
| 89 | + ); |
| 90 | + } |
| 91 | + |
| 92 | + /** |
68 | 93 | * Check the validity of the given properties array |
69 | 94 | * @param $properties Return value of FormatJson::decode( $blob, true ) |
70 | 95 | * @return Status object with error message if applicable |