protected function savePage($row) { $titles = explode("\n", $this->data[$row]['Name']); if (isset($this->data[$row]['Meta Keywords'])) { $metaKeywords = explode("\n", $this->data[$row]['Meta Keywords']); } if (isset($this->data[$row]['Meta Description'])) { $metaDescriptions = explode("\n", $this->data[$row]['Meta Description']); } $page = new Cms_Model_Page(); $page->set_application_id(1)->set_format('html')->set_status('published')->set_type_id(1)->set_user_id(1)->set_posted(HCMS_Utils_Time::timeTs2Mysql(time())); foreach ($this->languages as $langIndex => $lang) { $curRow = $row; $title = $this->getLangText($titles, $langIndex); if (isset($metaKeywords)) { $metaKeyword = $this->getMetaKeywords($metaKeywords, $langIndex); } if (isset($metaDescriptions)) { $metaDescription = $this->getMetaDescription($metaDescriptions, $langIndex); } $urlIdParts = array(); while (isset($this->data[$curRow])) { $currTitles = explode("\n", $this->data[$curRow]['Name']); if (isset($metaKeyword) && isset($metaDescription)) { $meta = array("keywords" => $metaKeyword, "description" => $metaDescription); } else { $meta = array("keywords" => "", "description" => ""); } if (isset($currTitles[$langIndex])) { $urlIdParts[] = $this->seoFilter->filter($currTitles[$langIndex]); } if (!isset($this->data[$curRow]['parent'])) { break; } $curRow = $this->data[$curRow]['parent']; } $urlIdParts = array_reverse($urlIdParts); $urlId = implode('-', $urlIdParts); $page->set_code('')->set_url_id($urlId)->set_content('<h1>' . $title . '</h1>')->set_title($title)->set_meta($meta); if (Cms_Model_PageMapper::getInstance()->findByUrlId($urlId, 1, $page)) { continue; } Cms_Model_PageMapper::getInstance()->save($page, $lang); } $this->data[$row]['page_id'] = $page->get_id(); }