/[drupal]/contributions/sandbox/alex_b/mtk/helper/spaces.inc
ViewVC logotype

Contents of /contributions/sandbox/alex_b/mtk/helper/spaces.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Thu Aug 7 17:25:18 2008 UTC (15 months, 2 weeks ago) by alexb
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -0 lines
File MIME type: text/x-php
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