'Drop', 'description' => 'This profile installs a system for creating coding events' ); } /** * Implementation of hook_profile_tasks() */ function drop_profile_tasks() { // some basis variables for the final step $theme = 'pixture'; // variables // unlimit the teaser length, for the frontpage variable_set('teaser_length', 0); // set the sitename and sitemission variable_set('site_name', " DROP | Drupal Rockin' Open Participation"); variable_set('site_mission', "Helping people contribute to Drupal through the usage of small, bite-sized tasks that help the Drupal community."); // theme related stuff // enable the pixture theme and set it as default db_query("UPDATE {system} SET status = %d WHERE type = '%s' AND name = '%s'", 1, 'theme', 'pixture'); //Initialize theme system system_theme_data(); system_initialize_theme_blocks($theme); // Enable PHPTemplate theme engine db_query("INSERT INTO {system} (filename, name, type, owner, status, throttle, weight) VALUES ('themes/engines/phptemplate/phptemplate.engine', 'phptemplate', 'theme_engine', '', 1, 0, 0)"); // set theme as default variable_set('theme_default', $theme); include_once('./modules/system/system.admin.inc'); //set the theme settings as default one $theme_settings = array ( 'toggle_logo' => 1, 'toggle_name' => 1, 'toggle_slogan' => 0, 'toggle_mission' => 1, 'toggle_node_user_picture' => 0, 'toggle_comment_user_picture' => 0, 'toggle_search' => 0, 'toggle_favicon' => 1, 'toggle_node_info_page' => 1, 'toggle_node_info_story' => 1, 'toggle_node_info_task' => 1, 'toggle_node_info_usernode' => 1, 'default_logo' => 1, 'logo_path' => '', 'logo_upload' => '', 'default_favicon' => 0, 'favicon_path' => 'profiles/drop/favicon.ico', 'favicon_upload' => '', 'op' => 'Save configuration', 'form_token' => '90509fe3406ff5adc32c3b577c84898a', ); variable_set('theme_settings', $theme_settings); // set the right color etc. $path = drupal_get_path('theme', $theme); $info = color_get_info($theme); $form_state['op'] = ''; $form_state['values']['theme'] = $theme; $palette = color_get_palette($theme); $form_state['values']['info'] = $info; $form_state['values']['scheme'] = '#9ab1f9,#4b5cc3,#062984,#5283ff,#555555'; $form_state['values']['palette'] = $palette; color_scheme_form_submit($form, $form_state); // User | roles | access // update the access permissions, for the anonmyus and registered users db_query("UPDATE {permission} SET perm = 'access comments, access content, access user profiles, view userpoints' WHERE rid = 1"); db_query("UPDATE {permission} SET perm = 'access comments, post comments, post comments without approval, access content, create task content, edit own task content, access user profiles, view userpoints' WHERE rid = 2"); // Insert default user-defined node types into the database. // node Parts // Create the default node types $types = array( array( 'type' => 'page', 'name' => t('Page'), 'module' => 'node', 'description' => t('If you want to add a static page, like a contact page or an about page, use a page.'), 'custom' => TRUE, 'modified' => TRUE, 'locked' => FALSE, ), array( 'type' => 'story', 'name' => t('Story'), 'module' => 'node', 'description' => t('Stories are articles in their simplest form: they have a title, a teaser and a body, but can be extended by other modules. The teaser is part of the body too. Stories may be used as a personal blog or for news articles.'), 'custom' => TRUE, 'modified' => TRUE, 'locked' => FALSE, ), ); foreach ($types as $type) { $type = (object) _node_type_set_defaults($type); node_type_save($type); } // insert the task nodetyp into datebase _create_content_type('profiles/drop/drop_contenttyp.task.inc'); // create the introduction page // create the sticky node drop_profile_node_about_drop(); // Taxonomy Part // generate the task vocab $vocab = array( 'name' => t('Task categories'), 'description' => t(''), 'help' => t(''), 'multiple' => 1, 'required' => 1, 'hierarchy' => 1, 'tags' => 0, 'module' => 'taxonomy', 'weight' => 0, 'nodes' => array( 'task' => t('Task') ) ); taxonomy_save_vocabulary($vocab); $vid = 1; // insert the terms of the task vocab $array = array( 'Code', 'Core', 'Documentation', 'Dojo', 'Graphics', 'Images', 'Javascripts', 'Marketing', 'Modules', 'Outreach', 'PHP', 'Quality assurance', 'Research', 'Screencasts', 'SQL', 'Theming', 'Usability', 'User interface', 'Video' ); include_once('modules/taxonomy/taxonomy.admin.inc'); $i = 0; foreach ($array as $name) { $term = array(); $i++; $term['weight'] = $i; $term['name'] = $name; $term['vid'] = $vid; $form_values = $term; taxonomy_save_term($form_values, $vid); } // blocks $i = 0; $blocks = array('views/Tasks-block_1', 'user/1', 'views/Tasks-block_2', 'user/0'); foreach ($blocks as $block) { $i++; $block = explode('/', $block); $settings = array( 'weight' => $i, 'region' => 'left', 'module' => $block[0] ); // $result = db_query("UPDATE {blocks} (weight, region, module, delta, status, visibility, theme, title) VALUES (%d, '%s', '%s', '%s', %d, %d, '%s', '%s') WHERE theme = %d", $term->weight, 'left', $block[0], $block[1], 1, 1, $theme, '', $theme); } $result = db_query("SELECT * FROM {blocks}"); while ($item = db_fetch_object($result)) { // print '
'. print_r($item, true) .''; } // Fetch and sort blocks include('modules/block/block.admin.inc'); $blocks = _block_rehash(); // If non-default theme configuration has been selected, set the custom theme. $custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland'); usort($blocks, '_block_compare'); $form_state = array ( 'storage' => NULL, 'submitted' => true, 'values' => array ( 'user_1' => array ( 'module' => 'user', 'delta' => '1', 'theme' => 'pixture', 'weight' => '-9', 'region' => 'left', ), 'user_0' => array ( 'module' => 'user', 'delta' => '0', 'theme' => 'pixture', 'weight' => '-7', 'region' => 'left', ), 'user_2' => array ( 'module' => 'user', 'delta' => '2', 'theme' => 'pixture', 'weight' => '-10', 'region' => '-1', ), 'locale_0' => array ( 'module' => 'locale', 'delta' => '0', 'theme' => 'pixture', 'weight' => '-9', 'region' => '-1', ), 'menu_primary-links' => array ( 'module' => 'menu', 'delta' => 'primary-links', 'theme' => 'pixture', 'weight' => '-8', 'region' => '-1', ), 'comment_0' => array ( 'module' => 'comment', 'delta' => '0', 'theme' => 'pixture', 'weight' => '-7', 'region' => '-1', ), 'search_0' => array ( 'module' => 'search', 'delta' => '0', 'theme' => 'pixture', 'weight' => '-6', 'region' => '-1', ), 'menu_secondary-links' => array ( 'module' => 'menu', 'delta' => 'secondary-links', 'theme' => 'pixture', 'weight' => '-5', 'region' => '-1', ), 'node_0' => array ( 'module' => 'node', 'delta' => '0', 'theme' => 'pixture', 'weight' => '-4', 'region' => '-1', ), 'views_Tasks-block_1' => array ( 'module' => 'views', 'delta' => 'Tasks-block_1', 'theme' => 'pixture', 'weight' => '-10', 'region' => 'left', ), 'views_Tasks-block_2' => array ( 'module' => 'views', 'delta' => 'Tasks-block_2', 'theme' => 'pixture', 'weight' => '-8', 'region' => 'left', ), 'user_3' => array ( 'module' => 'user', 'delta' => '3', 'theme' => 'pixture', 'weight' => '-2', 'region' => '-1', ), 'system_0' => array ( 'module' => 'system', 'delta' => '0', 'theme' => 'pixture', 'weight' => '-1', 'region' => '-1', ), 'op' => 'Save blocks', 'submit' => 'Save blocks', 'form_build_id' => 'form-d3d52df819e2e7479227d8fd2282fa92', 'form_token' => '0298934f47d5465097dfd178f08843c6', 'form_id' => 'block_admin_display_form', ), 'clicked_button' => array ( '#type' => 'submit', '#value' => 'Save blocks', '#post' => array ( 'views_Tasks-block_1' => array ( 'region' => 'left', 'theme' => 'pixture', 'weight' => '-10', ), 'user_1' => array ( 'region' => 'left', 'theme' => 'pixture', 'weight' => '-9', ), 'views_Tasks-block_2' => array ( 'region' => 'left', 'theme' => 'pixture', 'weight' => '-8', ), 'user_0' => array ( 'region' => 'left', 'theme' => 'pixture', 'weight' => '-7', ), 'user_2' => array ( 'region' => '-1', 'theme' => 'pixture', 'weight' => '-10', ), 'locale_0' => array ( 'region' => '-1', 'theme' => 'pixture', 'weight' => '-9', ), 'menu_primary-links' => array ( 'region' => '-1', 'theme' => 'pixture', 'weight' => '-8', ), 'comment_0' => array ( 'region' => '-1', 'theme' => 'pixture', 'weight' => '-7', ), 'search_0' => array ( 'region' => '-1', 'theme' => 'pixture', 'weight' => '-6', ), 'menu_secondary-links' => array ( 'region' => '-1', 'theme' => 'pixture', 'weight' => '-5', ), 'node_0' => array ( 'region' => '-1', 'theme' => 'pixture', 'weight' => '-4', ), 'user_3' => array ( 'region' => '-1', 'theme' => 'pixture', 'weight' => '-2', ), 'system_0' => array ( 'region' => '-1', 'theme' => 'pixture', 'weight' => '-1', ), 'op' => 'Save blocks', 'form_build_id' => 'form-0fa6953b8a4a4ef1d1d279947e028542', 'form_token' => '0298934f47d5465097dfd178f08843c6', 'form_id' => 'block_admin_display_form', ), '#programmed' => false, '#tree' => true, '#parents' => array ( 0 => 'submit', ), '#array_parents' => array ( 0 => 'submit', ), '#weight' => 0.013, '#processed' => false, '#description' => NULL, '#attributes' => array ( ), '#required' => false, '#input' => true, '#name' => 'op', '#button_type' => 'submit', '#executes_submit_callback' => true, '#process' => array ( 0 => 'form_expand_ahah', ), '#id' => 'edit-submit', ), 'redirect' => NULL, ); drupal_execute('block_admin_display_form', $form_state, $blocks, 'pixture'); // $result = db_query("UPDATE {blocks} SET weight = %d, region = '%s', module = '%s', delta = '%s', status = %d, visibility = %d, theme = '%s', title = '%s' WHERE theme = '%s'", 0, 'left', 'user', '1', 1, 1, $theme, '', $theme); // $result = db_query("UPDATE {blocks} SET weight = %d, region = '%s', module = '%s', delta = '%s', status = %d, visibility = %d, theme = '%s', title = '%s' WHERE theme = '%s'", 0, 'left', 'user', '2', 1, 1, $theme, '', $theme); db_query("UPDATE {blocks} SET weight = %d, region = '%s' WHERE module = '%s' AND delta = %d", -1, 'left', 'user', 1); // create the primary_links // an array of the menu items $array = array( array( 'link_path' => 'tasks/mentor', 'link_title' => "Tasks I'm mentoring", 'description' => 'Tasks that you, yourself are mentoring', 'type' => 54, ), array( 'link_path' => 'tasks/my', 'link_title' => 'My tasks', 'description' => 'A table of your tasks', 'type' => 54, ), array( 'link_path' => 'tasks/open', 'link_title' => 'Open Tasks', 'description' => 'A table of open tasks', 'type' => 54, ), array( 'link_path' => 'tasks', 'link_title' => 'All tasks', 'description' => 'A table of all tasks', 'type' => 54, ), array( 'link_path' => 'node/1', 'link_title' => 'About', 'description' => 'All about DROP', 'type' => 54, ), array( 'link_path' => 'http://drupal.org', 'link_title' => 'Drupal.org', 'description' => 'Links back to the main Drupal page', 'type' => 54, ), ); // now we have the menuitems in the correct order | so we can use the key as weight foreach ($array as $weight => $item) { $item['menu_name'] = 'primary-links'; $item['weight'] = $weight; menu_link_save($item); } // rebuild the menu structure so its displayed right after the first installation menu_rebuild(); return '
'. t('The Drop Installation is finished, now you can create your first
tasks and work together to bring on your project. !here you go . There username is admin
and the passwort is drop.
The website of DROP
is !link',
array('!link' => l('http://drop.cwgordon.com', 'http://drop.cwgordon.com'),
'!here' => l('Here', '')));
}
/* Helper function to import a CCK content type definition from a text file.
*
* @param $cck_definition_file
* The full path to the file containing the CCK definition.
*/
function _create_content_type($cck_definition_file) {
$values = array();
$values['type_name'] = ' DROP, which stands for Drupal Really Open Participation, is a project designed for organizing short-term tasks for members of the community who are still getting familiar with the system. There are also a few harder tasks available for more seasoned developers looking for something to do when they're bored. A DROP task is a short-term task that can theoretically be done in less than a week. It's fine if it's estimated at a bit more than a week. Participants doing DROP tasks may take as long as they'd like; however, after a week is up, another participant can jump in and start working on it if they want to. Sample tasks: If you have a task that you think is appropriate for DROP, feel free to name it "DROP Task: [rest of issue title here...]" on the appropriate drupal.org issue queue. If it doesn't really have an issue queue it belongs to, you can place it in the DROP issue queue under the component "Oddball DROP Task". If you are unsure about whether your idea is an appropriate DROP task or you have not made a post for the task on this site (drop.cwgordon.com), you may place a post to the same issue queue under the component "Task idea". To claim a task, simply comment on the task at drop.cwgordon.com saying you're working on it, and mark it as "claimed". You may not claim a task that someone is already working on unless a week has passed since they have last received a review of their work. You may not have more than three tasks not pending review. You may have as many tasks pending review as you like. Anyone can participate! Feel free to claim any tasks here that catch your interest. Just one request: please don't do any work on these tasks outside of the DROP program without first withdrawing the task, as this may lead to duplicate work being done, which is a complete waste of time. That said, there are no restrictions on who can participate: anyone, from anywhere, in any position, of any age, is invited to claim, mentor, or propose a task. This site is solely for tracking purposes. All work should actually be posted at the appropriate drupal.org issue. However, all mentors and participants should create accounts here; if they don't, one will be created for them, and they will be notified of it via email. Participants receive points for completing tasks; this is a way of tracking the quantity and quality of work participants are doing. More points will be awarded for high-quality work, and more points will be awarded for harder/longer tasks. The average task is worth about 15 points. Each month, "winners"— although everyone who participates is really a winner, no matter what— will be fully recognized. The idea of short, bite-sized tasks first originated during Drupal's participation in Google Highly Open Participation Contest (GHOP). Suddenly, BAM!, we had a LOT of awesome new contributors to Drupal. Then, GHOP ended. What were they to do? Simply go back to not contributing to Drupal? Of course not! Instead, they started DROP. See http://groups.drupal.org/node/8321 for the original ideas.What makes a DROP Task?
Adding a task to DROP
Claiming Tasks
Who can participate?
Purpose of this site
Origin of DROP