If this in the wrong section I apologize in advance. I am in the process of creating my first module that I have a few questions about. Before I get into the questions I should give some background into it. My girlfriends son has asked me to set up a game server (World of Warcraft) along with some sort of web site for users to log into, and with having played with drupal locally I just used it. I am creating a module for what he wants to do so once it is initially created I will have nothing more to do with it. He wants it so anyone he gives access to can create and edit the "Acceptable Use Policy", "User Agreement" "Statistics" and "WOW Server Setup". I would think that acceptable use and user agreement are the same thing but if he wants both so be it. I followed a tutor on the acceptable use a while back (about 6 months ago) that will work for the acceptable use and user agreement. What I have been able to do is create a section in the admin section called "WOW Control Panel" with all the menu items mentioned above under it (Acceptable Use Policy, User Agreement, Statistics and WOW Server Setup). The first two menu items work perfectly the Statistics gives an error because I haven't even touched it, and for the WOW Server Setup I kind of have it how it is wanted (I will include the wowcontrolpanel.module and wowcontrolpanel.admin.inc at the bottom) with the exception that I want an add button at the bottom that will duplicate what I created without the logon database textfield, and if someone has added then a remove button will be there as well. The other problem I am having is that when you click on the navigation menu for WOW Control Panel it os not showing the desired information. I am expecting to show the top of the page title as WOW Control Panel and links below it for everything that shows on the admin page with a brief description (currently only have the one in there so it can be tested but it not showing up). If any one could shed some light on this or what exactly I would need to search on so I could find the answer through reading it would be greatly appreciated.
wowcontrolpanel.info
; $Id: wowcontrolpanel.info $
name = WOW Control Panel
description = Custom modules created for WOW gaming, user registration on site web site and game server, statistics and other related modules.
package = WOW Control Panel
version = VERSION
core = 6.x
wowcontrolpanel.module
<?php
function wowcontrolpanel_menu() {
$items['admin/wowcp'] = array(
'title' => 'WOW Control Panel',
'description' => 'Manage your WOW gaming options',
'page callback' => 'drupal_get_form',
'page arguments' => array('wowcontrolpanel_admin_settings'),
'access arguments' => array('WOW Control Panel Menu'),
'file' => 'wowcontrolpanel.admin.inc',
);
$items['admin/wowcp/aup'] = array(
'title' => 'Acceptable Use Policy',
'description' => 'This is the acceptable use policy as set up by the site administrators',
'page callback' => 'drupal_get_form',
'page arguments' => array('wowcontrolpanel_aup_settings'),
'access arguments' => array('administer site acceptable use policy'),
'file' => 'wowcontrolpanel.admin.inc',
);
$items['admin/wowcp/stats'] = array(
'title' => 'Statistics',
'description' => 'This is the statistics as set up by the site administrators',
'page callback' => 'drupal_get_form',
'page arguments' => array('wowcontrolpanel_stats'),
'access arguments' => array('administer site statistics'),
'file' => 'wowcontrolpanel.admin.inc',
);
$items['admin/wowcp/ua'] = array(
'title' => 'User Agrement',
'description' => 'This is the user agrement as set up by the site administrators.',
'page callback' => 'drupal_get_form',
'page arguments' => array('wowcontrolpanel_ua_settings'),
'access arguments' => array('administer site user agrement'),
'file' => 'wowcontrolpanel.admin.inc',
);
$items['admin/wowcp/server-setup'] = array(
'title' => 'WOW Server Setup',
'description' => 'This sets up the databases and so on for the WOW server.',
'page callback' => 'drupal_get_form',
'page arguments' => array('wowcontrolpanel_serversetup_settings'),
'access arguments' => array('administer site serversetup'),
'file' => 'wowcontrolpanel.admin.inc',
);
return $items;
}
wowcontrolpanel.admin.inc
<?php
function wowcontrolpanel_admin_settings() {
$items['admin/wowcp'] = array(
'title' => 'WOW Control Panel',
//'description' => 'Manage your WOW gaming options',
'page callback' => 'drupal_get_form',
'page arguments' => array('wowcontrolpanel_admin_settings'),
'access arguments' => array('WOW Control Panel Menu'),
);
$items['admin/wowcp/aup'] = array(
'title' => 'Acceptable Use Policy',
'page callback' => 'drupal_get_form',
'page arguments' => array('wowcontrolpanel_aup_settings'),
'access arguments' => array('administer acceptable use policy'),
);
}
function wowcontrolpanel_aup_settings() {
$form['wowcontrolpanel_aup'] = array(
'#type' => 'textarea',
'#title' => t('Acceptable Use Policy'),
'#default_value' => variable_get('wowcontrolpanel_aup', t('Enter your Acceptable Use Policy here.')),
'#description' => t('This text will be displayed on the user registration form.'),
'#cols' => 60,
'#rows' => 5,
);
return system_settings_form($form);
}
function wowcontrolpanel_serversetup_settings() {
$form['wowcontrolpanel_serversetup']['server_core'] = array(
'#type' => 'fieldset',
'#title' => t('Server Core Selection'),
'#collapsible' => FALSE,
'#collapsed' => FALSE,
);
$form['wowcontrolpanel_serversetup']['server_core']['decision'] = array(
'#type' => 'select',
'#title' => 'Select the Server Core that your WOW runs on',
'#options' => array('SELECT', 'ArcEMU', 'Aspire', 'Mangos', 'Trinity Core2'),
'#default_value' => SELECT,
);
$form['wowcontrolpanel_serversetup']['server_db'] = array(
'#type' => 'fieldset',
'#title' => t('Server Database Setup'),
'#collapsible' => FALSE,
'#collapsed' => FALSE,
);
$form['wowcontrolpanel_serversetup']['server_db']['logondatabase'] = array(
'#type' => 'textfield',
'#title' => t('The name of the LOGON database?'),
'#size' => 50,
);
$form['wowcontrolpanel_serversetup']['server_db']['characterdatabase'] = array(
'#type' => 'textfield',
'#title' => t('The name of the CHARACTER database?'),
'#size' => 50,
);
$form['wowcontrolpanel_serversetup']['server_db']['worlddatabase'] = array(
'#type' => 'textfield',
'#title' => t('The name of the WORLD database?'),
'#size' => 50,
);
$form['wowcontrolpanel_serversetup']['server_db']['databaseusername'] = array(
'#type' => 'textfield',
'#title' => t('The username for the databases?'),
'#size' => 50,
);
$form['wowcontrolpanel_serversetup']['server_db']['databasepassword'] = array(
'#type' => 'textfield',
'#title' => t('The password for the databases?'),
'#size' => 50,
);
return system_settings_form($form);
}
function wowcontrolpanel_ua_settings() {
$form['wowcontrolpanel_ua'] = array(
'#type' => 'textarea',
'#title' => t('User Agrement'),
'#default_value' => variable_get('wowcontrolpanel_ua', t('Enter your User Agrement here.')),
'#description' => t('This text will be displayed on the user registration form.'),
'#cols' => 60,
'#rows' => 5,
);
return system_settings_form($form);
}
?>