Commit dc3688e6 authored by Ruslan Kabalin's avatar Ruslan Kabalin

Make editchangepage.json.php less "page" specific (bug #1073625)

It can be used for any site content, not site pages only.

Change-Id: Ia901ce1444ab26c50b6327089cf2040a95fbe148
Signed-off-by: default avatarRuslan Kabalin <r.kabalin@lancaster.ac.uk>
parent 1fe0319b
......@@ -31,15 +31,15 @@ define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
$pagename = param_alpha('pagename');
$contentname = param_alpha('contentname');
if (!$page = get_record('site_content', 'name', $pagename)) {
json_reply('local', get_string('loadsitepagefailed', 'admin'));
if (!$contentitem = get_record('site_content', 'name', $contentname)) {
json_reply('local', get_string('loadsitecontentfailed', 'admin'));
}
$data = array(
'pagename' => $pagename,
'content' => $page->content,
'contentname' => $contentname,
'content' => $contentitem->content,
'error' => false,
'message' => false,
);
......
......@@ -36,8 +36,8 @@ function updateWYSIWYGText() {
checkOldContent = true;
}
sendjsonrequest(
'editchangepage.json.php',
{'pagename' :$('editsitepage_pagename').value},
'editchangecontent.json.php',
{'contentname' :$('editsitepage_pagename').value},
'POST',
function(data) {
if (!data.error) {
......
......@@ -414,7 +414,7 @@ $string['about'] = 'About';
$string['discardpageedits'] = 'Discard your changes to this page?';
$string['editsitepagespagedescription'] = 'Here you can edit the content of some pages around the site, such as the homepage (for logged-in and logged-out users separately) and the pages linked to in the footer.';
$string['home'] = 'Home (Dashboard)';
$string['loadsitepagefailed'] = 'Failed to load site page';
$string['loadsitecontentfailed'] = 'Failed to load site page content';
$string['loggedouthome'] = 'Logged-out home';
$string['pagename'] = 'Page name';
$string['pagesaved'] = 'Page saved';
......
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