Commit 862569aa authored by drumm's avatar drumm
Browse files

Merge branch '6.x-3.x' into 1386716-crosssite-cleanup

parents 418a4792 c55d12fd
......@@ -42,14 +42,12 @@ function apidrupalorg_form_comment_form_alter(&$form, &$form_state) {
'#value' => '<p>' . t('<strong>Buggy or inaccurate documentation?</strong> Please <a href="!url">file an issue</a> instead of <a href="http://drupal.org/node/14345">commenting</a> here. Need <a href="http://drupal.org/support">support</a>? Need help programming? Connect with the <a href="http://drupal.org/community" rel="nofollow">Drupal community</a>.', array(
'!url' => url('http://drupal.org/node/add/project-issue/drupal', array(
'query' => array(
'title' => t('Documentation problem with @label', array(
'@label' => drupal_get_title(),
)),
'component' => 'documentation',
'categories' => 'bug',
'version' => $versions[$branch->branch_name],
'body' => t("API page: @request_url\n\nDescribe the problem you have found:\n", array(
'body' => t("API page: @request_url\n\nEnter a descriptive title (above) relating to @label, then describe the problem you have found:\n", array(
'@request_url' => 'http://' . $_SERVER['HTTP_HOST'] . request_uri(),
'@label' => drupal_get_title(),
)),
),
)),
......
<?php
/**
* @file
* drupalorg_metrics module drush integration.
*/
/**
* Implementation of hook_drush_command().
*
* @See drush_parse_command() for a list of recognized keys.
*
* @return
* An associative array describing your command(s).
*/
function drupalorg_metrics_drush_command() {
$items = array();
$items['drupalorg-metrics-generate'] = array(
'description' => "Generate and cache metrics data.",
'drupal dependencies' => array('project_issue'),
'aliases' => array('domg'),
);
return $items;
}
/**
* Command callback. Generate and cache metrics data.
*/
function drush_drupalorg_metrics_generate() {
drupalorg_metrics_record_stats(2007, 2030);
}
name = Drupal.org Metrics
description = A community dashboard
package = Drupal.org
core = 6.x
dependencies[] = versioncontrol_project
dependencies[] = project_issue
dependencies[] = flot
<?php
/**
* @file
* A dashboard showing community health metrics over time.
*/
/**
* Implementation of hook_menu().
*/
function drupalorg_metrics_menu() {
return array(
'metrics' => array(
'title' => 'Drupal.org Metrics',
'page callback' => 'drupalorg_metrics_page',
'access arguments' => array('access content'),
),
);
}
/**
* Page callback.
*/
function drupalorg_metrics_page() {
$map = array(
'nodes' => t('Nodes created by month'),
'users' => t('Users created by month'),
'comments' => t('Comments created by month'),
'commits' => t('Commits created by month'),
'committers' => t('Committers by month'),
);
$counts = cache_get('drupalorg_metrics_counts', 'drupalorg');
$output = '';
foreach ($counts->data as $type => $points) {
$graph = theme('flot_graph', array('style' => 'width:940px;height:400px'), array(new flotData($points)), array(
'xaxis' => array('mode' => 'time', 'ticks' => 9),
'series' => array(
'lines' => array('show' => 'true'),
'points' => array('show' => 'true'),
),
'grid' => array(
'borderwidth' => 1,
),
));
$output .= '<h2 id="' . $type . '">' . $map[$type] . '</h2>' . $graph;
$links[] = array('title' => $map[$type], 'href' => $_GET['q'], 'fragment' => $type);
}
return theme('links', $links) . $output;
}
function drupalorg_metrics_record_stats($start_year, $end_year) {
if (lock_acquire('drupalorg_metrics_record_stats', 5)) {
for ($year = $start_year; $year <= $end_year; $year++) {
for ($month = 1; $month <= 12; $month++) {
$start = mktime(0, 0, 0, $month, 1, $year);
$end = mktime(0, 0, 0, $month + 1, 1, $year);
// Don't record the current month or future months.
if ($end > $_SERVER['REQUEST_TIME']) {
break;
}
// Javascript timestamps are in milliseconds since epoch.
$start_js = $start * 1000;
$counts['nodes'][] = array($start_js, db_result(db_query("SELECT COUNT(*) FROM node WHERE created >= %d AND created < %d", $start, $end)));
$counts['users'][] = array($start_js, db_result(db_query("SELECT COUNT(*) FROM users WHERE status = 1 AND created >= %d AND created < %d", $start, $end)));
$counts['comments'][] = array($start_js, db_result(db_query("SELECT COUNT(*) FROM comments WHERE status = %d AND timestamp >= %d AND timestamp < %d", COMMENT_PUBLISHED, $start, $end)));
$counts['commits'][] = array($start_js, db_result(db_query("SELECT COUNT(DISTINCT(revision)) FROM versioncontrol_operations WHERE date >= %d AND date < %d AND author <> 'tggm@no-reply.drupal.org'", $start, $end)));
$counts['committers'][] = array($start_js, db_result(db_query("SELECT COUNT(DISTINCT(author_uid)) FROM versioncontrol_operations WHERE date >= %d AND date < %d", $start, $end)));
}
}
cache_set('drupalorg_metrics_counts', $counts, 'drupalorg');
lock_release('drupalorg_metrics_record_stats');
}
}
......@@ -251,20 +251,25 @@ class DrupalorgProjectPackageReleaseDistro extends DrupalorgProjectPackageReleas
*/
public function recordLibraries($libraries) {
foreach ($libraries as $name => $library) {
$url = '';
switch ($library['download']['type']) {
case 'cvs':
$url = $library['download']['root'] .' '. $library['download']['module'];
break;
case 'bzr':
case 'svn':
case 'git':
case 'file':
default:
$url = $library['download']['url'];
break;
}
if (empty($url)) {
wd_err("ERROR: Can't find URL for eternal library $name");
}
else {
// Record the remote item and save its ID in case there are patches.
$remote_id = project_package_record_remote_item($this->release_node->nid, $url, $name);
$this->recordPatchInfo($library, $remote_id, 'remote');
}
// Record the remote item and save its ID in case there are patches.
$remote_id = project_package_record_remote_item($this->release_node->nid, $url, $name);
$this->recordPatchInfo($library, $remote_id, 'remote');
}
}
......
core = "6.x"
datestamp = "1316652325"
dependencies[] = "date"
dependencies[] = "drupalorg_grid"
dependencies[] = "features"
dependencies[] = "fieldgroup"
......
......@@ -219,6 +219,9 @@ function drupalorg_packaging_whitelist_views_default_views() {
));
$handler->override_option('sitename_title', FALSE);
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('header', 'To request changes to this list, visit the <a href="/project/drupalorg_whitelist">Drupal.org Library Packaging Whitelist</a> project page.');
$handler->override_option('header_format', '1');
$handler->override_option('header_empty', 1);
$handler->override_option('path', 'packaging-whitelist');
$handler->override_option('menu', array(
'type' => 'none',
......
......@@ -343,6 +343,12 @@ function _project_verify_package_verify_release_node($form, &$form_state) {
form_set_error('title', $message);
}
}
elseif ($result == 'not found') {
// If there is no drupal-org.make file at all, we just want to return
// without a validation error so that distributions which don't
// use the Drupal.org packaging system can still create releases.
return;
}
else {
form_set_error('title', t("Pre-packaging verification failed -- unable to retrieve %makefile from %url: %error", array('%makefile' => PROJECT_VERIFY_PACKAGE_MAKE_FILE, '%url' => $url, '%error' => $data)));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment