2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
* Configuration system that lets administrators modify the workings of the site.
*/
define('VERSION','4.8.0 dev');
/**
* Implementation of hook_help().
*/
functionsystem_help($section){
global$base_url;
switch($section){
case'admin/help#system':
$output='<p>'.t('The system module provides system-wide defaults such as running jobs at a particular time, and storing web pages to improve efficiency. The ability to run scheduled jobs makes administering the web site more usable, as administrators do not have to manually start jobs. The storing of web pages, or caching, allows the site to efficiently re-use web pages and improve web site performance. The settings module provides control over preferences, behaviours including visual and operational settings.').'</p>';
$output.='<p>'.t('Some modules require regularly scheduled actions, such as cleaning up logfiles. Cron, which stands for chronograph, is a periodic command scheduler executing 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 measured in seconds). The aggregator module periodically updates feeds using cron. Ping periodically notifies services of new content on your site. Search periodically indexes the content on your site. 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.').'</p>';
$output.='<p>'.t('There is a caching mechanism which stores dynamically generated web pages in a database. By caching a web page, the system module does not have to create the page each time someone wants to view it, instead it takes only one SQL query to display it, reducing response time and the server\'s load. Only pages requested by <em>anonymous</em> users are cached. In order to reduce server load and save bandwidth, the system module stores and sends cached pages compressed.').'</p>';
$output.=t('<p>You can</p>
<ul>
<li>activate your cron job on the cron page <a href="%file-cron">cron.php</a>.</li>
<li>read how to <a href="%external-http-drupal-org-cron">configure cron jobs</a>.</li>
<li>administer cache settings in <a href="%admin-settings">administer >> settings >> caching</a>.</li>
$output.='<p>'.t('For more information please read the configuration and customization handbook <a href="%system">System page</a>.',array('%system'=>'http://drupal.org/handbook/modules/system/')).'</p>';
return$output;
case'admin/modules#description':
returnt('Handles general site configuration for administrators.');
case'admin':
returnt('<p>Welcome to the administration section. Below are the most recent system events.</p>');
case'admin/themes':
returnt('<p>Select which themes are available to your users and specify the default theme. To configure site-wide display settings, click the "configure" task above. Alternately, to override these settings in a specific theme, click the "configure" link for the corresponding theme. Note that different themes may have different regions available for rendering content like blocks. If you want consistency in what your users see, you may wish to enable only one theme.</p>');
case'admin/themes/settings':
returnt('<p>These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.</p>');
case'admin/themes/settings/'.arg(3):
$reference=explode('.',arg(3),2);
$theme=array_pop($reference);
returnt('<p>These options control the display settings for the <code>%template</code> theme. When your site is displayed using this theme, these settings will be used. By clicking "Reset to defaults," you can choose to use the <a href="%global">global settings</a> for this theme.</p>',array('%template'=>$theme,'%global'=>url('admin/themes/settings')));
case'admin/modules':
returnt('<p>Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. Click on the name of the module in the navigation menu for their individual configuration pages. Once a module is enabled, new <a href="%permissions">permissions</a> might be made available. Modules can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by enabling the throttle.module and checking throttle. The auto-throttle functionality must be enabled on the <a href="%throttle">throttle configuration page</a> after having enabled the throttle module.</p>
<p>It is important that <a href="%update-php">update.php</a> is run every time a module is updated to a newer version.</p>',array('%permissions'=>url('admin/access/permissions'),'%throttle'=>url('admin/settings/throttle'),'%update-php'=>$base_url.'/update.php'));
}
}
/**
* Implementation of hook_perm().
*/
functionsystem_perm(){
returnarray('administer site configuration','access administration pages','select different theme');
$screenshot=file_exists($info->screenshot)?theme('image',$info->screenshot,t('Screenshot for %theme theme',array('%theme'=>$info->name)),'',array('class'=>'screenshot'),FALSE):t('no screenshot');
'#description'=>t('The home page displays content from this relative URL. If you are not using clean URLs, specify the part after "?q=". If unsure, specify "node".')
// We check for clean URL support using an image on the client side.
$form['clean_url']=array(
'#type'=>'radios',
'#title'=>t('Clean URLs'),
'#default_value'=>variable_get('clean_url',0),
'#options'=>array(t('Disabled'),t('Enabled')),
'#description'=>t('This option makes Drupal emit "clean" URLs (i.e. without <code>?q=</code> in the URL.)'),
);
if(!variable_get('clean_url',0)){
if(strpos(request_uri(),'?q=')!==FALSE){
$form['clean_url']['#description'].=t(' Before enabling clean URLs, you must perform a test to determine if your server is properly configured. If you are able to see this page again after clicking the "Run the clean URL test" link, the test has succeeded and the radio buttons above will be available. If instead you are directed to a "Page not found" error, you will need to change the configuration of your server. The <a href="%handbook">handbook page on Clean URLs</a> has additional troubleshooting information. %run-test',array('%handbook'=>'http://drupal.org/node/15365','%run-test'=>'<a href ="'.base_path().'admin/settings/clean-urls">'.t('Run the clean URL test').'</a>'));
$form['clean_url']['#description'].=t(' You have successfully demonstrated that clean URLs work on your server. You are welcome to enable/disable them as you wish.');
'#description'=>t('This page is displayed when the requested document is denied to the current user. If you are not using clean URLs, specify the part after "?q=". If unsure, specify nothing.')
);
$form['site_404']=array(
'#type'=>'textfield',
'#title'=>t('Default 404 (not found) page'),
'#default_value'=>variable_get('site_404',''),
'#description'=>t('This page is displayed when no other content matches the requested document. If you are not using clean URLs, specify the part after "?q=". If unsure, specify nothing.')
'#options'=>array(t('Write errors to the log'),t('Write errors to the log and to the screen')),
'#description'=>t('Where Drupal, PHP and SQL errors are logged. On a production server it is recommended that errors are only written to the error log. On a test server it can be helpful to write logs to the screen.')
'#description'=>t("Drupal has a caching mechanism which stores dynamically generated web pages in a database. By caching a web page, Drupal does not have to create the page each time someone wants to view it, instead it takes only one SQL query to display it, reducing response time and the server's load. Only pages requested by \"anonymous\" users are cached. In order to reduce server load and save bandwidth, Drupal stores and sends compressed cached pages.")
'#description'=>t('Enabling the cache will offer a sufficient performance boost for most low-traffic and medium-traffic sites. On high-traffic sites it can become necessary to enforce a minimum cache lifetime. The minimum cache lifetime is the minimum amount of time that will go by before the cache is emptied and recreated. A larger minimum cache lifetime offers better performance, but users will not see new content for a longer period of time.')
'#description'=>t('A file system path where the files will be stored. This directory has to exist and be writable by Drupal. If the download method is set to public this directory has to be relative to Drupal installation directory, and be accessible over the web. When download method is set to private this directory should not be accessible over the web. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.'),
'#after_build'=>array('system_check_directory'),
);
$form['file_directory_temp']=array(
'#type'=>'textfield',
'#title'=>t('Temporary directory'),
'#default_value'=>file_directory_temp(),
'#maxlength'=>255,
'#description'=>t('Location where uploaded files will be kept during previews. Relative paths will be resolved relative to the Drupal installation directory.'),
'#options'=>array(FILE_DOWNLOADS_PUBLIC=>t('Public - files are available using http directly.'),FILE_DOWNLOADS_PRIVATE=>t('Private - files are transferred by Drupal.')),
'#description'=>t('If you want any sort of access control on the downloading of files, this needs to be set to <em>private</em>. You can change this at any time, however all download URLs will change and there may be unexpected problems so it is not recommended.')
'#description'=>t('Enable or disable user-configurable time zones. When enabled, users can set their own time zone and dates will be updated accordingly.')
'#description'=>t('When set to "Online", all visitors will be able to browse your site normally. When set to "Off-line", only users with the "administer site configuration" permission will be able to access your site to perform maintenance; all other visitors will see the site off-line message configured below. Authorized users can log in during "Off-line" mode directly via the <a href="%user-login">user login</a> page.',array('%user-login'=>url('user'))),
);
$form['site_offline_message']=array(
'#type'=>'textarea',
'#title'=>t('Site off-line message'),
'#default_value'=>variable_get('site_offline_message',t('%site is currently under maintenance. We should be back shortly. Thank you for your patience.',array('%site'=>variable_get('site_name',t('This Drupal site'))))),
'#description'=>t('Message to show visitors when the site is in off-line mode.')
$status=t('Cron is running. The last cron job ran %time ago.',array('%time'=>format_interval(time()-$cron_last)));
}
else{
$status=t('Cron has not run. It appears cron jobs have not been setup on your system. Please check the help pages for <a href="%url">configuring cron jobs</a>.',array('%url'=>'http://drupal.org/cron'));
}
return$status;
}
/**
* Checks the existence of the directory specified in $form_element. This
* function is called from the system_settings form to check both the
* file_directory_path and file_directory_temp directories. If validation
* fails, the form element is flagged with an error from within the
* file_check_directory function.
*
* @param $form_element
* The form element containing the name of the directory to check.
$screenshot=file_exists($info->screenshot)?theme('image',$info->screenshot,t('Screenshot for %theme theme',array('%theme'=>$info->name)),'',array('class'=>'screenshot'),FALSE):t('no screenshot');
$form['favicon']['text']=array('#value'=>t('Your shortcut icon or \'favicon\' is displayed in the address bar and bookmarks of most browsers.'));
$form['favicon']['default_favicon']=array(
'#type'=>'checkbox',
'#title'=>t('Use the default shortcut icon.'),
'#default_value'=>$settings['default_favicon'],
'#description'=>t('Check here if you want the theme to use the default shortcut icon.')
);
$form['favicon']['favicon_path']=array(
'#type'=>'textfield',
'#title'=>t('Path to custom icon'),
'#default_value'=>$settings['favicon_path'],
'#description'=>t('The path to the image file you would like to use as your custom shortcut icon.')
);
$form['favicon']['favicon_upload']=array(
'#type'=>'file',
'#title'=>t('Upload icon image'),
'#description'=>t("If you don't have direct file access to the server, use this field to upload your shortcut icon.")
);
}
if($key){
// Template-specific settings
$function=$themes[$key]->prefix.'_settings';
if(function_exists($function)){
if($themes[$key]->template){
// file is a template or a style of a template
$form['specific']=array('#type'=>'fieldset','#title'=>t('Engine-specific settings'),'#description'=>t('These settings only exist for all the templates and styles based on the %engine theme engine.',array('%engine'=>$themes[$key]->prefix)));
}
else{
// file is a theme or a style of a theme
$form['specific']=array('#type'=>'fieldset','#title'=>t('Theme-specific settings'),'#description'=>t('These settings only exist for the %theme theme and all the styles based on it.',array('%theme'=>$themes[$key]->prefix)));