From af4684ac7612e83f2381ef2fc4146358a5a04114 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 15 Feb 2014 11:12:55 +0100 Subject: move geshi highlighting to it's own LESS file --- lib/exe/css.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/exe') diff --git a/lib/exe/css.php b/lib/exe/css.php index f273b7ee4..537885c89 100644 --- a/lib/exe/css.php +++ b/lib/exe/css.php @@ -70,6 +70,10 @@ function css_out(){ $files[$mediatype] = array(); // load core styles $files[$mediatype][DOKU_INC.'lib/styles/'.$mediatype.'.css'] = DOKU_BASE.'lib/styles/'; + if($mediatype == 'screen') { + $files[$mediatype][DOKU_INC.'lib/styles/geshi.less'] = DOKU_BASE.'lib/styles/'; + } + // load jQuery-UI theme if ($mediatype == 'screen') { $files[$mediatype][DOKU_INC.'lib/scripts/jquery/jquery-ui-theme/smoothness.css'] = DOKU_BASE.'lib/scripts/jquery/jquery-ui-theme/'; -- cgit v1.2.3 From 3593102dfd174c90f99e841f66b60269bfb03be9 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sat, 15 Feb 2014 11:37:01 +0000 Subject: included geshi styles per @import, removed from lib/exe/css --- lib/exe/css.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'lib/exe') diff --git a/lib/exe/css.php b/lib/exe/css.php index 537885c89..cab7384b2 100644 --- a/lib/exe/css.php +++ b/lib/exe/css.php @@ -70,9 +70,6 @@ function css_out(){ $files[$mediatype] = array(); // load core styles $files[$mediatype][DOKU_INC.'lib/styles/'.$mediatype.'.css'] = DOKU_BASE.'lib/styles/'; - if($mediatype == 'screen') { - $files[$mediatype][DOKU_INC.'lib/styles/geshi.less'] = DOKU_BASE.'lib/styles/'; - } // load jQuery-UI theme if ($mediatype == 'screen') { -- cgit v1.2.3 From 56b0b744e40b19048e14cee4ff6caf69858d9fd6 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 18 Feb 2014 13:50:12 +0100 Subject: PHPDocs js.php --- lib/exe/js.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/exe') diff --git a/lib/exe/js.php b/lib/exe/js.php index 04413b409..8f16f4a96 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -220,6 +220,12 @@ function js_pluginstrings() { return $pluginstrings; } +/** + * Return an two-dimensional array with strings from the language file of current active template. + * + * - $lang['js'] must be an array. + * - Nothing is returned for template without an entry for $lang['js'] + */ function js_templatestrings() { global $conf; $templatestrings = array(); -- cgit v1.2.3 From 900a9e9e56d360fa7d347304e9b0d4b691d4becc Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 20 Feb 2014 19:25:13 +0100 Subject: replace dir_delete by io_rmdir --- lib/exe/ajax.php | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'lib/exe') diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index 6e2011cd9..203af9c5b 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -298,26 +298,6 @@ function ajax_mediaupload(){ echo htmlspecialchars($json->encode($result), ENT_NOQUOTES); } -function dir_delete($path) { - if (!is_string($path) || $path == "") return false; - - if (is_dir($path) && !is_link($path)) { - if (!$dh = @opendir($path)) return false; - - while ($f = readdir($dh)) { - if ($f == '..' || $f == '.') continue; - dir_delete("$path/$f"); - } - - closedir($dh); - return @rmdir($path); - } else { - return @unlink($path); - } - - return false; -} - /** * Return sub index for index view * -- cgit v1.2.3 From 2472a8f6cbd2abffe712ddd42fe2ad296d03d8f2 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 20 Feb 2014 21:42:31 +0100 Subject: Removed unused vars, define undefined ones --- lib/exe/ajax.php | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'lib/exe') 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 */ function ajax_qsearch(){ - global $conf; global $lang; global $INPUT; @@ -89,15 +88,12 @@ function ajax_qsearch(){ * @author Mike Frysinger */ 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 */ function ajax_medialist(){ - global $conf; global $NS; global $INPUT; @@ -234,13 +229,15 @@ function ajax_medialist(){ * @author Kate Arzamastseva */ 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 -- cgit v1.2.3