panopoly_news.module in Panopoly News 7
File
panopoly_news.module
View source
<?php
include_once 'panopoly_news.features.inc';
function panopoly_news_apps_app_info() {
return array(
'demo content description' => 'If you are using Panopoly News for the first time we recommend you install some demo content to see how the magic works.<br/><br/>',
'demo content module' => 'panopoly_news_demo',
'demo content link path' => 'news',
'configure form' => 'panopoly_news_configure_form',
);
}
function panopoly_news_configure_form($form, &$form_state) {
$form = array();
$form['panopoly_news_config_group'] = array(
'#type' => 'fieldset',
'#title' => "Configuration Options for Panopoly News",
);
$form['panopoly_news_config_group']['panopoly_news_test'] = array(
'#title' => t('Trivia'),
'#type' => 'select',
'#required' => TRUE,
'#options' => array(
'1' => 'Mark Antony',
'0' => 'Mark Anthony',
),
'#default_value' => variable_get('panopoly_news_test', FALSE) ? '1' : '0',
'#description' => t('Which Mark is superior?'),
);
return system_settings_form($form);
}
function panopoly_news_ctools_plugin_directory($module, $plugin) {
return 'plugins/' . $plugin;
}
function panopoly_news_views_pre_view(&$view, &$display_id, &$args) {
if ($view->name == 'panopoly_news' && $display_id == 'panopoly_news_feed') {
$sitename = variable_get('site_name');
$view->display_handler->options['title'] = str_replace('!sitename', $sitename, $view->display_handler->options['title']);
$view->display_handler->options['style_options']['description'] = str_replace('!sitename', $sitename, $view->display_handler->options['style_options']['description']);
}
}