Skip to content
Snippets Groups Projects
Commit a8b73814 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Completing backend js functionality

parent eda0763a
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@
<f:for each="{pages}" as="page">
<tr data-uid="{page.uid}">
<td nowrap="nowrap" class="col-title">
<a href="#" onclick="sgRouteGoToPage({page.uid}, '{page.path}'); return false;">
<a href="#" onclick="sgJobsGoToPage({page.uid}, '{page.path}'); return false;">
<f:format.raw>
<sg:backend.icon table="pages" row="{page}" clickMenu="0" /> {page._thePathFull}
</f:format.raw>
......
{namespace sg=SGalinski\SgJobs\ViewHelpers}
<f:layout name="Default" />
<f:section name="iconButtons">
......@@ -9,7 +11,7 @@
<f:debug>{_all}</f:debug>
<f:if condition="{rootPageUid}">
<f:then>
<h1>test</h1>
<h1>{rootPageUid}</h1>
</f:then>
<f:else>
......
(function($) {
function deleteAllListener(_event) {
_event.preventDefault();
var confirm = SG.lang.SgRoutes['backend.delete_all'];
if (window.confirm(confirm)) {
window.location = $(_event.currentTarget).attr('href');
}
}
$(document).ready(function() {
$('.btn-delete-all').on('click', deleteAllListener);
$.get(TYPO3.settings.ajaxUrls['sg_routes::ajaxPing']);
});
})(TYPO3.jQuery);
// functions for backend docheader functionality
function jumpExt(URL, anchor) { //
var anc = anchor ? anchor : "";
......@@ -21,4 +37,54 @@ function setHighlight(id) { //
if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
top.content.nav_frame.refresh_nav();
}
}
\ No newline at end of file
}
/**
* Switches to the spefied page in the BE
*
* @param {number} uid
* @param {string} path
*/
function sgJobsGoToPage(uid, path) {
if (top.nav) {
top.nav.invokePageId(uid,gotToPageCallback);
} else {
var tree = top.Ext.getCmp('typo3-pagetree');
if (tree) {
tree.activeTree.selectPath(path);
}
var separator = '?';
if (top.currentSubScript.indexOf('?') !== -1) {
separator = '&';
}
top.TYPO3.Backend.ContentContainer.setUrl(
top.currentSubScript + separator + 'id=' + uid
);
}
}
/**
* Callback for page selection in the pagetree
*/
function gotToPageCallback(path){
var callback = top.Ext.createDelegate(top.nav.mainTree.selectPath, top.nav.mainTree);
callback.apply(this, arguments);
var node = top.nav.getSelected();
if (node) {
top.TYPO3.Components.PageTree.Actions.singleClick(node, top.TYPO3.Components.PageTree.Tree);
}
}
/**
* opens the selected category edit form
*
* @return {boolean}
*/
function editSelectedCategory(){
var selected = TYPO3.jQuery('#filter-categories').val();
if(selected && CategoryEditLinks[selected[0]]) {
jumpToUrl(CategoryEditLinks[selected[0]] + '&returnUrl=' + T3_THIS_LOCATION);
}
return false;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment