Commit aa0b3056 authored by Henning Leutz's avatar Henning Leutz 🥋

feat: #522

parent 8736f83e
......@@ -25,7 +25,8 @@ QUI::$Ajax->registerFunction(
'attributes' => $attributes,
'has_children' => $Site->hasChildren(true),
'parentid' => $Site->getParentId(),
'url' => $Site->getUrlRewritten()
'url' => $Site->getUrlRewritten(),
'hostUrl' => $Site->getUrlRewrittenWithHost()
];
},
['project', 'id'],
......
......@@ -572,7 +572,7 @@ define('controls/projects/project/Sitemap', [
if ("nav_hide" in result) {
if (result.nav_hide == '1') {
if (parseInt(result.nav_hide) === 1) {
Itm.addIcon(URL_BIN_DIR + '16x16/navigation_hidden.png');
} else {
Itm.removeIcon(URL_BIN_DIR + '16x16/navigation_hidden.png');
......@@ -580,7 +580,7 @@ define('controls/projects/project/Sitemap', [
}
if ("linked" in result) {
if (result.linked == '1') {
if (parseInt(result.linked) === 1) {
Itm.setAttribute('linked', true);
Itm.addIcon(URL_BIN_DIR + '16x16/linked.png');
} else {
......@@ -658,8 +658,6 @@ define('controls/projects/project/Sitemap', [
}
}
})
).appendChild(
new QUIContextmenuSeparator()
).appendChild(
new QUIContextmenuItem({
disabled: true,
......@@ -686,6 +684,19 @@ define('controls/projects/project/Sitemap', [
})
).appendChild(
new QUIContextmenuSeparator()
).appendChild(
new QUIContextmenuItem({
name : 'open-in-website',
text : Locale.get('quiqqer/quiqqer', 'project.sitemap.open.in.window'),
icon : 'fa fa-external-link',
events: {
onClick: function (event) {
self.$openSiteInWebsite(Itm);
}
}
})
).appendChild(
new QUIContextmenuSeparator()
).appendChild(
new QUIContextmenuItem({
name : 'de-activate-site',
......@@ -901,7 +912,7 @@ define('controls/projects/project/Sitemap', [
// move site
if (data.copyType === 'cut') {
if (this.getAttribute('project') != Site.getProject().getName()) {
if (this.getAttribute('project') !== Site.getProject().getName()) {
return;
}
......@@ -958,13 +969,25 @@ define('controls/projects/project/Sitemap', [
Site = Project.get(data.id);
Site.linked(NewParentItem.getAttribute('value'), function () {
if (!NewParentItem.isOpen()) {
NewParentItem.open();
} else {
self.$open(NewParentItem);
}
});
},
/**
* Opens the site in the website
*
* @param {Object} Item - qui/controls/sitemap/Item
*/
$openSiteInWebsite: function (Item) {
Ajax.get('ajax_site_get', function (result) {
window.open(result.hostUrl);
}, {
project: this.$Project.encode(),
id : Item.getAttribute('value')
});
},
......
......@@ -1753,6 +1753,9 @@
<p>Welche Einträge der Seite sollen angezeigt werden?</p>
]]></de>
</locale>
<locale name="project.sitemap.open.in.window">
<de><![CDATA[Seite in Webseite öffnen]]></de>
</locale>
<locale name="control.server.button.add.text">
<de><![CDATA[Neuen Server hinzufügen]]></de>
......
......@@ -1729,13 +1729,16 @@
<locale name="control.project.sitemap.prev">
<en><![CDATA[Back (right click for more options)]]></en>
</locale>
<locale name="control.server.button.add.text">
<en><![CDATA[Add new server]]></en>
</locale>
<locale name="control.server.filter.placeholder">
<en><![CDATA[Filter...]]></en>
</locale>
<locale name="project.sitemap.open.in.window">
<en><![CDATA[Open page in web page]]></en>
</locale>
<locale name="control.server.filter.submit">
<en><![CDATA[Start search]]></en>
</locale>
......
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