This CodeLet will allow you to set some text in a region you specify from configuration page. The regions are from the current theme. The desired content will be displayed in the region when the page is rendered.
')),
'#default_value' => variable_get('global_text', ''),
'#weight' => -50,
);
return system_settings_form($form);
}
/**
* seo_util_config
*
* Select the vocabulary for which text to be added
*
* DrupalD
*/
function seo_util_config() {
$am__vocabulary = taxonomy_vocabulary_get_names();
$am__vocab = array();
$am__vocab[0] = t('-- Select --');
foreach ($am__vocabulary as $vocabulary => $ob) {
$am__vocab[$ob->vid] = $ob->name;
}
$form['seo_util_province_vocabulary'] = array(
'#type' => 'select',
'#title' => t('Province Vocabulary'),
'#description' => t('Select a vocabulary which provides a list of
provice & cities'),
'#options' => $am__vocab,
'#required' => TRUE,
'#default_value' => variable_get('seo_util_province_vocabulary',00),
'#weight' => -10,
);
$form['seo_util_course_vocabulary'] = array(
'#type' => 'select',
'#title' => t('Course Vocabulary'),
'#description' => t('Select a vocabulary which provides a list of courses'),
'#options' => $am__vocab,
'#required' => TRUE,
'#default_value' => variable_get('seo_util_course_vocabulary',00),
'#weight' => -9,
);
$form['seo_util_theme_regions'] = array(
'#type' => 'select',
'#title' => t('Theme regions'),
'#description' => t('Select the region where you want to display the
text for each of the pages/path') .'
'.
t('The regions are listed from your default theme. Your default
theme is @theme.', array('@theme' => variable_get('theme_default', ''))),
'#options' => system_region_list(variable_get('theme_default', '')),
'#required' => TRUE,
'#default_value' => variable_get('seo_util_theme_regions', ''),
);
return system_settings_form($form);
}
/**
* Implementation of hook_page_build
*
* @param $page
* DrupalD
*/
function seo_util_page_build(&$page) {
$ss__global_text = variable_get('global_text', '');
$ss__region = variable_get('seo_util_theme_regions', '');
$page[$ss__region]['text']['#markup'] = php_eval($ss__global_text);
}
/** '; $output .= '
'; '; '; '; '; /** return $names[0]->name;
* _get_config_summary
*
* DrupalD
*/
function _get_config_summary() {
$output = '
'. t('Configuration summary') .'
';
$output .= '
.': '. _get_vocabulary(variable_get('seo_util_province_vocabulary', '--')) .'
$output .= '
.': '. _get_vocabulary(variable_get('seo_util_course_vocabulary', '--')) .'
$output .= '
variable_get('seo_util_theme_regions', '--') .'
$output .= '
variable_get('theme_default', '--') .'
$output .= '
$output .= t('You can change above configuration from !config page',
array('!config' => l(t('Settings'), 'admin/config/development/seo-util/config')));
return $output;
}
* _get_vocabulary
*
* Enter description here ...
* @param unknown_type $sn__vid
* DrupalD
*/
function _get_vocabulary($sn__vid) {
$names = db_query('SELECT name FROM {taxonomy_vocabulary} WHERE vid = :vid',
array(':vid' => $sn__vid))->fetchAllAssoc('name');
$names = array_values($names);
}
?>
name = SEO Custom utility
description = SEO custom Utility module.
core = 7.x