-
-
-
');
-
-
-
-
-
-
-
-
-
- // User Management ----------------------------------
- // --------------------------------------------------
-
- // User settings
- //--------------------------------------------------------------
-
- // turn on user pictures by default, now that we've set file paths
- variable_set('user_pictures', TRUE);
- // Set user registration to "pending approval"
- variable_set('user_register', '2');
-
- // Set default role IDs
- $role_id['anonymous user'] = 1;
- $role_id['authenticated user'] = 2;
-
- // Create a Site Admin and Alumni roles
- $role_id['Site Admin'] = install_add_role('Site Admin');
- $role_id['Alumni'] = install_add_role('Alumni');
-
- // Set permissions for all roles
- $permissions['anonymous user'] = array(
- 'access content',
- 'access comments',
- 'access site-wide contact form',
- 'search content',
- 'use advanced search',
- 'access tinymce',
- 'view uploaded files',
- 'access user profiles'
- );
-
- // Authenticated is the same as anonymous, plus comment posting
- $permissions['authenticated user'] =
- array_merge( $permissions['anonymous user'],
- array(
- 'post comments',
- 'post comments without approval',
- 'use original size',
- 'access tinymce',
- 'access all images',
- 'access img_assist'
- )
- );
-
- // Alumni automatically has authenticated user role
- $permissions['Alumni'] = array(
- 'edit own blog',
- 'create story content',
- 'edit story content',
- //'create page content',
- //'edit page content',
- 'access tinymce',
- 'create images',
- 'edit own images',
- 'view original images',
- 'revert revisions',
- 'view revisions',
- 'view post access counter',
- 'upload files',
- 'post with no akismet checking'
- );
-
-
- // Site Admin has all permissions
- $permissions['Site Admin'] =
- array_merge( $permissions['Contributor'],
- array(
- 'administer akismet settings',
- 'moderate spam in comments',
- 'moderate spam in nodes of type Blog entry',
- 'moderate spam in nodes of type Image',
- 'moderate spam in nodes of type Page',
- 'moderate spam in nodes of type Story',
- 'administer blocks',
- 'use PHP for block visibility',
- 'administer comments',
- 'administer filters',
- 'administer menu',
- 'administer content types',
- 'administer nodes',
- 'administer url aliases',
- 'create url aliases',
- 'administer pathauto',
- 'administer search',
- 'administer simplemenu',
- 'view simplemenu',
- 'access statistics',
- 'access administration pages',
- 'administer site configuration',
- 'select different theme',
- 'administer taxonomy',
- 'administer tinymce',
- 'administer access control',
- 'administer users',
- 'change own username',
- 'administer views',
- 'access tinymce',
- 'access advanced options'
- )
- );
-
- foreach ($permissions as $rolename => $perms) {
- install_set_permissions($role_id[$rolename], $perms);
- }
-
-
- // Profiles
- // -------------------------------
- // Custom profile fields
- // -------------------------------
- db_query("INSERT INTO {profile_fields} VALUES (2,'First Name','first_name','','Alumni Profile',NULL,'textfield',0,1,1,3,0,NULL),(3,'Last Name','last_name','','Alumni Profile',NULL,'textfield',0,1,1,3,0,NULL),(4,'Maiden Name','maiden_name','','Alumni Profile',NULL,'textfield',0,0,1,3,0,NULL),(5,'Marital Status','marital_status','','Alumni Profile',NULL,'selection',0,0,1,3,0,'Single, Married'),(6,'Home Address','home_address','','Alumni Profile',NULL,'textfield',0,1,1,1,0,NULL),(7,'Home City','home_city','','Alumni Profile',NULL,'textfield',0,1,1,1,0,NULL),(8,'Home State','home_state','','Alumni Profile','Alumni from %value','selection',0,1,1,3,0,'AL\r\nAK\r\nAS\r\nAZ\r\nAR\r\nCA\r\nCO\r\nCT\r\nDE\r\nDC\r\nFL\r\nGA\r\nHI\r\nID\r\nIL\r\nIN\r\nIA\r\nKS\r\nKY\r\nLA\r\nME\r\nMD\r\nMA\r\nMI\r\nMN\r\nMS\r\nMO\r\nMT\r\nNE\r\nNV\r\nNH\r\nNJ\r\nNM\r\nNY\r\nNC\r\nND\r\nOH\r\nOK\r\nOR\r\nPA\r\nPR\r\nRI\r\nSC\r\nSD\r\nTN\r\nTX\r\nUT\r\nVT\r\nVI\r\nVA\r\nWA\r\nWV\r\nWI\r\nWY\r\nOTHER\r\nOVERSEAS'),(9,'Zip Code','zip_code','','Alumni Profile',NULL,'textfield',0,1,1,1,0,NULL),(10,'Phone Number','phone_number','','Alumni Profile',NULL,'textfield',0,1,1,1,0,NULL),(11,'Website','web_page','Your personal website, blog, etc.','Alumni Profile',NULL,'url',0,0,1,3,0,NULL),(12,'Profession','profession','What do you do for a living?','Alumni Profile',NULL,'textfield',0,0,1,3,0,NULL),(13,'AboutYou','about_you','Tell us a little about yourself, in the form of a biography or descriptive sentence or two.','Alumni Profile',NULL,'textarea',0,0,1,3,0,NULL),(14,'Graduation Year','grad_year','','Alumni Profile','Alumni from the class of %value','selection',-5,0,1,3,0,'1940\r\n1941\r\n1942\r\n1943\r\n1944\r\n1945\r\n1946\r\n1947\r\n1948\r\n1949\r\n1950\r\n1951\r\n1952\r\n1953\r\n1954\r\n1955\r\n1956\r\n1957\r\n1958\r\n1959\r\n1960\r\n1961\r\n1962\r\n1963\r\n1964\r\n1965\r\n1966\r\n1967\r\n1968\r\n1969\r\n1970\r\n1971\r\n1972\r\n1973\r\n1974\r\n1975\r\n1976\r\n1977\r\n1978\r\n1979\r\n1980\r\n1981\r\n1982\r\n1983\r\n1984\r\n1985\r\n1986\r\n1987\r\n1988\r\n1989\r\n1990\r\n1991\r\n1992\r\n1993\r\n1994\r\n1995\r\n1996\r\n1997\r\n1998\r\n1999\r\n2000\r\n2001\r\n2002\r\n2003\r\n2004\r\n2005\r\n2006\r\n2007')");
-
- // User registration guidelines - help message
- variable_set('user_registration_help', '');
-
-
- // Create pre-populated content
- // -------------------------------------------------------------
-
- // Create a Welcome story
- $welcome_body = "Welcome to your new Alumni Drupal website! Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
-
-
";
-
- $node = array(
- 'type' => 'story',
- 'title' => 'Welcome',
- 'uid' => 0,
- 'name' => 'Anonymous',
- 'status' => 1,
- 'comment' => 0,
- 'promote' => 1,
- 'sticky' => 1,
- 'revision' => 1,
- 'format' => 2,
- 'body' => $welcome_body
- );
-
- $node = node_submit($node);
- node_save($node);
- unset($node);
-
-
- // Create an "About" page
- $about_body = 'This is an About page. Write what your site is about here.';
-
- $node = array(
- 'type' => 'page',
- 'title' => 'About',
- 'uid' => 0,
- 'name' => 'Anonymous',
- 'status' => 1,
- 'comment' => 0,
- 'promote' => 1,
- 'revision' => 1,
- 'format' => 1,
- 'body' => $about_body
- );
-
- $node = node_submit($node);
- node_save($node);
- unset($node);
-
- // Create the 403 access denied page
- $access_denied = 'This is the custom access denied - 403 page for your site. Create your 403 error message here.';
-
- $node = array(
- 'type' => 'page',
- 'title' => 'access denied',
- 'uid' => 1,
- 'name' => 'Anonymous',
- 'status' => 1,
- 'comment' => 0,
- 'promote' => 1,
- 'revision' => 1,
- 'format' => 1,
- 'body' => $access_denied
- );
-
- $node = node_submit($node);
- node_save($node);
- unset($node);
-
- // Create the custom Page Not Found - 404 - error page
- $not_found = 'This is the custom Page Not Found - Error 404 - page for your site. Create your custom 404 error message here.';
-
- $node = array(
- 'type' => 'page',
- 'title' => 'not found',
- 'uid' => 1,
- 'name' => 'Anonymous',
- 'status' => 1,
- 'comment' => 0,
- 'promote' => 1,
- 'revision' => 1,
- 'format' => 1,
- 'body' => $not_found
- );
-
- $node = node_submit($node);
- node_save($node);
- unset($node);
-
-// Create the privacy policy page
- $privacy_policy = 'We know privacy is important to you and is vital to the success of our organization. This document explains our Privacy Policy. We want you to know how we keep our member information private and secure and how we use the information. ';
-
- $node = array(
- 'type' => 'page',
- 'title' => 'privacy policy',
- 'uid' => 1,
- 'name' => 'Anonymous',
- 'status' => 1,
- 'comment' => 0,
- 'promote' => 1,
- 'revision' => 1,
- 'format' => 1,
- 'body' => $privacy_policy
- );
-
- $node = node_submit($node);
- node_save($node);
- unset($node);
-
- // Contact form creation
- db_query("INSERT INTO {contact} VALUES (1,'website feedback','feedback@example.com','',0,0)");
- db_query("INSERT INTO {contact} VALUES (2,'support','support@example.com','',0,0)");
-
-
-
- // Menus
- // -----------------------------------------------------
-
- // Create Primary links
- $primary_menu_id = 2;
-
- $item = array();
- $item['pid'] = '2';
- $item['path'] = 'alumni-directory';
- $item['title'] = st('Alumni directory');
- $item['description'] = st('A complete listing of all registered Alumni');
- $item['weight'] = -1;
- $item['type'] = 118;
- menu_save_item($item);
-
- $item = array();
- $item['pid'] = '2';
- $item['path'] = 'user/register';
- $item['title'] = st('Alumni registration');
- $item['description'] = st('Register as an Alumni or Member');
- $item['weight'] = 1;
- $item['type'] = 118;
- menu_save_item($item);
-
- $item = array();
- $item['pid'] = '2';
- $item['path'] = 'user';
- $item['title'] = st('Login');
- $item['description'] = st('Log in with your username and password');
- $item['weight'] = 2;
- $item['type'] = 118;
- menu_save_item($item);
-
- $item = array();
- $item['pid'] = '2';
- $item['path'] = 'logout';
- $item['title'] = st('Log out');
- $item['description'] = st('Good-bye!');
- $item['weight'] = 3;
- $item['type'] = 118;
- menu_save_item($item);
-
- $item = array();
- $item['pid'] = '2';
- $item['path'] = 'contact';
- $item['title'] = st('Contact us');
- $item['description'] = st('Use our contact form to email us');
- $item['weight'] = 4;
- $item['type'] = 118;
- menu_save_item($item);
-
- $secondary_mid = install_menu_create_menu('Secondary links');
- //variable_set('menu_secondary_menu', $secondary_mid);
-
- // Create menu entry for About page
- //$about_mid = install_menu_create_menu_item('node/2', 'About', $secondary_mid);
-
- // Add Contact menu item to secondary links
- //$contact_mid = install_menu_get_mid('contact');
- //install_menu_set_menu($contact_mid, $secondary_mid, 10);
-
- // Create an Admin menu for SimpleMenu
- $adminroot_mid = install_menu_create_menu('Admin');
-
- // Get the Administer menu ID
- $admin_mid = install_menu_get_mid('admin');
-
- // Set the Administer item to be underneath the new Admin menu, and disable it
- install_menu_set_menu($admin_mid, $adminroot_mid, 0, 48);
-
- // Set SimpleMenu to use the Admin menu we just created
- variable_set('simplemenu_menu', $adminroot_mid);
-
-
-
- // Taxonomy
- // -------------------------------------------------------------
-
- // Tags vocab for stories
- $tags = array('name' => 'tags',
- 'tags' => 1,
- 'description' => '',
- 'module' => 'taxonomy',
- 'nodes' => array('story' => 1, 'image' => 1, 'blog' => 1));
- taxonomy_save_vocabulary($tags);
-
-
-
- // Module configuration
- // ------------------------------------------------------------
-
- // Registration role - automatically assign to new users the Alumni role
- variable_set('registration_role_roles', '4');
-
- // Pathauto: set default paths
- variable_set('pathauto_node_page_pattern', '[title]');
- variable_set('pathauto_node_story_pattern', 'news/[yyyy]/[mm]/[dd]/[title]');
- variable_set('pathauto_node_blog_pattern', 'blog/[user]/[title]');
- variable_set('pathauto_node_applytofeeds', FALSE);
-
- // Image gallery
- variable_set('image_images_per_page','6');
- variable_set('image_default_path', 'images');
- variable_set('image_max_upload_size', '1024');
-
- // Img Assist
- variable_set('img_assist_link', 'none');
- variable_set('img_assist_default_link_behavior', 'none');
- variable_set('img_assist_default_insert_mode', 'html');
-
- // TinyMCE
- $comment_settings = array(
- 'name' => 'Comments',
- 'old_name' => 'Comments',
- /* for reference, all settings need to be strings */
- 'rids' => array(
- $role_id['anonymous user'] => (string)$role_id['anonymous user'],
- $role_id['authenticated user'] => (string)$role_id['authenticated user']
- ),
- 'default' => 'true',
- 'user_choose' => 'false',
- 'show_toggle' => 'false',
- 'theme' => 'advanced',
- 'language' => 'en',
- 'safari_message' => 'false',
- 'access' => '1',
- 'access_pages' => "node/*\ncomment/*",
- 'buttons' => array(
- 'autosave' => '1',
- 'default-bold' => '1',
- 'default-italic' => '1',
- 'default-underline' => '1',
- 'default-strikethrough' => '1',
- 'default-link' => '1',
- 'default-unlink' => '1',
- 'emotions-emotions' => '1',
- ),
- 'toolbar_loc' => 'top',
- 'toolbar_align' => 'center',
- 'path_loc' => 'bottom',
- 'resizing' => 'true',
- 'block_formats' => 'p,address,pre,h1,h2,h3,h4,h5,h6',
- 'verify_html' => 'true',
- 'preformatted' => 'false',
- 'convert_fonts_to_styles' => 'true',
- 'css_setting' => 'theme',
- 'css_path' => '',
- 'css_classes' => ''
- );
-
- // We'll install the Comments profile and associate it with the anonymous and authenticated users
- install_tinymce_create_profile( 'Comments', $comment_settings );
- install_tinymce_add_roles( 'Comments', array( $role_id['anonymous user'], $role_id['authenticated user'] ) );
-
- // Let's start off with the same base
- $basic_settings = $comment_settings;
-
- // now we just override the changes
- $basic_settings['name'] = 'Alumni';
- $basic_settings['old_name'] = 'Alumni';
- $basic_settings['rids'] = array($role_id['Alumni'] => (string)$role_id['Alumni']);
- $basic_settings['user_choose'] = 'true';
-
- // we'll start with the same button set and merge in new ones
- $basic_settings['buttons'] = array_merge(
- $comment_settings['buttons'],
- array(
- 'default-justifyleft' => '1',
- 'default-justifycenter' => '1',
- 'default-justifyright' => '1',
- 'default-bullist' => '1',
- 'default-numlist' => '1',
- 'default-indent' => '1',
- 'default-outdent' => '1',
- 'default-hr' => '1',
- 'spellchecker-spellchecker' => '1',
- 'drupalbreak-drupalbreak' => '1',
- 'drupalimage-drupalimage' => '1'
- )
- );
- $basic_settings['toolbar_align'] = 'left';
-
- // Now we create the Basic profile and assign it to the Contributor role
- install_tinymce_create_profile( 'Alumni', $basic_settings );
- install_tinymce_add_roles( 'Alumni', array( $role_id['Alumni']) );
-
- // Let's do the same with Advanced, start it off with Basic settings
- $advanced_settings = $basic_settings;
-
- // now we just override the changes -- main difference is a Tables button and showing the toggle to disable rich text
- $advanced_settings['name'] = 'Advanced';
- $advanced_settings['old_name'] = 'Advanced';
- $advanced_settings['rids'] = array($role_id['Site Admin'] => (string)$role_id['Site Admin']);
- $advanced_settings['show_toggle'] = 'true';
-
- // only addition is ability to work with tables
- $advanced_settings['buttons']['table-tablecontrols'] = '1';
-
- // Now we create the Advanced profile and assign it to the Site Admin role
- install_tinymce_create_profile( 'Advanced', $advanced_settings );
- install_tinymce_add_roles( 'Advanced', array( $role_id['Site Admin']) );
-
- // Views
- // -------------------------------
- // -------------------------------
-
- // Views preparation
- // -----------------
-
- views_load_cache();
-
- // Disable default views
- // ---------------------
-
- $views_status = variable_get('views_defaults', array());
- $views_status['taxonomy_directory'] = 'disabled';
- variable_set('views_defaults', $views_status);
-
-
- // Build the Alumni Directory
- // -----------------------------
- db_query("INSERT INTO {view_exposed_filter} VALUES (1,'grad_year.value','Select a Class to view',1,1,1,1,0)");
-
- db_query("INSERT INTO {view_filter} VALUES (1,'','usernode_users_roles.rid','4','OR','',1),(2,'','usernode_users.status','1','=','',0),(1,'','usernode_users.status','1','=','',0),(1,'','grad_year.value','1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007','OR','',2)");
-
- db_query("INSERT INTO {view_sort} VALUES (1,0,'grad_year.value','ASC','',NULL),(1,1,'last_name.value','ASC','',NULL)");
-
- db_query("INSERT INTO {view_tablefield} VALUES (1,'last_name','value','Last Name','',1,'0','',3),(1,'first_name','value','First Name','',1,'0','',2),(1,'grad_year','value','Class','',1,'ASC','',1),(2,'usernode_users','name','Username','usernode_views_handler_field_username_link',1,'0','',0),(2,'grad_year','value','Class','',1,'ASC','',1),(2,'first_name','value','First Name','',1,'0','',2),(2,'last_name','value','Last Name','',1,'0','',3),(2,'maiden_name','value','Maiden Name','',1,'0','',4),(1,'usernode_users','name','Username','usernode_views_handler_field_username_link',1,'0','',0),(1,'maiden_name','value','Maiden Name','',1,'0','',4)");
-
- db_query("INSERT INTO {view_view} VALUES (1,'alumni_directory','Alumni Directory','',1,'Alumni Directory','All registered alumni are listed here. If you are an alumni and are not listed in this directory, please take the time to register.',1,'The alumni directory is currently empty. Please take the time to register .',1,'',1,'table',1,50,'alumni-directory',0,0,0,'',0,'tab','',0,0,'',0,'',1,0,'',1,0,'',1,'node',0,0,0,1182565851,'',0)");
-
- // Clean up
- // --------
-
- cache_clear_all();
- system_modules();
- menu_rebuild();
- node_types_rebuild();
-
-}