summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/words.aspell.dist5
-rw-r--r--inc/actions.php12
-rw-r--r--inc/config_cascade.php9
-rw-r--r--inc/html.php3
-rw-r--r--inc/lang/ar/lang.php2
-rw-r--r--inc/plugin.php10
-rw-r--r--inc/template.php11
-rw-r--r--lib/exe/css.php61
-rw-r--r--lib/exe/mediamanager.php2
-rw-r--r--lib/scripts/media.js4
-rw-r--r--lib/scripts/toolbar.js2
-rw-r--r--lib/styles/all.css48
-rw-r--r--lib/styles/print.css24
-rw-r--r--lib/styles/screen.css (renamed from lib/styles/style.css)45
-rw-r--r--lib/tpl/default/print.css47
-rw-r--r--lib/tpl/index.php6
16 files changed, 142 insertions, 149 deletions
diff --git a/conf/words.aspell.dist b/conf/words.aspell.dist
deleted file mode 100644
index a49138fcb..000000000
--- a/conf/words.aspell.dist
+++ /dev/null
@@ -1,5 +0,0 @@
-personal_ws-1.1 en 4 utf-8
-DokuWiki
-Wiki
-WikiWiki
-Gohr
diff --git a/inc/actions.php b/inc/actions.php
index 321d928b3..fa11bb7f1 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -18,6 +18,7 @@ if(!defined('DOKU_INC')) die('meh.');
function act_dispatch(){
global $ACT;
global $ID;
+ global $INFO;
global $QUERY;
global $lang;
global $conf;
@@ -134,8 +135,15 @@ function act_dispatch(){
$pluginlist = plugin_list('admin');
if (in_array($_REQUEST['page'], $pluginlist)) {
// attempt to load the plugin
- if ($plugin =& plugin_load('admin',$_REQUEST['page']) !== null)
- $plugin->handle();
+ if ($plugin =& plugin_load('admin',$_REQUEST['page']) !== null){
+ if($plugin->forAdminOnly() && !$INFO['isadmin']){
+ // a manager tried to load a plugin that's for admins only
+ unset($_REQUEST['page']);
+ msg('For admins only',-1);
+ }else{
+ $plugin->handle();
+ }
+ }
}
}
}
diff --git a/inc/config_cascade.php b/inc/config_cascade.php
index 32001be81..48ed5a000 100644
--- a/inc/config_cascade.php
+++ b/inc/config_cascade.php
@@ -49,10 +49,11 @@ $config_cascade = array_merge(
'local' => array(DOKU_CONF.'wordblock.local.conf'),
),
'userstyle' => array(
- 'default' => DOKU_CONF.'userstyle.css',
- 'print' => DOKU_CONF.'printstyle.css',
- 'feed' => DOKU_CONF.'feedstyle.css',
- 'all' => DOKU_CONF.'allstyle.css',
+ 'screen' => DOKU_CONF.'userstyle.css',
+ 'rtl' => DOKU_CONF.'userrtl.css',
+ 'print' => DOKU_CONF.'userprint.css',
+ 'feed' => DOKU_CONF.'userfeed.css',
+ 'all' => DOKU_CONF.'userall.css',
),
'userscript' => array(
'default' => DOKU_CONF.'userscript.js'
diff --git a/inc/html.php b/inc/html.php
index 080beb01a..fcfa54b6c 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -284,7 +284,8 @@ function html_hilight($html,$phrases){
$regex = join('|',array_map('ft_snippet_re_preprocess', array_map('preg_quote_cb',$phrases)));
if ($regex === '') return $html;
- $html = preg_replace_callback("/((<[^>]*)|$regex)/ui",'html_hilight_callback',$html);
+ if (!utf8_check($regex)) return $html;
+ $html = @preg_replace_callback("/((<[^>]*)|$regex)/ui",'html_hilight_callback',$html);
return $html;
}
diff --git a/inc/lang/ar/lang.php b/inc/lang/ar/lang.php
index 300ec3b9a..cc2de9e8b 100644
--- a/inc/lang/ar/lang.php
+++ b/inc/lang/ar/lang.php
@@ -45,7 +45,7 @@ $lang['btn_resendpwd'] = 'ارسل كلمة سر جديدة';
$lang['btn_draft'] = 'حرر المسودة';
$lang['btn_recover'] = 'استرجع المسودة';
$lang['btn_draftdel'] = 'احذف المسوّدة';
-$lang['btn_revert'] = 'استعد
+$lang['btn_revert'] = 'استعد';
$lang['btn_register'] = 'سجّل';
$lang['loggedinas'] = 'داخل باسم';
$lang['user'] = 'اسم المستخدم';
diff --git a/inc/plugin.php b/inc/plugin.php
index 628ae39b0..ec94433b6 100644
--- a/inc/plugin.php
+++ b/inc/plugin.php
@@ -33,7 +33,15 @@ class DokuWiki_Plugin {
$parts = explode('_',get_class($this));
$info = DOKU_PLUGIN.'/'.$parts[2].'/plugin.info.txt';
if(@file_exists($info)) return confToHash($info);
- trigger_error('getInfo() not implemented in '.get_class($this).' and '.$info.' not found', E_USER_WARNING);
+
+ msg('getInfo() not implemented in '.get_class($this).
+ ' and '.$info.' not found.<br />This is a bug in the '.
+ $parts[2].' plugin and should be reported to the '.
+ 'plugin author.',-1);
+ return array(
+ 'date' => '0000-00-00',
+ 'name' => $parts[2].' plugin',
+ );
}
// plugin introspection methods
diff --git a/inc/template.php b/inc/template.php
index d29e3e779..0f0fb92a0 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -209,14 +209,9 @@ function tpl_admin(){
}
if ($plugin !== null){
- if($plugin->forAdminOnly() && !$INFO['isadmin']){
- msg('For admins only',-1);
- html_admin();
- }else{
- if(!is_array($TOC)) $TOC = $plugin->getTOC(); //if TOC wasn't requested yet
- if($INFO['prependTOC']) tpl_toc();
- $plugin->html();
- }
+ if(!is_array($TOC)) $TOC = $plugin->getTOC(); //if TOC wasn't requested yet
+ if($INFO['prependTOC']) tpl_toc();
+ $plugin->html();
}else{
html_admin();
}
diff --git a/lib/exe/css.php b/lib/exe/css.php
index 4db81de0b..98a34860e 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -30,10 +30,10 @@ function css_out(){
global $lang;
global $config_cascade;
- $style = '';
+ $mediatype = 'screen';
if (isset($_REQUEST['s']) &&
in_array($_REQUEST['s'], array('all', 'print', 'feed'))) {
- $style = $_REQUEST['s'];
+ $mediatype = $_REQUEST['s'];
}
$tpl = trim(preg_replace('/[^\w-]+/','',$_REQUEST['t']));
@@ -46,7 +46,7 @@ function css_out(){
}
// The generated script depends on some dynamic options
- $cache = getCacheName('styles'.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'].DOKU_BASE.$tplinc.$style,'.css');
+ $cache = getCacheName('styles'.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'].DOKU_BASE.$tplinc.$mediatype,'.css');
// load template styles
$tplstyles = array();
@@ -60,27 +60,29 @@ function css_out(){
// Array of needed files and their web locations, the latter ones
// are needed to fix relative paths in the stylesheets
$files = array();
- //if (isset($tplstyles['all'])) $files = array_merge($files, $tplstyles['all']);
- if(!empty($style)){
- $files[DOKU_INC.'lib/styles/'.$style.'.css'] = DOKU_BASE.'lib/styles/';
- // load plugin, template, user styles
- $files = array_merge($files, css_pluginstyles($style));
- if (isset($tplstyles[$style])) $files = array_merge($files, $tplstyles[$style]);
-
- if(isset($config_cascade['userstyle'][$style])){
- $files[$config_cascade['userstyle'][$style]] = DOKU_BASE;
- }
- }else{
- $files[DOKU_INC.'lib/styles/style.css'] = DOKU_BASE.'lib/styles/';
- // load plugin, template, user styles
- $files = array_merge($files, css_pluginstyles('screen'));
- if (isset($tplstyles['screen'])) $files = array_merge($files, $tplstyles['screen']);
+ // load core styles
+ $files[DOKU_INC.'lib/styles/'.$mediatype.'.css'] = DOKU_BASE.'lib/styles/';
+ // load plugin styles
+ $files = array_merge($files, css_pluginstyles($mediatype));
+ // load template styles
+ if (isset($tplstyles[$mediatype])) {
+ $files = array_merge($files, $tplstyles[$mediatype]);
+ }
+ // if old 'default' userstyle setting exists, make it 'screen' userstyle for backwards compatibility
+ if (isset($config_cascade['userstyle']['default'])) {
+ $config_cascade['userstyle']['screen'] = $config_cascade['userstyle']['default'];
+ }
+ // load user styles
+ if(isset($config_cascade['userstyle'][$mediatype])){
+ $files[$config_cascade['userstyle'][$mediatype]] = DOKU_BASE;
+ }
+ // load rtl styles
+ // @todo: this currently adds the rtl styles only to the 'screen' media type
+ // but 'print' and 'all' should also be supported
+ if ($mediatype=='screen') {
if($lang['direction'] == 'rtl'){
if (isset($tplstyles['rtl'])) $files = array_merge($files, $tplstyles['rtl']);
}
- if(isset($config_cascade['userstyle']['default'])){
- $files[$config_cascade['userstyle']['default']] = DOKU_BASE;
- }
}
// check cache age & handle conditional request
@@ -122,7 +124,7 @@ function css_out(){
// apply style replacements
$css = css_applystyle($css,$tplinc);
-
+
// place all @import statements at the top of the file
$css = css_moveimports($css);
@@ -278,20 +280,15 @@ function css_loadfile($file,$location=''){
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
-function css_pluginstyles($mode='screen'){
+function css_pluginstyles($mediatype='screen'){
global $lang;
$list = array();
$plugins = plugin_list();
foreach ($plugins as $p){
- if($mode == 'all'){
- $list[DOKU_PLUGIN."$p/all.css"] = DOKU_BASE."lib/plugins/$p/";
- }elseif($mode == 'print'){
- $list[DOKU_PLUGIN."$p/print.css"] = DOKU_BASE."lib/plugins/$p/";
- }elseif($mode == 'feed'){
- $list[DOKU_PLUGIN."$p/feed.css"] = DOKU_BASE."lib/plugins/$p/";
- }else{
+ $list[DOKU_PLUGIN."$p/$mediatype.css"] = DOKU_BASE."lib/plugins/$p/";
+ // alternative for screen.css
+ if ($mediatype=='screen') {
$list[DOKU_PLUGIN."$p/style.css"] = DOKU_BASE."lib/plugins/$p/";
- $list[DOKU_PLUGIN."$p/screen.css"] = DOKU_BASE."lib/plugins/$p/";
}
if($lang['direction'] == 'rtl'){
$list[DOKU_PLUGIN."$p/rtl.css"] = DOKU_BASE."lib/plugins/$p/";
@@ -302,7 +299,7 @@ function css_pluginstyles($mode='screen'){
/**
* Move all @import statements in a combined stylesheet to the top so they
- * aren't ignored by the browser.
+ * aren't ignored by the browser.
*
* @author Gabriel Birke <birke@d-scribe.de>
*/
diff --git a/lib/exe/mediamanager.php b/lib/exe/mediamanager.php
index 6f2add2be..02fde5a8d 100644
--- a/lib/exe/mediamanager.php
+++ b/lib/exe/mediamanager.php
@@ -91,7 +91,7 @@
if ($res & DOKU_MEDIA_EMPTY_NS) {
// current namespace was removed. redirecting to root ns passing msg along
send_redirect(DOKU_URL.'lib/exe/mediamanager.php?msg1='.
- rawurlencode($msg));
+ rawurlencode($msg).'&edid='.$_REQUEST['edid']);
}
msg($msg,1);
} elseif ($res & DOKU_MEDIA_INUSE) {
diff --git a/lib/scripts/media.js b/lib/scripts/media.js
index b90f7047b..57f599163 100644
--- a/lib/scripts/media.js
+++ b/lib/scripts/media.js
@@ -536,7 +536,9 @@ var media_manager = {
}
}
}
- opener.insertTags('wiki__text','{{'+alignleft+id+opts+alignright+'|','}}','');
+ var edid = String.prototype.match.call(document.location, /&edid=([^&]+)/);
+ edid = edid ? edid[1] : 'wiki__text';
+ opener.insertTags(edid,'{{'+alignleft+id+opts+alignright+'|','}}','');
if(!media_manager.keepopen) window.close();
opener.focus();
diff --git a/lib/scripts/toolbar.js b/lib/scripts/toolbar.js
index 3f967448c..d458960ab 100644
--- a/lib/scripts/toolbar.js
+++ b/lib/scripts/toolbar.js
@@ -153,7 +153,7 @@ function tb_insert(btn, props, edid) {
*/
function tb_mediapopup(btn, props, edid) {
window.open(
- DOKU_BASE+props['url']+encodeURIComponent(NS),
+ DOKU_BASE+props['url']+encodeURIComponent(NS)+'&edid='+encodeURIComponent(edid),
props['name'],
props['options']);
return false;
diff --git a/lib/styles/all.css b/lib/styles/all.css
new file mode 100644
index 000000000..dd9f46462
--- /dev/null
+++ b/lib/styles/all.css
@@ -0,0 +1,48 @@
+/**
+ * Basic styles. These styles are needed for basic DokuWiki functions
+ * regardless of the used template. Templates can override them of course
+ */
+
+div.clearer {
+ clear: both;
+ line-height: 0;
+ height: 0;
+ overflow: hidden;
+}
+
+div.no {
+ display: inline;
+ margin: 0;
+ padding: 0;
+}
+
+.hidden {
+ display: none;
+}
+
+/* image alignment */
+.medialeft {
+ float: left;
+}
+.mediaright {
+ float: right;
+}
+.mediacenter {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+/* table cell alignment */
+.leftalign { text-align: left; }
+.centeralign { text-align: center; }
+.rightalign { text-align: right; }
+
+/* underline */
+em.u {
+ font-style: normal;
+ text-decoration: underline;
+}
+em em.u {
+ font-style: italic;
+}
diff --git a/lib/styles/print.css b/lib/styles/print.css
new file mode 100644
index 000000000..16543473a
--- /dev/null
+++ b/lib/styles/print.css
@@ -0,0 +1,24 @@
+/**
+ * Basic styles. These styles are needed for basic DokuWiki functions
+ * regardless of the used template. Templates can override them of course
+ */
+
+/* messages with msg() */
+div.error,
+div.info,
+div.success,
+div.notify {
+ display: none;
+}
+
+/* section edit button */
+.secedit {
+ display: none;
+}
+
+/* modal windows */
+.JSpopup,
+#link__wiz,
+#media__popup {
+ display: none;
+}
diff --git a/lib/styles/style.css b/lib/styles/screen.css
index 395f82b78..0a6a4f295 100644
--- a/lib/styles/style.css
+++ b/lib/styles/screen.css
@@ -3,23 +3,6 @@
* regardless of the used template. Templates can override them of course
*/
-div.clearer {
- clear: both;
- line-height: 0;
- height: 0;
- overflow: hidden;
-}
-
-div.no {
- display: inline;
- margin: 0;
- padding: 0;
-}
-
-.hidden {
- display: none;
-}
-
/* messages with msg() */
div.error,
div.info,
@@ -59,34 +42,6 @@ div.notify {
border-bottom-color: #ffa;
}
-
-/* image alignment */
-.medialeft {
- float: left;
-}
-.mediaright {
- float: right;
-}
-.mediacenter {
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-
-/* table cell alignment */
-.leftalign { text-align: left; }
-.centeralign { text-align: center; }
-.rightalign { text-align: right; }
-
-/* underline */
-em.u {
- font-style: normal;
- text-decoration: underline;
-}
-em em.u {
- font-style: italic;
-}
-
/* modal windows */
.JSpopup,
#link__wiz,
diff --git a/lib/tpl/default/print.css b/lib/tpl/default/print.css
index 15c6dad29..45b60aad2 100644
--- a/lib/tpl/default/print.css
+++ b/lib/tpl/default/print.css
@@ -33,23 +33,10 @@ div.meta {
text-align: right;
}
-
-div.notify,
-div.info,
-div.success,
-div.error,
-div.breadcrumbs,
-div.secedit {
+div.breadcrumbs {
display: none;
}
-div.clearer {
- clear: both;
- line-height: 0;
- height: 0;
- overflow: hidden;
-}
-
/* --------------------- Text formating -------------------------------- */
@@ -110,31 +97,15 @@ img.media {
margin: 3px;
}
+/* the styles for media images are already in
+ lib/styles/all.css, these are additional styles */
img.medialeft {
- border: 0;
- float: left;
margin: 0 1.5em 0 0;
}
-
img.mediaright {
- border: 0;
- float: right;
margin: 0 0 0 1.5em;
}
-
img.mediacenter {
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-
-/* underline */
-em.u {
- font-style: normal;
- text-decoration: underline;
-}
-em em.u {
- font-style: italic;
}
/* unordered lists */
@@ -253,17 +224,5 @@ table.inline td {
border: 1px solid #000000;
}
-.leftalign {
- text-align: left;
-}
-
-.centeralign {
- text-align: center;
-}
-
-.rightalign {
- text-align: right;
-}
-
.toc, .footerinc, .header, .bar, .user { display: none; }
diff --git a/lib/tpl/index.php b/lib/tpl/index.php
index a55081738..20abea20c 100644
--- a/lib/tpl/index.php
+++ b/lib/tpl/index.php
@@ -8,6 +8,9 @@
* @author Andreas Gohr <andi@splitbrain.org>
* @author Anika Henke <anika@selfthinker.org>
*/
+if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../');
+if(!define('NOSESSION')) define('NOSESSION',1);
+require_once(DOKU_INC.'inc/init.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -41,9 +44,6 @@
</head>
<body>
<?php
-if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../');
-require_once(DOKU_INC.'inc/init.php');
-
$ini = @parse_ini_file($conf['template'].'/style.ini',true);
if ($ini) {
echo '<table>';