mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR More extension points in CMSMain (specifically to allow for 'locale' query parameter and language drop down of the 'translatable' extension)
This commit is contained in:
parent
20af440694
commit
c185c737dd
@ -134,18 +134,24 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
* @return string
|
||||
*/
|
||||
public function Link($action = null) {
|
||||
return Controller::join_links(
|
||||
$link = Controller::join_links(
|
||||
$this->stat('url_base', true),
|
||||
$this->stat('url_segment', true), // in case we want to change the segment
|
||||
'/', // trailing slash needed if $action is null!
|
||||
"$action"
|
||||
);
|
||||
$this->extend('updateLink', $link);
|
||||
return $link;
|
||||
}
|
||||
|
||||
public function LinkPages() {
|
||||
return singleton('CMSPagesController')->Link();
|
||||
}
|
||||
|
||||
public function LinkPagesWithSearch() {
|
||||
return $this->LinkWithSearch($this->LinkPages());
|
||||
}
|
||||
|
||||
public function LinkTreeView() {
|
||||
return $this->LinkWithSearch(singleton('CMSMain')->Link('treeview'));
|
||||
}
|
||||
@ -187,10 +193,12 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
'q' => (array)$this->request->getVar('q'),
|
||||
'ParentID' => $this->request->getVar('ParentID')
|
||||
);
|
||||
return Controller::join_links(
|
||||
$link = Controller::join_links(
|
||||
$link,
|
||||
array_filter(array_values($params)) ? '?' . http_build_query($params) : null
|
||||
);
|
||||
$this->extend('updateLinkWithSearch', $link);
|
||||
return $link;
|
||||
}
|
||||
|
||||
function LinkPageAdd() {
|
||||
@ -226,6 +234,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
Versioned::prepopulate_versionnumber_cache("SiteTree", "Live");
|
||||
$html .= $this->getSiteTreeFor($this->stat('tree_class'));
|
||||
|
||||
$this->extend('updateSiteTreeAsUL', $html);
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
@ -235,6 +245,12 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
public function TreeIsFiltered() {
|
||||
return $this->request->getVar('q');
|
||||
}
|
||||
|
||||
public function ExtraTreeTools() {
|
||||
$html = '';
|
||||
$this->extend('updateExtraTreeTools', $html);
|
||||
return $html;
|
||||
}
|
||||
|
||||
function SearchForm() {
|
||||
// get all page types in a dropdown-compatible format
|
||||
|
@ -10,6 +10,8 @@
|
||||
<% _t('CMSMain.EditTree', 'Edit Tree') %>
|
||||
</button>
|
||||
|
||||
$ExtraTreeTools
|
||||
|
||||
<div class="center">
|
||||
<% if TreeIsFiltered %>
|
||||
<div class="cms-tree-filtered">
|
||||
|
Loading…
Reference in New Issue
Block a user