Commit 2d6995f7 authored by frjo's avatar frjo

Improved the Colorbox user login feature followup. Fix D6 code that I had not...

Improved the Colorbox user login feature followup. Fix D6 code that I had not updated, sorry about that.
parent 768685af
......@@ -347,7 +347,7 @@ function colorbox_admin_settings() {
*/
function _colorbox_admin_settings_check_plugin_path($form_element) {
$library_path = $form_element['#value'];
if (!is_dir($library_path) || !(file_exists($library_path .'/colorbox/jquery.colorbox.js') && file_exists($library_path .'/colorbox/jquery.colorbox-min.js'))) {
if (!is_dir($library_path) || !(file_exists($library_path . '/colorbox/jquery.colorbox.js') && file_exists($library_path . '/colorbox/jquery.colorbox-min.js'))) {
form_set_error($form_element['#parents'][0], t('You need to download the !colorbox and extract the entire contents of the archive into the %path folder of your server.', array('!colorbox' => l(t('Colorbox plugin'), 'http://colorpowered.com/colorbox/'), '%path' => $library_path)));
}
......
......@@ -296,10 +296,10 @@ function colorbox_get_version($colorbox_js = NULL) {
function colorbox_get_js() {
$library_path = colorbox_get_path();
if (file_exists($library_path .'/colorbox/jquery.colorbox.js') && file_exists($library_path .'/colorbox/jquery.colorbox-min.js')) {
if (file_exists($library_path . '/colorbox/jquery.colorbox.js') && file_exists($library_path . '/colorbox/jquery.colorbox-min.js')) {
$colorbox_js_map = array('none' => 'jquery.colorbox.js', 'min' => 'jquery.colorbox-min.js');
$colorbox_js = $colorbox_js_map[variable_get('colorbox_compression_type', 'min')];
return $library_path .'/colorbox/'. $colorbox_js;
return $library_path . '/colorbox/' . $colorbox_js;
}
else {
drupal_set_message(t('You need to download the !colorbox and extract the entire contents of the archive into the %path folder of your server.', array('!colorbox' => l(t('Colorbox plugin'), 'http://colorpowered.com/colorbox/'), '%path' => $library_path)), 'error', FALSE);
......@@ -317,7 +317,7 @@ function colorbox_get_path() {
if ($library_path == NULL) {
// First check the default location.
$path = variable_get('colorbox_path', COLORBOX_PATH);
if (is_dir($path .'/colorbox')) {
if (is_dir($path . '/colorbox')) {
$library_path = $path;
}
// Ask the libraries module as a fallback.
......@@ -360,26 +360,26 @@ function colorbox_form_alter(&$form, &$form_state, $form_id) {
$items = array();
// Add standard links.
if (variable_get('colorbox_login_links', 0) == 1) {
if (variable_get('user_register', 1)) {
if (variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)) {
$items[] = l(t('Create new account'), 'user/register', array('attributes' => array('title' => t('Create a new user account.'))));
}
$items[] = l(t('Request new password'), 'user/password', array('attributes' => array('title' => t('Request new password via e-mail.'))));
}
// Add links that opens in a Colorbox.
if (variable_get('colorbox_login_links', 0) == 2) {
if (variable_get('user_register', 1)) {
$items[] = l(t('Create new account'), 'colorbox/form/user_register', array('query' => 'width=300&height=auto', 'attributes' => array('title' => t('Create a new user account.'), 'class' => 'colorbox-load')));
if (variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)) {
$items[] = l(t('Create new account'), 'colorbox/form/user_register_form', array('query' => array('width' => '300', 'height' => 'auto'), 'attributes' => array('title' => t('Create a new user account.'), 'class' => 'colorbox-load')));
}
$items[] = l(t('Request new password'), 'colorbox/form/user_pass', array('query' => 'width=300&height=150', 'attributes' => array('title' => t('Request new password via e-mail.'), 'class' => 'colorbox-load')));
$items[] = l(t('Request new password'), 'colorbox/form/user_pass', array('query' => array('width' => '300', 'height' => '150'), 'attributes' => array('title' => t('Request new password via e-mail.'), 'class' => 'colorbox-load')));
}
$form['links'] = array('#value' => theme('item_list', $items));
$form['links'] = array('#markup' => theme('item_list', array('items' => $items)));
}
}
break;
case 'user_register':
case 'user_register_form':
if (arg(0) == 'colorbox' && arg(1) == 'form') {
$form['name']['#size'] = 30;
$form['mail']['#size'] = 30;
$form['account']['name']['#size'] = 30;
$form['account']['mail']['#size'] = 30;
}
break;
case 'user_pass':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment