/[drupal]/contributions/modules/nodeprofile/content_profile.install
ViewVC logotype

Contents of /contributions/modules/nodeprofile/content_profile.install

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


Revision 1.1 - (show annotations) (download) (as text)
Fri Jan 25 10:57:36 2008 UTC (22 months ago) by fago
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
checked in a first prototype of content profile
1 <?php
2 // $Id: content_profile.install,v 1.1.2.4 2007/04/05 10:27:50 fago Exp $
3
4 /**
5 * Implementation of hook_enable()
6 */
7 function content_profile_enable() {
8 //enable the default content type 'profile' to te a content profile
9 if (!variable_get('content_profile_profile', FALSE)) {
10 variable_set('content_profile_profile', array());
11 }
12 }
13
14 /**
15 * Implementation of hook_install()
16 */
17 function content_profile_install() {
18 // Set the module weight to -1, so content_profile_user() gets called before
19 // node_user(), so that one can't set a node's uid to 0 on user deletion
20 // before the profile nodes are deleted.
21 db_query("UPDATE {system} SET weight = -1 WHERE name = 'content_profile'");
22 }
23
24 /**
25 * Implementation of hook_uninstall()
26 */
27 function content_profile_uninstall() {
28 foreach (node_get_types('names') as $typename => $visiblename) {
29 if (variable_get('content_profile_'. $typename, 0)) {
30 variable_del('content_profile_'. $typename);
31 }
32 }
33 variable_del('content_profile_settings');
34 }
35
36 /**
37 * Set module weight to -1, as explained in content_profile_install().
38 */
39 function content_profile_update_6001() {
40 $ret = array();
41 $ret[] = update_sql("UPDATE {system} SET weight = -1 WHERE name = 'content_profile'");
42 return $ret;
43 }

  ViewVC Help
Powered by ViewVC 1.1.2