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

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 {
......@@ -44,4 +47,4 @@ catch (TemplateParserException $e) {
?>
\ No newline at end of file
?>
......@@ -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');
......
......@@ -25,9 +25,14 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
safe_require('artefact', 'file');
require_once('artefact.php');
json_headers();
global $USER;
$parentfolder = param_variable('parentfolder', null); // id of parent artefact
......
......@@ -25,9 +25,13 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once('community.php');
json_headers();
$leave = param_integer('leave');
if (!$community = get_record('community', 'id', $leave)) {
......
......@@ -25,9 +25,13 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once('community.php');
json_headers();
$owned = param_boolean('owned', 0);
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
......@@ -66,4 +70,4 @@ print json_encode(array(
?>
\ No newline at end of file
?>
......@@ -25,10 +25,13 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once('community.php');
json_headers();
$id = param_integer('id');
$pending = param_boolean('pending', 0); // for memberlist
$submitted = param_boolean('submitted', 0); // for viewlist
......@@ -197,4 +200,4 @@ function community_json_empty() {
}
?>
\ No newline at end of file
?>
......@@ -302,4 +302,4 @@ $smarty->assign('community', $community);
$smarty->display('contacts/communities/view.tpl');
?>
\ No newline at end of file
?>
......@@ -25,6 +25,7 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
......
......@@ -25,8 +25,12 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
json_headers();
$pending = param_boolean('pending', false);
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
......@@ -99,4 +103,4 @@ print json_encode(array(
exit;
?>
\ No newline at end of file
?>
......@@ -25,8 +25,12 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
json_headers();
$pluginname = param_variable('pluginname');
$parent = param_integer('parent', null);
$userid = param_integer('userid', $USER->get('id'));
......
......@@ -57,4 +57,4 @@ $string['accessdeniedexception'] = 'You do not have access to view this page';
$string['viewnotfoundexceptiontitle'] = 'View not found';
$string['viewnotfoundexceptionmessage'] = 'You tried to access a view that didn\'t exist!';
?>
\ No newline at end of file
?>
......@@ -68,3 +68,4 @@ $string['format.renderfull'] = 'Display entire artefact';
$string['format.rendermetadata'] = 'Display metadata for this artefact';
?>
......@@ -309,4 +309,4 @@ function community_add_member($communityid, $userid) {
}
?>
\ No newline at end of file
?>
......@@ -18,9 +18,10 @@
*
* @package mahara
* @subpackage core
* @author (copied from Moodle)
* @author Martin Dougiamas <martin@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
* @copyright (C) 2001-3001 Martin Dougiamas http://dougiamas.com
* @copyright additional modifications (c) Catalyst IT Ltd http://catalyst.net.nz
*
*/
......
......@@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage core or plugintype/pluginname
* @subpackage core
* @author Martyn Smith <martyn@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
......
<?php
/**
* This program is part of Mahara
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage core
* @author Martin Dougiamas <martin@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2001-3001 Martin Dougiamas http://dougiamas.com
* @copyright additional modifications (c) Catalyst IT Ltd http://catalyst.net.nz
*
*/
class upload_manager {
......
......@@ -17,8 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package mahara
* @subpackage core or plugintype/pluginname
* @author Your Name <you@example.org>
* @subpackage core
* @author Penny Leach <penny@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
*
......
......@@ -25,8 +25,12 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
json_headers();
$data = new StdClass;
$data->view = param_integer('view');
......
......@@ -25,8 +25,12 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
json_headers();
$view = param_integer('view');
$artefact = param_integer('artefact',null);
$recurse = param_boolean('recurse',true);
......
......@@ -25,6 +25,7 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
......@@ -61,4 +62,3 @@ print json_encode(array(
));
?>
......@@ -92,4 +92,3 @@ $smarty->assign('categories', get_column('template_category','name'));
$smarty->display('view/create2.tpl');
?>
......@@ -28,10 +28,14 @@
// be moved elsewhere without harm if necessary (e.g. if the 'viewacl' element
// was used in more places
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
require('searchlib.php');
safe_require('search', 'internal');
json_headers();
$type = param_variable('type');
$query = param_variable('query', '');
$limit = param_integer('limit', 10);
......
......@@ -25,8 +25,12 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
json_headers();
$viewid = param_integer('viewid');
require_once('view.php');
......
......@@ -25,8 +25,12 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
json_headers();
$view = param_integer('view');
$artefact = param_integer('artefact', null);
$limit = param_integer('limit', 5);
......
......@@ -25,8 +25,12 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
json_headers();
$limit = param_integer('limit', 5);
$offset = param_integer('offset', 0);
......
......@@ -25,9 +25,13 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
require_once('activity.php');
json_headers();
$data = new StdClass;
$data->view = param_integer('view');
$data->artefact = param_integer('artefact', null);
......
......@@ -25,8 +25,12 @@
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
json_headers();
$data = new StdClass;
$data->id = param_integer('viewid');
......
......@@ -48,3 +48,5 @@ if(!isset($parsed_template['css'])) {
header('Content-type: text/css');
echo file_get_contents($parsed_template['css']);
?>
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