diff --git a/sites/all/modules/unl/cron.php b/sites/all/modules/unl/cron.php index 31fad76eb3bb3f31d0fd88217d07f1c6be4b9e9c..1c0830a67d311f7428dc2bf9dbe608b355dfc149 100644 --- a/sites/all/modules/unl/cron.php +++ b/sites/all/modules/unl/cron.php @@ -18,7 +18,7 @@ while ($row = $query->fetchAssoc()) { ->fields(array('installed' => 1)) ->condition('site_id', $row['site_id']) ->execute(); - unl_add_site($row['site_path_prefix'], $row['site_path'], $row['uri']); + unl_add_site($row['site_path_prefix'], $row['site_path'], $row['uri'], $row['clean_url']); db_update('unl_sites') ->fields(array('installed' => 2)) ->condition('site_id', $row['site_id']) @@ -26,7 +26,7 @@ while ($row = $query->fetchAssoc()) { } -function unl_add_site($site_path_prefix, $site_path, $uri) +function unl_add_site($site_path_prefix, $site_path, $uri, $clean_url) { if (substr($site_path, 0, 1) == '/') { @@ -82,7 +82,7 @@ function unl_add_site($site_path_prefix, $site_path, $uri) } $symlink_target = implode('/', $symlink_target); - $command = "$php_path sites/all/modules/drush/drush.php -y --uri=$uri site-install unl_profile --sites-subdir=$sites_subdir --db-url=$db_url --db-prefix=$db_prefix --clean-url=0"; + $command = "$php_path sites/all/modules/drush/drush.php -y --uri=$uri site-install unl_profile --sites-subdir=$sites_subdir --db-url=$db_url --db-prefix=$db_prefix --clean-url=$clean_url"; mkdir($subdir, 0755, TRUE); symlink($symlink_target, $subdir . '/' . $symlink_name); diff --git a/sites/all/modules/unl/unl.info b/sites/all/modules/unl/unl.info index 1924b4eac61c3dff79044eb479084ddeaac4d2f4..f148e31fab595032b189b8b4b53d5da3c45c0ca8 100644 --- a/sites/all/modules/unl/unl.info +++ b/sites/all/modules/unl/unl.info @@ -1,7 +1,7 @@ name = UNL WDN description = Adds features to allow wysiwyg editing of WDN Templated sites. core = 7.x -version = "7.x-1.0-20100720" +version = "7.x-1.0-20100920" dependencies[] = wysiwyg files[] = unl.install diff --git a/sites/all/modules/unl/unl.install b/sites/all/modules/unl/unl.install index 04d71e68a8b389d36b5f17e4e730d2df1667da1e..4476ed116594921a4d37f200c915240327cdbfa2 100644 --- a/sites/all/modules/unl/unl.install +++ b/sites/all/modules/unl/unl.install @@ -33,7 +33,12 @@ function unl_schema() 'type' => 'int', 'not null' => TRUE, 'default' => 0 - ) + ), + 'clean_url' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 1 + ) ), 'primary key' => array('site_id'), 'unique keys' => array( @@ -87,3 +92,16 @@ function unl_update_7100() db_create_table('unl_sites', $table); } + +function unl_update_7101() +{ + db_add_field( + 'unl_sites', + 'clean_url', + array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 1 + ) + ); +} diff --git a/sites/all/modules/unl/unl_site_creation.php b/sites/all/modules/unl/unl_site_creation.php index 749a69c410501eb93f31f54aeb76a3b22bb23a1b..d2960eb897c52e74f9fb490da4781179423d9624 100644 --- a/sites/all/modules/unl/unl_site_creation.php +++ b/sites/all/modules/unl/unl_site_creation.php @@ -30,6 +30,13 @@ function unl_site_creation($form, &$form_state) '#required' => TRUE ); + $form['root']['clean_url'] = array( + '#type' => 'checkbox', + '#title' => t('Use clean URLs'), + '#description' => t('Unless you have some reason to think your site won\'t support this, leave it checked.'), + '#default_value' => 1 + ); + $form['submit'] = array( '#type' => 'submit', '#value' => 'Create Site' @@ -39,10 +46,12 @@ function unl_site_creation($form, &$form_state) } function unl_site_creation_submit($form, &$form_state) -{ +{ $php_path = $form_state['values']['php_path']; $site_path = $form_state['values']['site_path']; $site_path_prefix = $form_state['values']['site_path_prefix']; + $clean_url = $form_state['values']['clean_url']; + if (substr($site_path, 0, 1) == '/') { $site_path = substr($site_path, 1); } @@ -63,10 +72,13 @@ function unl_site_creation_submit($form, &$form_state) $uri = url($full_path, array('absolute' => TRUE)); + $clean_url = intval($clean_url); + db_insert('unl_sites')->fields(array( 'site_path_prefix' => $site_path_prefix, 'site_path' => $site_path, - 'uri' => $uri + 'uri' => $uri, + 'clean_url' => $clean_url ))->execute(); exit;