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

Contents of /contributions/sandbox/alex_b/mtk/crud/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:17 2008 UTC (15 months, 3 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 * Set default feature for spaces.
6 * @param node object $node
7 * @param string $features_home - default feature
8 * @param array $features - array of features to activate. if not specified, default features will be used.
9 */
10 function mtk_spaces_set_features($node, $features_home, $features = 0) {
11 db_query('DELETE FROM {spaces_features} WHERE gid = %d', $node->nid);
12 if (!$features) {
13 $features = spaces_features(0);
14 }
15 foreach ($features as $id => $value) {
16 db_query('INSERT INTO {spaces_features}(gid, type, id, value) VALUES (%d, 0, "%s", "%s")', $node->nid, $id, $value);
17 }
18 db_query('DELETE FROM {spaces_features} WHERE gid = %d AND type = 1 AND id = "spaces_home"', $node->nid);
19 db_query('INSERT INTO {spaces_features} (gid, type, id, value) VALUES (%d, 1, "spaces_home", "%s")', $node->nid, $features_home);
20 }

  ViewVC Help
Powered by ViewVC 1.1.2