diff --git a/sites/all/modules/contentanalysis/contentanalysis.module b/sites/all/modules/contentanalysis/contentanalysis.module index 621d229..037cc0e 100644 --- a/sites/all/modules/contentanalysis/contentanalysis.module +++ b/sites/all/modules/contentanalysis/contentanalysis.module @@ -962,25 +959,18 @@ function contentanalysis_get_analyzer_settings($analyzer_name) { } /** - * Provides analysis on context passed in. - * + * Provides analysis on context passed in + * * - Normalizes the context - * - Passes context to analyzer modules' "callback" - * declaired in analyzer definition - * - * @param array $context - * Array of context. - * @param array $analyzers - * Array of analyzers. - * @param array $analyzers_params - * Array of anaylzer parameters. - * - * @return array - * Return array of analysis. + * - Passes context to analyzer modules' "callback" declaired in analyzer definition + * + * @param unknown_type $context + * @param unknown_type $analyzers + * @param unknown_type $analyzers_params */ function contentanalysis_do_analysis($context, $analyzers = NULL, $analyzers_params = array()) { - $analysis = array(); - $analysis_struc = array( + $analysis = array(); + $analysis_struc = array( '#title' => '', '#status' => 'status', 'content' => array(), @@ -990,9 +980,29 @@ function contentanalysis_do_analysis($context, $analyzers = NULL, $analyzers_par 'page_title' => array('#title' => t('Page title'), '#status' => 'status'), 'body' => array('#title' => t('Body'), '#status' => 'status'), 'meta_keywords' => array('#title' => t('Meta keywords'), '#status' => 'status'), - 'meta_description' => array('#title' => t('Meta description'), '#status' => 'status'), + 'meta_description' => array('#title' => t('Meta description'), '#status' => 'status'), ); - // Change structure if content is directly inputed without a full page. + // change structure if content is directly inputed without a full page + + + // check if this node should be ignored + $nid = $context['inputs']['nid'] ; + if(empty($nid)) $nid = $context['inputs']['nid'] ; + + if(!empty($nid)) { + $arrIgnore = variable_get('contentanalysis_ignore_types', array()) ; + if(!empty($arrIgnore)) { + $node = node_load($nid); + foreach($arrIgnore as $ctIgnore) { + if($node -> type== $ctIgnore) { + $analysis = $analysis_struc; + $analysis['messages'] = contentanalysis_format_message("Sorry but this content type has been set as 'ignored' for contentanalysis"); + return $analysis; + } + } + } + + } if ($context['source'] == 'admin') { if (!$context['inputs']['nid'] && !$context['inputs']['body'] && !$context['inputs']['url']) { $analysis = $analysis_struc;