Skip to content
Snippets Groups Projects
Commit d044dc6d authored by Tim Steiner's avatar Tim Steiner
Browse files

Merging trunk into testing

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/testing@287 20a16fea-79d4-4915-8869-1ea9d5ebf173
parents bb125658 b4ed05d7
Branches
Tags
No related merge requests found
......@@ -78,6 +78,7 @@ class Unl_Migration_Tool
private $_content = array();
private $_createdContent = array();
private $_lastModifications = array();
private $_redirects = array();
private $_hrefTransform = array();
private $_hrefTransformFiles = array();
private $_menu = array();
......@@ -150,6 +151,9 @@ class Unl_Migration_Tool
unset($transforms['']);
}
foreach ($transforms as $oldPath => &$newPath) {
if (array_key_exists($newPath, $this->_redirects)) {
$newPath = $this->_redirects[$newPath];
}
if (array_key_exists($newPath, $this->_hrefTransformFiles)) {
$newPath = $this->_hrefTransformFiles[$newPath];
}
......@@ -262,6 +266,17 @@ class Unl_Migration_Tool
private function _createMenu()
{
// Start off by removing the "Home" menu link if it exists.
$menu_links = menu_load_links('main-menu');
foreach ($menu_links as $menu_link) {
if ($menu_link['plid'] == 0 &&
$menu_link['link_title'] == 'Home' &&
$menu_link['link_path'] == '<front>') {
menu_link_delete($menu_link['mlid']);
}
}
// Now recursively create each menu.
$primaryWeights = 1;
foreach ($this->_menu as $primaryMenu) {
$item = array(
......@@ -639,6 +654,13 @@ class Unl_Migration_Tool
$location = $headers['Location'];
$path = substr($location, strlen($this->_baseUrl));
$this->_addSitePath($path);
if (substr($location, 0, strlen($this->_baseUrl)) == $this->_baseUrl) {
$this->_redirects[substr($url, strlen($this->_baseUrl))] = substr($location, strlen($this->_baseUrl));
} else {
$this->_redirects[substr($url, strlen($this->_baseUrl))] = $location;
}
$this->_log('Found a redirect from ' . $url . ' to ' . $location . '. Some links may need to be updated.');
return FALSE;
} else if ($meta['http_code'] != 200) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment