Parent Directory
|
Revision Log
|
Revision Graph
Add version string.
| 1 | <?php |
| 2 | // $Id:$ |
| 3 | |
| 4 | /** |
| 5 | * Validates prefix |
| 6 | * |
| 7 | * @param string $prefix |
| 8 | * spaces context prefix |
| 9 | * @return FALSE if $prefix isn't valid |
| 10 | * $prefix if prefix is valid and unique |
| 11 | * N . $prefix if prefix is valid but not unique |
| 12 | */ |
| 13 | function mtk_spaces_validate_prefix($prefix) { |
| 14 | if (!$prefix) { |
| 15 | return FALSE; |
| 16 | } |
| 17 | $new_prefix = $prefix; |
| 18 | $i = 2; |
| 19 | while (db_result(db_query('SELECT prefix FROM {context_prefix} WHERE prefix = "%s" AND module = "spaces"', $new_prefix))) { |
| 20 | $new_prefix = $i . $prefix; |
| 21 | $i++; |
| 22 | } |
| 23 | return $new_prefix; |
| 24 | } |
| 25 |
| ViewVC Help | |
| Powered by ViewVC 1.1.2 |