array(
'title' => t('PHP Memory Limit'),
'severity' => GALLERY_SEVERITY_ERROR,
'status' => FALSE
),
'locations' => array(
'title' => t('Gallery2 locations'),
'severity' => GALLERY_SEVERITY_ERROR,
'status' => FALSE
),
'plugins' => array(
'title' => t('Drupal Modules / Gallery2 Plugins'),
'severity' => GALLERY_SEVERITY_WARNING,
'status' => FALSE
),
'urlrewrite' => array(
'title' => t('Clean URL / URL Rewrite'),
'severity' => GALLERY_SEVERITY_WARNING,
'status' => FALSE
),
'usersync' => array(
'title' => t('Initial User Synchronization'),
'severity' => GALLERY_SEVERITY_ERROR,
'status' => FALSE
),
);
}
/**
* Function _gallery_install_status_report().
*/
function _gallery_install_status_report($install_status) {
// Install status table
$error = FALSE;
$rows = array();
foreach ($install_status as $step => $status) {
// Find the combination of status and severity of the plugin
$severity = ($status['status'] <= 0) ? $status['severity'] : GALLERY_SEVERITY_SUCCESS;
if (!$status['status'] && $severity == GALLERY_SEVERITY_ERROR) {
$error = TRUE;
}
$row = array();
$row[] = array('data' => $status['title'], 'align' => 'left', 'width' => '20%');
$row[] = array('data' => theme('gallery_severity_message', $severity), 'align' => 'center');
$row[] = array('data' => isset($status['info'])? $status['info'] : '', 'class' => 'description', 'id' => 'gallery-install-status-'. $step);
$rows[] = $row;
}
if ($error) {
$rows[] = array(array(
'data' => t('Critical errors are present.'),
'colspan' => '3',
'align' => 'center',
'class' => 'message')
);
}
// Set the global status variable 'gallery_valid'
gallery_set_status(array(
'gallery_valid' => array(
'title' => t('Overall Status (Installation)'),
'severity' => $error ? GALLERY_SEVERITY_ERROR : GALLERY_SEVERITY_SUCCESS
)
));
return theme('table', array(t('Step'), t('Status'), t('Description')), $rows, array('class' => 'package'));
}
/**
* Function _gallery_install_status().
*/
function _gallery_install_status($form_state) {
$form['install'] = array(
'#type' => 'fieldset',
'#title' => t('Install status'),
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#description' => t('Correct configuration of the following items is essential for the
embedded gallery to function properly.')
);
$install_status = _gallery_install_status_init();
// Step 1: Check PHP Memory
$phpmemory_info = _gallery_php_memcheck();
$install_status['phpmemory']['status'] = $phpmemory_info['status'];
$install_status['phpmemory']['info'] = $phpmemory_info['info'];
// Step 2: Gallery2 Locations
$values['gallery_uri'] = variable_get('gallery_uri', '/gallery2/');
$values['gallery_dir'] = variable_get('gallery_dir', './gallery2/');
$values['gallery_embed_uri'] = variable_get('gallery_embed_uri', '?q=gallery');
$values['gallery_base'] = variable_get('gallery_base', 'gallery');
$autodetect = variable_get('gallery_autodetect_dir', 1);
// Check location settings and generate status report
list($install_status['locations']['status'], $values, $result) = _gallery_install_locations($values, $autodetect);
$install_status['locations']['info'] = $install_status['locations']['status'] ?
t('The Gallery2 location settings appear to be correct.') :
gallery_format_status($result, t('Errors in your current Gallery2 location settings:'));
$form['locations'] = array(
'#type' => 'fieldset',
'#title' => t('Gallery2 location settings') .' - '. ($autodetect ? t('Auto Configuration') : t('Manual Configuration')),
'#collapsible' => TRUE,
'#collapsed' => $install_status['locations']['status'],
'#description' => t('Overview of your Gallery2 location settings as specified or autodetected during install.')
);
$form['locations']['gallery_uri'] = array(
'#title' => t('Gallery2 URL or URI'),
'#type' => 'item',
'#value' => $values['gallery_uri']
);
if (!empty($values['gallery_dir'])) {
$form['locations']['gallery_dir'] = array(
'#title' => t('Gallery2 filesystem path'),
'#type' => 'item',
'#value' => $values['gallery_dir']
);
}
$form['locations']['gallery_embed_uri'] = array(
'#title' => t('Embed URI'),
'#type' => 'item',
'#value' => $values['gallery_embed_uri']
);
$form['locations']['gallery_base'] = array(
'#title' => t('Gallery base'),
'#type' => 'item',
'#value' => $values['gallery_base']
);
// Step 3: Drupal Modules and Gallery2 Plugins check
$form += _gallery_install_plugins($install_status);
// Step 4: Clean URL configuration
_gallery_install_urlrewrite_check($install_status);
if (gallery_single_plugin_status('rewrite') == GALLERY_PLUGIN_ENABLED) {
if (_gallery_install_urlrewrite($public_path, $htaccess_path, TRUE)) {
$form['urlrewrite'] = array(
'#type' => 'fieldset',
'#title' => t('Clean URLs / URL Rewrite settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#description' => t('Overview of your URL Rewrite settings as specified during install.')
);
$form['urlrewrite']['htaccess_public_path'] = array(
'#title' => t('Public path to your .htaccess file'),
'#type' => 'item',
'#value' => $public_path
);
$form['urlrewrite']['htaccess_filesystem_path'] = array(
'#title' => t('Filesystem path to your .htaccess file'),
'#type' => 'item',
'#value' => $htaccess_path
);
}
}
// Step 5: User Synchronization
$install_status['usersync']['status'] = TRUE;
$install_status['usersync']['info'] = t('Your initial user synchronization has been completed already.
If you
want to resync all your users or you want to import users from an existing
Gallery2 setup, you can always use the Advanced
Sync options in the Gallery user administration.',
array('@gallery-usersync' => url('admin/user/gallery/advanced')));
$form['install']['status'] = array(
'#value' => _gallery_install_status_report($install_status)
);
$form['buttons']['reset'] = array(
'#type' => 'submit',
'#value' => t('Reset & Restart'),
'#submit' => array('_gallery_install_reset')
);
return $form;
}
/**
* Function _gallery_install().
*/
function _gallery_install($form_state) {
$form['install'] = array(
'#type' => 'fieldset',
'#title' => t('Install status'),
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#description' => t(''),
);
if (!isset($form_state['storage'])) {
$install_status = _gallery_install_status_init();
$install_status['step'] = GALLERY_INSTALL_STEP_PHPMEMORY;
// Check for advanced_help module
if (!module_exists('advanced_help')) {
drupal_set_message(t('If you install the advanced help module, Gallery module will provide more
and better help.', array('@url' => 'http://drupal.org/project/advanced_help')));
}
else {
$install_help = theme('advanced_help_topic', 'gallery', 'install', t('Install Tutorial'));
drupal_set_message(t('Dont know where to start? Try the "!install-help" page.', array('!install-help' => $install_help)));
}
}
else {
$install_status = $form_state['storage'];
}
// Step 1: Check PHP Memory
_gallery_install_step_phpmemory($form, $form_state, $install_status);
// Step 2 : Gallery2 Locations
if ($install_status['step'] >= GALLERY_INSTALL_STEP_LOCATIONS) {
_gallery_install_step_locations($form, $form_state, $install_status);
}
// Step 3: Drupal Modules and Gallery2 Plugins check
if ($install_status['step'] >= GALLERY_INSTALL_STEP_PLUGINS) {
_gallery_install_step_plugins($form, $form_state, $install_status);
}
// Step 4: Clean URL configuration
if ($install_status['step'] >= GALLERY_INSTALL_STEP_URLREWRITE) {
_gallery_install_step_urlrewrite($form, $form_state, $install_status);
}
// Step 5: User Synchronization
if ($install_status['step'] >= GALLERY_INSTALL_STEP_USERSYNC) {
_gallery_install_step_usersync($form, $form_state, $install_status);
}
$form['install']['status'] = array(
'#value' => _gallery_install_status_report($install_status)
);
$form['install_status'] = array(
'#type' => 'value',
'#value' => $install_status
);
$form['buttons']['reset'] = array(
'#type' => 'submit',
'#value' => t('Reset & Restart'),
'#submit' => array('_gallery_install_reset')
);
return $form;
}
/**
* Function _gallery_install_reset().
*/
function _gallery_install_reset($form, &$form_state) {
variable_del('gallery_autodetect_dir');
variable_del('gallery_uri');
variable_del('gallery_dir');
variable_del('gallery_embed_uri');
variable_del('gallery_valid');
variable_del('gallery_rewrite_disable');
menu_rebuild();
unset($form_state['storage']);
$form_state['redirect'] = 'admin/settings/gallery/install';
}
/**
* Function _gallery_install_step_phpmemory().
* Step 1: Check PHP Memory
*/
function _gallery_install_step_phpmemory(&$form, &$form_state, &$install_status) {
if ($install_status['step'] == GALLERY_INSTALL_STEP_PHPMEMORY) {
$phpmemory_info = _gallery_php_memcheck();
$install_status['phpmemory']['status'] = $phpmemory_info['status'];
$install_status['phpmemory']['info'] = $phpmemory_info['info'];
if ($phpmemory_info['status']) {
$install_status['step'] = GALLERY_INSTALL_STEP_LOCATIONS;
}
}
$form['phpmemory'] = array(
'#type' => 'fieldset',
'#title' => t('Step 1: PHP Memory Test') . ($install_status['phpmemory']['status'] ? ' '. t('(OK)') : ''),
'#description' => $install_status['phpmemory']['info'],
'#collapsible' => ($install_status['step'] > GALLERY_INSTALL_STEP_PHPMEMORY),
'#collapsed' => $install_status['phpmemory']['status'],
);
if (!$install_status['phpmemory']['status']) {
$form['phpmemory']['#description'] .= ' '. t('Until this is fixed your Gallery2 cannot be installed.');
$form['phpmemory']['check'] = array('#type' => 'submit', '#value' => t('Check PHP memory again'));
}
}
/**
* Function _gallery_install_step_locations().
* Step 2: Gallery2 Locations
*/
function _gallery_install_step_locations(&$form, &$form_state, &$install_status) {
$autodetect = variable_get('gallery_autodetect_dir', 1);
$title = t('Step 2: Gallery2 location settings') .' - '. ($autodetect ? t('Auto Configuration') : t('Manual Configuration'));
$desc = $install_status['locations']['status'] ? '' : $autodetect ?
t('Enter the \'Gallery2 URL or URI\' and click \'Test location settings\'
to automatically configure the settings needed for embedding Gallery2 into Drupal. Note that
the auto-config will not work for all host configurations. If you have tried it with a value
you know is correct and it did not work then just use the manual configuration instead.') :
t('Enter the \'Gallery2 URL or URI\' and \'Gallery2 filesystem path\' and then click
\'Test location settings\'. This will check and configure the settings needed for embedding
Gallery2 into Drupal.');
$form['locations'] = array(
'#type' => 'fieldset',
'#title' => $title . ($install_status['locations']['status'] ? ' '. t('(OK)') : ''),
'#description' => isset($install_status['locations']['details']) ? ($desc .'
'. $install_status['locations']['details'] .'
') : $desc, '#collapsible' => ($install_status['step'] > GALLERY_INSTALL_STEP_LOCATIONS), '#collapsed' => $install_status['locations']['status'] ); if ($autodetect) { // Autodetect $gallery_uri = empty($form_state['values']['gallery_uri_auto']) ? variable_get('gallery_uri', '/gallery2/') : $form_state['values']['gallery_uri_auto']; $gallery_dir = empty($form_state['values']['gallery_dir_auto']) ? variable_get('gallery_dir', './gallery2/') : $form_state['values']['gallery_dir_auto']; $embed_uri = empty($form_state['values']['gallery_embed_uri_auto']) ? variable_get('gallery_embed_uri', '/index.php?q=gallery') : $form_state['values']['gallery_embed_uri_auto']; $gallery_base = empty($form_state['values']['gallery_base']) ? variable_get('gallery_base', 'gallery') : $form_state['values']['gallery_base']; $form['locations']['gallery_uri_auto'] = array( '#type' => 'textfield', '#title' => t('Gallery2 URL or URI'), '#default_value' => $gallery_uri, '#size' => 64, '#maxlength' => 128, '#description' => t('URL or URI of the G2 standalone location. This can be either the full URL to Gallery2 (e.g. http://www.example.com/gallery2) or the path from docroot to the Gallery2 directory (e.g. /gallery2). If using a URI the protocol/hostname are both optional.'), '#disabled' => $install_status['locations']['status'] ); if ($install_status['locations']['status']) { $form['locations']['gallery_dir_auto_item'] = array( '#title' => t('Gallery2 filesystem path'), '#type' => 'item', '#value' => $gallery_dir ); } $form['locations']['gallery_dir_auto'] = array( '#type' => 'value', '#value' => $gallery_dir ); if ($install_status['locations']['status']) { $form['locations']['gallery_embed_uri_auto_item'] = array( '#title' => t('Embed URI'), '#type' => 'item', '#value' => $embed_uri ); } $form['locations']['gallery_embed_uri_auto'] = array( '#type' => 'value', '#value' => $embed_uri ); $form['locations']['gallery_base'] = array( '#type' => 'textfield', '#title' => t('Gallery base (optional)'), '#default_value' => $gallery_base, '#size' => 32, '#maxlength' => 64, '#description' => t('Drupal path to embedded Gallery. This option defaults to \'gallery\' and the embedded gallery will be located at \'@default-base\'.', array('@default-base' => url('gallery'))), '#disabled' => $install_status['locations']['status'] ); } else { // No Autodetect (manual) $gallery_uri = empty($form_state['values']['gallery_uri_man']) ? variable_get('gallery_uri', '/gallery2/') : $form_state['values']['gallery_uri_man']; $gallery_dir = empty($form_state['values']['gallery_dir_man']) ? variable_get('gallery_dir', './gallery2/') : $form_state['values']['gallery_dir_man']; $embed_uri = empty($form_state['values']['gallery_embed_uri_man']) ? variable_get('gallery_embed_uri', '/index.php?q=gallery') : $form_state['values']['gallery_embed_uri_man']; $gallery_base = empty($form_state['values']['gallery_base']) ? variable_get('gallery_base', 'gallery') : $form_state['values']['gallery_base']; $form['locations']['gallery_uri_man'] = array( '#type' => 'textfield', '#title' => t('Gallery2 URL or URI'), '#default_value' => $gallery_uri, '#size' => 64, '#maxlength' => 128, '#description' => t('URL or URI of the G2 standalone location. This can be either the full URL to Gallery2 (e.g. http://www.example.com/gallery2) or the path from docroot to the Gallery2 directory (e.g. /gallery2). If using a URI the protocol/hostname are both optional.'), '#disabled' => $install_status['locations']['status'] ); $form['locations']['gallery_dir_man'] = array( '#type' => 'textfield', '#title' => t('Gallery2 filesystem path'), '#default_value' => $gallery_dir, '#size' => 64, '#maxlength' => 128, '#description' => t('The filesystem path of your Gallery2 directory. This can be either an absolute path (e.g. /home/mysite/htdocs/gallery2) or relative to the root directory of your Drupal installation (e.g. ../gallery2).'), '#disabled' => $install_status['locations']['status'] ); $form['locations']['gallery_embed_uri_man'] = array( '#type' => 'textfield', '#title' => t('Embed URI'), '#default_value' => $embed_uri, '#size' => 64, '#maxlength' => 128, '#description' => t('URI to access G2 via Drupal. Don\'t worry if you are using clean urls in Drupal and this still ends in \'index.php?q=gallery\'. This is needed to get the Gallery2 URL rewrite module to work correctly and will not be visible.'), '#disabled' => $install_status['locations']['status'] ); $form['locations']['gallery_base'] = array( '#type' => 'textfield', '#title' => t('Gallery base (optional)'), '#default_value' => $gallery_base, '#size' => 32, '#maxlength' => 64, '#description' => t('Drupal path to embedded Gallery. This option defaults to \'gallery\' and the embedded gallery will be located at \'@default-base\'.', array('@default-base' => url('gallery'))), '#disabled' => $install_status['locations']['status'] ); } if (!$install_status['locations']['status']) { $form['locations']['location_button'] = array( '#type' => 'submit', '#value' => t('Test location settings'), '#submit' => array('_gallery_install_step_locations_check') ); $form['locations']['switch_config_button'] = array( '#type' => 'submit', '#value' => $autodetect ? t('Use Manual Configuration') : t('Use Auto Configuration'), '#submit' => array('_gallery_install_step_locations_switch') ); } } /** * Function _gallery_install_step_locations_check(). */ function _gallery_install_step_locations_check($form, &$form_state) { $install_status = $form_state['values']['install_status']; $autodetect = variable_get('gallery_autodetect_dir', 1); if ($autodetect) { $values['gallery_uri'] = $form_state['values']['gallery_uri_auto']; $values['gallery_base'] = empty($form_state['values']['gallery_base']) ? 'gallery' : $form_state['values']['gallery_base']; } else { $values['gallery_uri'] = $form_state['values']['gallery_uri_man']; $values['gallery_dir'] = $form_state['values']['gallery_dir_man']; $values['gallery_embed_uri'] = $form_state['values']['gallery_embed_uri_man']; } list($install_status['locations']['status'], $values, $result) = _gallery_install_locations($values, $autodetect); if (!$install_status['locations']['status']) { $install_status['locations']['details'] = gallery_format_status($result, t('Errors in your current Gallery2 location settings:')); } else { variable_set('gallery_uri', $values['gallery_uri']); variable_set('gallery_dir', $values['gallery_dir']); variable_set('gallery_embed_uri', $values['gallery_embed_uri']); variable_set('gallery_base', $values['gallery_base']); $install_status['locations']['details'] = ''; $install_status['step'] = GALLERY_INSTALL_STEP_PLUGINS; } if ($autodetect) { $form_state['values']['gallery_uri_auto'] = $values['gallery_uri']; $form_state['values']['gallery_dir_auto'] = $values['gallery_dir']; $form_state['values']['gallery_embed_uri_auto'] = $values['gallery_embed_uri']; } else { $form_state['values']['gallery_uri_man'] = $values['gallery_uri']; $form_state['values']['gallery_dir_man'] = $values['gallery_dir']; $form_state['values']['gallery_embed_uri_man'] = $values['gallery_embed_uri']; } $install_status['locations']['info'] = $install_status['locations']['status'] ? t('The Gallery2 location settings appear to be correct.') : t('There is a problem with the Gallery2 location settings. Please check below and retest. Remember that the auto-config will not work for all hosts.'); $form_state['storage'] = $install_status; } /** * Function _gallery_install_step_locations_switch(). */ function _gallery_install_step_locations_switch($form, &$form_state) { unset($form_state['storage']); variable_set('gallery_autodetect_dir', !variable_get('gallery_autodetect_dir', 1)); } /** * Function _gallery_install_step_plugins(). * Step 3: Drupal Modules / Gallery2 Plugins */ function _gallery_install_step_plugins(&$form, &$form_state, &$install_status) { $title = t('Step 3: Drupal Modules / Gallery2 Plugins') . ($install_status['plugins']['status'] ? ' '. t('(OK)') : ''); $form += _gallery_install_plugins($install_status, $title, ($install_status['step'] > GALLERY_INSTALL_STEP_PLUGINS)); if ($install_status['step'] == GALLERY_INSTALL_STEP_PLUGINS) { if (!in_array($install_status['plugins']['status'], array(GALLERY_SEVERITY_ERROR, GALLERY_SEVERITY_WARNING))) { $install_status['step'] = GALLERY_INSTALL_STEP_URLREWRITE; $form['plugins']['#collapsed'] = TRUE; } else { $form['plugins']['plugins_button_desc'] = array( '#type' => 'item', '#value' => t('There are errors in your plugin configuration. Enable/Disable the respective plugins to meet the requirements.') ); $form['plugins']['plugins_button'] = array( '#type' => 'submit', '#value' => t('Check Plugins status again'), '#submit' => array('_gallery_install_step_plugins_check') ); } } } /** * Function _gallery_install_step_plugins_check(). */ function _gallery_install_step_plugins_check($form, &$form_state) { $install_status = $form_state['values']['install_status']; _gallery_init(TRUE, array(), FALSE); $form_state['storage'] = $install_status; } /** * Function _gallery_install_step_urlrewrite(). * Step 4: Clean URL configuration */ function _gallery_install_step_urlrewrite(&$form, &$form_state, &$install_status) { $title = t('Step 4: Clean URLs / URL Rewrite settings') . ($install_status['urlrewrite']['status'] ? ' '. t('(OK)') : ''); $form['urlrewrite'] = array( '#type' => 'fieldset', '#title' => $title, '#collapsible' => ($install_status['step'] > GALLERY_INSTALL_STEP_URLREWRITE), '#collapsed' => $install_status['urlrewrite']['status'] ); // User selected to skip the URLRewrite step if (variable_get('gallery_rewrite_disable', 0)) { $form['urlrewrite']['#description'] = $install_status['urlrewrite']['info']; $form['urlrewrite']['#description'] .= ' '. t('\'Reset & Restart\' your configuration to change these settings.'); return; } $clean_urls_status = variable_get('clean_url', 0); $rewrite_status = gallery_single_plugin_status('rewrite'); if ($clean_urls_status) { if ($rewrite_status < GALLERY_PLUGIN_ENABLED) { $form['urlrewrite']['#description'] = t('Clean URLs are enabled in Drupal, but the Gallery2 URL Rewrite plugin is unavailable (!status).', array('!status' => theme('gallery_plugin_status_message', $rewrite_status))); $form['urlrewrite']['check'] = array( '#type' => 'submit', '#value' => t('Check URL Rewrite status again'), '#submit' => array('_gallery_install_step_urlrewrite_check') ); } else { // CleanURL and URLRewrite are both enabled $form['urlrewrite']['#description'] = t('Clean URLs are !clean_url_status in Drupal and the Gallery2 URL Rewrite plugin is !rewrite_status. It is possible to automatically configure the URL Rewrite plugin. The configuration assumes that the rules should be placed in your Drupal .htaccess file (it will add them to the beginning) which works in most applications. If you need a special configuration, enter the desired values manually.', array( '!clean_url_status' => theme('gallery_module_status_message', $clean_urls_status), '!rewrite_status' => theme('gallery_plugin_status_message', $rewrite_status) ) ); _gallery_install_urlrewrite($public_path, $htaccess_path, TRUE); $form['urlrewrite']['htaccess_public_path'] = array( '#type' => 'textfield', '#title' => t('Public path to your .htaccess file'), '#size' => 64, '#maxlength' => 255, '#default_value' => $public_path, '#description' => t('This is the location of your Drupal .htaccess file relative to your webserver document root.'), '#disabled' => $install_status['urlrewrite']['status'], ); $form['urlrewrite']['htaccess_filesystem_path'] = array( '#type' => 'textfield', '#title' => t('Filesystem path to your .htaccess file'), '#size' => 100, '#maxlength' => 255, '#default_value' => $htaccess_path, '#description' => t('This is the absolute directory path of your Drupal .htaccess file.'), '#disabled' => $install_status['urlrewrite']['status'], ); $form['urlrewrite']['config'] = array( '#type' => 'submit', '#value' => t('Configure URL Rewrite plugin'), '#submit' => array('_gallery_install_step_urlrewrite_configure') ); } } else { $form['urlrewrite']['check'] = array( '#type' => 'submit', '#value' => t('Check URL Rewrite status again'), '#submit' => array('_gallery_install_step_urlrewrite_check') ); } $form['urlrewrite']['skip'] = array( '#type' => 'submit', '#value' => t('Skip URL Rewrite Config'), '#submit' => array('_gallery_install_step_urlrewrite_skip') ); } /** * Function _gallery_install_step_urlrewrite_check(). */ function _gallery_install_step_urlrewrite_check($form, &$form_state) { $install_status = $form_state['values']['install_status']; _gallery_init(TRUE, array(), FALSE); $form_state['storage'] = $install_status; } /** * Function _gallery_install_step_urlrewrite_skip(). */ function _gallery_install_step_urlrewrite_skip($form, &$form_state) { $install_status = $form_state['values']['install_status']; variable_set('gallery_rewrite_disable', 1); _gallery_init(TRUE, array(), FALSE); _gallery_install_urlrewrite_check($install_status); $install_status['step'] = GALLERY_INSTALL_STEP_USERSYNC; $form_state['storage'] = $install_status; } /** * Function _gallery_install_step_urlrewrite_configure(). */ function _gallery_install_step_urlrewrite_configure($form, &$form_state) { $install_status = $form_state['values']['install_status']; _gallery_init(TRUE, array(), FALSE); if (_gallery_install_urlrewrite($form_state['values']['htaccess_public_path'], $form_state['values']['htaccess_filesystem_path'])) { _gallery_install_urlrewrite_check($install_status); } else { $install_status['urlrewrite']['status'] = FALSE; } if ($install_status['urlrewrite']['status']) { $install_status['step'] = GALLERY_INSTALL_STEP_USERSYNC; } $form_state['storage'] = $install_status; } /** * Function _gallery_install_step_usersync(). * Step 5: User Synchronization */ function _gallery_install_step_usersync(&$form, &$form_state, &$install_status) { $title = t('Step 5: Initial User Synchronization') . ($install_status['usersync']['status'] ? ' '. t('(OK)') : ''); $form['usersync'] = array( '#type' => 'fieldset', '#title' => $title, '#collapsible' => ($install_status['step'] > GALLERY_INSTALL_STEP_USERSYNC), '#collapsed' => $install_status['usersync']['status'], ); if ($install_status['usersync']['status']) { $form['usersync']['#description'] = t('Your initial user synchronization has been completed already.'. $errstr .'', 'error'); return FALSE; } } return TRUE; }