Commit 76cdd2c8 authored by Tim Steiner's avatar Tim Steiner
Browse files

[gh-558] Start Liferay migration by processing the site map.

parent 6725227d
......@@ -84,8 +84,8 @@ function unl_migration_submit($form, &$form_state) {
);
$batch = array(
'operations' => $operations,
'file' => substr(__FILE__, strlen(DRUPAL_ROOT) + 1),
'operations' => $operations,
'file' => substr(__FILE__, strlen(DRUPAL_ROOT) + 1),
);
batch_set($batch);
}
......@@ -237,6 +237,7 @@ class Unl_Migration_Tool
$this->_processMenu();
$this->_process_blocks();
$this->_process_breadcrumbs();
$this->_process_liferay_sitemap();
$this->_state = self::STATE_PROCESSING_PAGES;
}
......@@ -645,6 +646,25 @@ class Unl_Migration_Tool
$current_settings['intermediate_breadcrumbs'] = $this->_breadcrumbs;
variable_set('theme_unl_wdn_settings', $current_settings);
}
private function _process_liferay_sitemap() {
if (!$this->_useLiferayCode) {
return;
}
$data = $this->_getUrl($this->_baseUrl . '?p_p_id=EXT_SITEMAP&p_p_state=exclusive&p_p_mode=view');
if (strpos($data['contentType'], 'html') === FALSE) {
return;
}
$dom = new DOMDocument();
@$dom->loadHTML($data['content']);
$linkNodes = $dom->getElementsByTagName('a');
foreach ($linkNodes as $linkNode) {
$this->_processLinks($linkNode->getAttribute('href'), '');
}
}
private function _processPage($path)
{
......
Supports Markdown
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