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
'#options'=>array(t('Users cannot control whether or not they see this block.'),t('Show this block by default, but let individual users hide it.'),t('Hide this block by default but let individual users show it.'),t('Allow individual users to customize the visibility of this block in their account settings.')),
'#options'=>array(t('Show on every page except the listed pages.'),t('Show on only the listed pages.'),t('Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).')),
'#default_value'=>$edit['visibility']);
foreach($settingsas$k=>$v){
$form['block_settings'][$k]=$v;
}
}
$form['page_vis_settings']['pages']=array(
'#type'=>'textarea',
'#title'=>t('Pages'),
'#default_value'=>$edit['pages'],
'#description'=>t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '%blog' for the blog page and %blog1 for every personal blog. %front is the front page. If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.",array('%blog'=>theme('placeholder','blog'),'%blog1'=>theme('placeholder','blog/*'),'%front'=>theme('placeholder','<front>'),'%php'=>theme('placeholder','<?php ?>'))));
'#options'=>array(t('Users cannot control whether or not they see this block.'),t('Show this block by default, but let individual users hide it.'),t('Hide this block by default but let individual users show it.'),t('Allow individual users to customize the visibility of this block in their account settings.')),
'#default_value'=>$edit['custom'],
);
$form['page_vis_settings']=array(
'#type'=>'fieldset',
'#title'=>t('Page specific visibility settings'),
'#collapsible'=>true,
'#weight'=>0,
);
$form['page_vis_settings']['visibility']=array(
'#type'=>'radios',
'#title'=>t('Show block on specific pages'),
'#options'=>array(t('Show on every page except the listed pages.'),t('Show on only the listed pages.'),t('Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).')),
'#default_value'=>$edit['visibility'],
);
$form['page_vis_settings']['pages']=array(
'#type'=>'textarea',
'#title'=>t('Pages'),
'#default_value'=>$edit['pages'],
'#description'=>t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '%blog' for the blog page and %blog-wildcard for every personal blog. %front is the front page. If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.",array('%blog'=>theme('placeholder','blog'),'%blog-wildcard'=>theme('placeholder','blog/*'),'%front'=>theme('placeholder','<front>'),'%php'=>theme('placeholder','<?php ?>'))),
if(empty($form_values['info'])||db_num_rows(db_query("SELECT bid FROM {boxes} WHERE bid != %d AND info = '%s'",$form_values['delta'],$form_values['info']))){
form_set_error('info',t('Please ensure that each block description is unique.'));
db_query('DELETE FROM {boxes} WHERE bid = %d',$form_values['bid']);
drupal_set_message(t('The block %name has been removed.',array('%name'=>theme('placeholder',$form_values['info']))));
cache_clear_all();
drupal_goto('admin/block');
};
...
...
@@ -448,10 +460,6 @@ function block_box_save($edit, $delta = NULL) {
db_query("UPDATE {boxes} SET title = '%s', body = '%s', info = '%s', format = %d WHERE bid = %d",$edit['title'],$edit['body'],$edit['info'],$edit['format'],$delta);
}
else{
if(empty($edit['info'])||db_num_rows(db_query("SELECT info FROM {boxes} WHERE info = '%s'",$edit['info']))){
form_set_error('info',t('Please ensure that each block description is unique.'));
'#options'=>array(t('Users cannot control whether or not they see this block.'),t('Show this block by default, but let individual users hide it.'),t('Hide this block by default but let individual users show it.'),t('Allow individual users to customize the visibility of this block in their account settings.')),
'#options'=>array(t('Show on every page except the listed pages.'),t('Show on only the listed pages.'),t('Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).')),
'#default_value'=>$edit['visibility']);
foreach($settingsas$k=>$v){
$form['block_settings'][$k]=$v;
}
}
$form['page_vis_settings']['pages']=array(
'#type'=>'textarea',
'#title'=>t('Pages'),
'#default_value'=>$edit['pages'],
'#description'=>t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '%blog' for the blog page and %blog1 for every personal blog. %front is the front page. If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.",array('%blog'=>theme('placeholder','blog'),'%blog1'=>theme('placeholder','blog/*'),'%front'=>theme('placeholder','<front>'),'%php'=>theme('placeholder','<?php ?>'))));
'#options'=>array(t('Users cannot control whether or not they see this block.'),t('Show this block by default, but let individual users hide it.'),t('Hide this block by default but let individual users show it.'),t('Allow individual users to customize the visibility of this block in their account settings.')),
'#default_value'=>$edit['custom'],
);
$form['page_vis_settings']=array(
'#type'=>'fieldset',
'#title'=>t('Page specific visibility settings'),
'#collapsible'=>true,
'#weight'=>0,
);
$form['page_vis_settings']['visibility']=array(
'#type'=>'radios',
'#title'=>t('Show block on specific pages'),
'#options'=>array(t('Show on every page except the listed pages.'),t('Show on only the listed pages.'),t('Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).')),
'#default_value'=>$edit['visibility'],
);
$form['page_vis_settings']['pages']=array(
'#type'=>'textarea',
'#title'=>t('Pages'),
'#default_value'=>$edit['pages'],
'#description'=>t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '%blog' for the blog page and %blog-wildcard for every personal blog. %front is the front page. If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.",array('%blog'=>theme('placeholder','blog'),'%blog-wildcard'=>theme('placeholder','blog/*'),'%front'=>theme('placeholder','<front>'),'%php'=>theme('placeholder','<?php ?>'))),
if(empty($form_values['info'])||db_num_rows(db_query("SELECT bid FROM {boxes} WHERE bid != %d AND info = '%s'",$form_values['delta'],$form_values['info']))){
form_set_error('info',t('Please ensure that each block description is unique.'));
db_query('DELETE FROM {boxes} WHERE bid = %d',$form_values['bid']);
drupal_set_message(t('The block %name has been removed.',array('%name'=>theme('placeholder',$form_values['info']))));
cache_clear_all();
drupal_goto('admin/block');
};
...
...
@@ -448,10 +460,6 @@ function block_box_save($edit, $delta = NULL) {
db_query("UPDATE {boxes} SET title = '%s', body = '%s', info = '%s', format = %d WHERE bid = %d",$edit['title'],$edit['body'],$edit['info'],$edit['format'],$delta);
}
else{
if(empty($edit['info'])||db_num_rows(db_query("SELECT info FROM {boxes} WHERE info = '%s'",$edit['info']))){
form_set_error('info',t('Please ensure that each block description is unique.'));