function contentanalysis_checklist_analyzer in Content Analysis 6
Same name and namespace in other branches
- 8 contentanalysis.module \contentanalysis_checklist_analyzer()
- 7 contentanalysis.module \contentanalysis_checklist_analyzer()
Generates checklist analyzer
Parameters
$context: A context formated array
$analysis: contentanalysis formated analysis array
1 call to contentanalysis_checklist_analyzer()
- contentanalysis_do_analysis in ./
contentanalysis.module - Provides analysis on context passed in
File
- ./
contentanalysis.module, line 935
Code
function contentanalysis_checklist_analyzer($context, $analysis) {
$analysis['content'][] = contentanalysis_format_content(t('The content analysis module enables a suite of analyzers to help you develop better, more optimized content. <br> <br> List of available analyzer modules:'), -5);
$modules = array(
array(
'name' => t('Content optimizer'),
'module' => 'contentoptimizer',
'description' => t('Quick search engine optimization (SEO) analysis to assure your content follows basic SEO guidelines.'),
'recommended' => TRUE,
'link' => 'http://www.drupal.org/project/contentoptimizer',
),
array(
'name' => t('Scribe SEO'),
'module' => 'scribeseo',
'description' => t('Advanced search engine optimization (SEO) analysis. Features content scoring, keyword extraction, sample SERP listing and optimization recommendations.'),
'recommended' => TRUE,
'link' => 'http://www.drupal.org/project/scribeseo',
),
array(
'name' => t('Readability'),
'module' => 'readability',
'description' => t('Grades content for readability using five popular automated readability standards.'),
'recommended' => TRUE,
'link' => 'http://www.drupal.org/project/readability',
),
array(
'name' => t('Alchemy'),
'module' => 'alchemy',
'description' => t('Extracts keywords, concepts and entities from content using the Alchemy service.'),
'recommended' => TRUE,
'link' => 'http://www.drupal.org/project/alchemy',
),
array(
'name' => t('Keyword research'),
'module' => 'kwresearch',
'description' => t('Provides search popularity and other statistics for researching keyword phrases.'),
'recommended' => TRUE,
'link' => 'http://www.drupal.org/project/kwresearch',
),
array(
'name' => t('W3C analyzer'),
'module' => 'w3canalyzer',
'description' => t('Validates that content is W3C compliant.'),
'recommended' => TRUE,
'link' => 'http://www.drupal.org/project/w3canalyzer',
),
);
foreach ($modules as $module) {
$status = 'status';
$msg_vars = array(
'@module_name' => $module['name'],
'!enabled_status' => '',
);
if (module_exists($module['module'])) {
$msg_vars['!enabled_status'] = t('enabled');
$link = FALSE;
if ($module['recommended']) {
$status = 'pass';
}
}
else {
$msg_vars['!enabled_status'] = t('not enabled');
$link = l(t('Click here to download.'), $module['link'], array(
'target' => '_drupalorg',
));
if ($module['recommended']) {
$status = 'warning';
}
}
$msg = t('<strong>@module_name</strong> is !enabled_status.', $msg_vars);
if ($link) {
$msg .= ' ' . $link;
}
$analysis['messages'][] = contentanalysis_format_message($msg, $status);
$analysis['messages'][] = contentanalysis_format_message($module['description'], 'status');
}
return $analysis;
}