summaryrefslogtreecommitdiff
path: root/lib/exe
diff options
context:
space:
mode:
authorGerrit Uitslag <klapinklapin@gmail.com>2014-02-20 21:42:31 +0100
committerGerrit Uitslag <klapinklapin@gmail.com>2014-02-20 21:42:31 +0100
commit2472a8f6cbd2abffe712ddd42fe2ad296d03d8f2 (patch)
treea353c49ddefb78554c51a959943efe7daed5badf /lib/exe
parent8d443db51f9acca81484bec96d8bcd49c00e6414 (diff)
downloadrpg-2472a8f6cbd2abffe712ddd42fe2ad296d03d8f2.tar.gz
rpg-2472a8f6cbd2abffe712ddd42fe2ad296d03d8f2.tar.bz2
Removed unused vars, define undefined ones
Diffstat (limited to 'lib/exe')
-rw-r--r--lib/exe/ajax.php38
1 files changed, 22 insertions, 16 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php
index 6e2011cd9..2cbcece5e 100644
--- a/lib/exe/ajax.php
+++ b/lib/exe/ajax.php
@@ -41,7 +41,6 @@ if(function_exists($callfn)){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function ajax_qsearch(){
- global $conf;
global $lang;
global $INPUT;
@@ -89,15 +88,12 @@ function ajax_qsearch(){
* @author Mike Frysinger <vapier@gentoo.org>
*/
function ajax_suggestions() {
- global $conf;
- global $lang;
global $INPUT;
$query = cleanID($INPUT->post->str('q'));
if(empty($query)) $query = cleanID($INPUT->get->str('q'));
if(empty($query)) return;
- $data = array();
$data = ft_pageLookup($query);
if(!count($data)) return;
$data = array_keys($data);
@@ -214,7 +210,6 @@ function ajax_medians(){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function ajax_medialist(){
- global $conf;
global $NS;
global $INPUT;
@@ -234,13 +229,15 @@ function ajax_medialist(){
* @author Kate Arzamastseva <pshns@ukr.net>
*/
function ajax_mediadetails(){
- global $DEL, $NS, $IMG, $AUTH, $JUMPTO, $REV, $lang, $fullscreen, $conf, $INPUT;
+ global $IMG, $JUMPTO, $REV, $fullscreen, $INPUT;
$fullscreen = true;
require_once(DOKU_INC.'lib/exe/mediamanager.php');
+ $image = '';
if ($INPUT->has('image')) $image = cleanID($INPUT->str('image'));
if (isset($IMG)) $image = $IMG;
if (isset($JUMPTO)) $image = $JUMPTO;
+ $rev = false;
if (isset($REV) && !$JUMPTO) $rev = $REV;
html_msgarea();
@@ -255,6 +252,7 @@ function ajax_mediadiff(){
global $NS;
global $INPUT;
+ $image = '';
if ($INPUT->has('image')) $image = cleanID($INPUT->str('image'));
$NS = $INPUT->post->str('ns');
$auth = auth_quickaclcheck("$NS:*");
@@ -264,6 +262,7 @@ function ajax_mediadiff(){
function ajax_mediaupload(){
global $NS, $MSG, $INPUT;
+ $id = '';
if ($_FILES['qqfile']['tmp_name']) {
$id = $INPUT->post->str('mediaid', $_FILES['qqfile']['name']);
} elseif ($INPUT->get->has('qqfile')) {
@@ -280,19 +279,28 @@ function ajax_mediaupload(){
if ($_FILES['qqfile']['error']) unset($_FILES['qqfile']);
+ $res = false;
if ($_FILES['qqfile']['tmp_name']) $res = media_upload($NS, $AUTH, $_FILES['qqfile']);
if ($INPUT->get->has('qqfile')) $res = media_upload_xhr($NS, $AUTH);
- if ($res) $result = array('success' => true,
- 'link' => media_managerURL(array('ns' => $ns, 'image' => $NS.':'.$id), '&'),
- 'id' => $NS.':'.$id, 'ns' => $NS);
-
- if (!$result) {
+ if($res) {
+ $result = array(
+ 'success' => true,
+ 'link' => media_managerURL(array('ns' => $ns, 'image' => $NS . ':' . $id), '&'),
+ 'id' => $NS . ':' . $id,
+ 'ns' => $NS
+ );
+ } else {
$error = '';
- if (isset($MSG)) {
- foreach($MSG as $msg) $error .= $msg['msg'];
+ if(isset($MSG)) {
+ foreach($MSG as $msg) {
+ $error .= $msg['msg'];
+ }
}
- $result = array('error' => $msg['msg'], 'ns' => $NS);
+ $result = array(
+ 'error' => $error,
+ 'ns' => $NS
+ );
}
$json = new JSON;
echo htmlspecialchars($json->encode($result), ENT_NOQUOTES);
@@ -359,13 +367,11 @@ function ajax_linkwiz(){
$id = cleanID($id);
$nsd = utf8_encodeFN(str_replace(':','/',$ns));
- $idd = utf8_encodeFN(str_replace(':','/',$id));
$data = array();
if($q && !$ns){
// use index to lookup matching pages
- $pages = array();
$pages = ft_pageLookup($id,true);
// result contains matches in pages and namespaces