Drupal comes with system-wide defaults but the setting-module provides control over many Drupal preferences, behaviors including visual and operational settings.
";
$output .= "
Cache
". system_help_cache();
$output .= "
Cron
". system_help_cron();
return $output;
}
function system_system($field){
$system["description"] = t("Configuration system that lets site admins modify the workings of the site.");
return $system[$field];
}
function system_help_cache() {
$output .= "
Drupal has a caching mechanism that stores dynamically generated pages in a database. By caching a page, Drupal does not have to generate the page each time it is requested. Only pages requested by anonymous users are being cached. When a cached page is accessed, Drupal will retrieve that page with minimal overhead using one SQL query only, thus reducing both the server load and the response time.
";
$output .= "
Drupal's caching mechanism can be enabled and disabled by the site administrators from the 'settings' page. Site administrators can also define how long cached pages should be kept.
";
return $output;
}
function system_help_cron() {
$output .= "
Some settings require a cron or crontab. Cron, which stands for chronograph, is a periodic command scheduler: it executes commands at intervals specified in seconds. It can be used to control the execution of daily, weekly and monthly jobs (or anything with a period of n seconds). Automating tasks is one of the best ways to keep a system running smoothly, and if most of your administration does not require your direct involvement, cron is an ideal solution.
";
$output .= "
Whenever ". path_uri() ."cron.php is accessed, cron will run: it checks for the jobs cron controls, and their periods in seconds. If a certain task wasn't executed in the last n seconds, where n is the period of that job, it will be executed. When all the executed commands terminate, cron is done.
";
$output .= "
The recommended way to setup your cron system is to setup a Unix/Linux crontab that frequently visits ". path_uri() ."cron.php. Note that cron does not guarantee the commands will be executed at the specified interval. However, Drupal will try his best and run the crons as close to the specified intervals as possible. The more you visit cron.php, the more accurate cron will be.
";
$output .= "
If your hosting company does not allow you to setup crontabs, you can always ask someone else to setup a crontab for you. After all, virtually any Unix/Linux machine with access to the internet can setup a crontab to frequently visit ". path_uri() ."cron.php.
";
$output .= "
For the Unix/Linux crontab itself, use a browser like lynx or wget but make sure the process terminates: either use /usr/bin/lynx -source cron.php or /usr/bin/wget -O /dev/null cron.php. Take a look at the example scripts in the scripts-directory and make sure to adjust them to your needs. A good crontab-line to run the cron-script once every hour would be:
00 * * * * /home/www/drupal/scripts/cron-lynx
";
return $output;
}
function system_perm() {
return array("administer site configuration", "access administration pages", "create php content");
}
function system_link($type) {
if ($type == "admin" && user_access("administer site configuration")) {
$links[] = la(t("site configuration"), array("mod" => "system"));
}
return $links ? $links : array();
}
function system_view_options() {
global $conf, $cmodes, $corder;
// general settings:
$output .= "
" . t("General settings") . "
\n";
$output .= form_textfield(t("Name"), "site_name", variable_get("site_name", "drupal"), 55, 55, t("The name of this website."));
$output .= form_textfield(t("E-mail address"), "site_mail", variable_get("site_mail", ini_get("sendmail_from")), 55, 128, t("A valid e-mail address for this website, used by the auto-mailer during registration, new password requests, notifications, etc."));
$output .= form_textfield(t("Slogan"), "site_slogan", variable_get("site_slogan", ""), 55, 128, t("The slogan of this website. Some themes display a slogan when available."));
$output .= form_textarea(t("Mission"), "site_mission", variable_get("site_mission", ""), 55, 5, t("Your site's mission statement or focus."));
$output .= form_textarea(t("Footer message"), "site_footer", variable_get("site_footer", ""), 55, 5, t("This text will be displayed at the bottom of each page. Useful for adding a copyright notice to your pages."));
$output .= form_textfield(t("Anonymous user"), "anonymous", variable_get("anonymous", "Anonymous"), 55, 55, t("The name used to indicate anonymous users."));
foreach (module_list() as $name) { if (module_hook($name, "page")) $pages[$name] = $name; }
$output .= form_select(t("Default front page"), "site_frontpage", variable_get("site_frontpage", "node"), $pages, t("The home page displays content from this module (usually node)."));
$output .= "\n";
// caching:
$output .= "
\n";
foreach (theme_list() as $key => $value) $options .= "\n";
$output .= form_item(t("Default theme"), "", t("The default theme as seen by visitors or anonymous users."));
$output .= "\n";
// development settings:
$output .= "
" . t("Development settings") . "
\n";
$output .= form_select(t("Display timer information"), "dev_timer", variable_get("dev_timer", 0), array(t("Disabled"), t("Enabled")), t("Display the time it took to generate a page. For Drupal development only."));
$output .= form_select(t("Display query log"), "dev_query", variable_get("dev_query", 0), array(t("Disabled"), t("Enabled")), t("Display a log of the database queries needed to generate the current page."));
$output .= "\n";
foreach (module_list() as $name) {
if (module_hook($name, "conf_options")) {
$output .= "