Commit 9f9db575 authored by Penny Leach's avatar Penny Leach
Browse files

mass commit - fixing up lots of missing define('JSON', 1) in json scripts

and general header noise (output of file_content_check anger)
parent 97512e54
......@@ -25,6 +25,7 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
......
......@@ -25,6 +25,7 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
......
......@@ -26,11 +26,14 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once(get_config('libroot') . 'template.php');
require_once('upgrade.php');
json_headers();
$name = param_alpha('name');
try {
......
......@@ -26,8 +26,12 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
json_headers();
$itemid = param_integer('itemid');
if (!delete_records('site_menu','id', $itemid)) {
......
......@@ -26,8 +26,12 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
json_headers();
$pagename = param_alpha('pagename');
$data['pagename'] = $pagename;
......
......@@ -26,8 +26,12 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
json_headers();
$public = (int) param_boolean('public');
$result = array();
......
......@@ -26,8 +26,12 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
json_headers();
$type = param_alpha('type'); // external list or admin file
$name = param_variable('name');
$linkedto = param_variable('linkedto');
......
......@@ -27,9 +27,13 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('INSTALLER', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
require(get_config('libroot') . 'upgrade.php');
json_headers();
$install = param_boolean('install');
if (!$install) {
$name = param_variable('name');
......
......@@ -26,8 +26,12 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
json_headers();
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
......
......@@ -25,9 +25,9 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
safe_require('artefact', 'blog');
$limit = param_integer('limit', null);
......@@ -57,6 +57,4 @@ json_headers();
print json_encode($result);
?>
......@@ -25,6 +25,7 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/init.php');
safe_require('artefact', 'blog');
......
......@@ -25,6 +25,7 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/init.php');
safe_require('artefact', 'blog');
......
......@@ -25,6 +25,7 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/init.php');
safe_require('artefact', 'blog');
......
......@@ -25,10 +25,13 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
global $USER;
json_headers();
$title = param_variable('title');
$draft = param_boolean('draft');
$createid = param_integer('createid');
......@@ -119,7 +122,4 @@ if (!empty($uploads)) {
json_reply(false, 'foo');
?>
......@@ -25,10 +25,13 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/init.php');
safe_require('artefact', 'blog');
json_headers();
$id = param_integer('id');
$blogpost = new ArtefactTypeBlogPost($id);
......@@ -40,3 +43,5 @@ echo json_encode(
'success' => $success
)
);
?>
......@@ -25,6 +25,7 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/init.php');
safe_require('artefact', 'blog');
......
......@@ -25,10 +25,13 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/init.php');
safe_require('artefact', 'blog');
json_headers();
$id = param_integer('id');
$blogpost = new ArtefactTypeBlogPost($id);
......
......@@ -25,10 +25,14 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
safe_require('artefact', 'file');
global $USER;
json_headers();
$parentfolder = param_variable('parentfolder', null); // id of parent artefact
$title = param_variable('name');
$description = param_variable('description', null);
......
......@@ -25,14 +25,13 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
try {
$fileid = param_integer('id');
}
catch (ParameterException $e) {
json_reply('missingparameter',get_string('missingparameter'));
}
json_headers();
$fileid = param_integer('id');
require_once('artefact.php');
......
......@@ -25,6 +25,8 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
//log_debug('myfiles.json.php');
......
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