Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
98aafb56
Commit
98aafb56
authored
13 years ago
by
Hakan Sandell
Browse files
Options
Downloads
Patches
Plain Diff
Code cleanup documentation before merge
Function get_plugin_components() moved to extantion manager
parent
b838050e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
conf/plugins.protected.php
+5
-0
5 additions, 0 deletions
conf/plugins.protected.php
inc/lang/en/lang.php
+1
-1
1 addition, 1 deletion
inc/lang/en/lang.php
inc/plugincontroller.class.php
+8
-6
8 additions, 6 deletions
inc/plugincontroller.class.php
inc/pluginutils.php
+0
-27
0 additions, 27 deletions
inc/pluginutils.php
with
14 additions
and
34 deletions
conf/plugins.protected.php
+
5
−
0
View file @
98aafb56
<?php
/**
* This file configures the enabled/disabled status of plugins, which are also protected
* from changes by the extention manager. These settings will override any local settings.
* It is not recommended to change this file, as it is overwritten on DokuWiki upgrades.
*/
$plugins
[
'acl'
]
=
1
;
$plugins
[
'plugin'
]
=
1
;
$plugins
[
'config'
]
=
1
;
...
...
This diff is collapsed.
Click to expand it.
inc/lang/en/lang.php
+
1
−
1
View file @
98aafb56
...
...
@@ -318,5 +318,5 @@ $lang['seconds'] = '%d seconds ago';
$lang
[
'wordblock'
]
=
'Your change was not saved because it contains blocked text (spam).'
;
$lang
[
'plugin_insterr'
]
=
"Plugin installed incorrectly. Rename plugin directory '%s' to '%s'."
;
$lang
[
'plugin_inst
all_
err'
]
=
"Plugin installed incorrectly. Rename plugin directory '%s' to '%s'."
;
//Setup VIM: ex: et ts=2 :
This diff is collapsed.
Click to expand it.
inc/plugincontroller.class.php
+
8
−
6
View file @
98aafb56
...
...
@@ -14,7 +14,7 @@ class Doku_Plugin_Controller {
var
$list_bytype
=
array
();
var
$tmp_plugins
=
array
();
var
$plugin_cascade
=
array
(
'default'
=>
array
(),
'local'
=>
array
(),
'protected'
=>
array
());
var
$last_local
=
''
;
var
$last_local
_config_file
=
''
;
//backup of tmp_plugins needed for write check
var
$tmp_bak
=
array
();
...
...
@@ -71,7 +71,8 @@ class Doku_Plugin_Controller {
function
load
(
$type
,
$name
,
$new
=
false
,
$disabled
=
false
){
//we keep all loaded plugins available in global scope for reuse
global
$DOKU_PLUGINS
,
$lang
;
global
$DOKU_PLUGINS
;
global
$lang
;
list
(
$plugin
,
$component
)
=
$this
->
_splitName
(
$name
);
...
...
@@ -98,7 +99,7 @@ class Doku_Plugin_Controller {
$dir
=
$this
->
get_directory
(
$plugin
);
$inf
=
confToHash
(
DOKU_PLUGIN
.
"
$dir
/plugin.info.txt"
);
if
(
$inf
[
'base'
]
&&
$inf
[
'base'
]
!=
$plugin
){
msg
(
sprintf
(
$lang
[
'plugin_insterr'
],
hsc
(
$plugin
),
hsc
(
$inf
[
'base'
])),
-
1
);
msg
(
sprintf
(
$lang
[
'plugin_inst
all_
err'
],
hsc
(
$plugin
),
hsc
(
$inf
[
'base'
])),
-
1
);
}
return
null
;
}
...
...
@@ -129,6 +130,7 @@ class Doku_Plugin_Controller {
protected
function
_populateMasterList
()
{
if
(
$dh
=
@
opendir
(
DOKU_PLUGIN
))
{
$all_plugins
=
array
();
while
(
false
!==
(
$plugin
=
readdir
(
$dh
)))
{
if
(
$plugin
[
0
]
==
'.'
)
continue
;
// skip hidden entries
if
(
is_file
(
DOKU_PLUGIN
.
$plugin
))
continue
;
// skip files, we're only interested in directories
...
...
@@ -188,7 +190,7 @@ class Doku_Plugin_Controller {
$local_plugins
=
$this
->
rebuildLocal
();
//only write if the list has changed
if
(
$local_plugins
!=
$this
->
plugin_cascade
[
'local'
])
{
$file
=
$this
->
last_local
;
$file
=
$this
->
last_local
_config_file
;
$out
=
"<?php
\n
"
;
foreach
(
$local_plugins
as
$plugin
=>
$value
)
{
$out
.
=
"
\$
plugins['
$plugin
'] =
$value
;
\n
"
;
...
...
@@ -243,8 +245,8 @@ class Doku_Plugin_Controller {
$this
->
plugin_cascade
[
$type
]
=
$this
->
checkRequire
(
$config_cascade
[
'plugins'
][
$type
]);
}
$local
=
$config_cascade
[
'plugins'
][
'local'
];
$this
->
last_local
=
array_pop
(
$local
);
$this
->
plugin_cascade
[
'local'
]
=
$this
->
checkRequire
(
array
(
$this
->
last_local
));
$this
->
last_local
_config_file
=
array_pop
(
$local
);
$this
->
plugin_cascade
[
'local'
]
=
$this
->
checkRequire
(
array
(
$this
->
last_local
_config_file
));
if
(
is_array
(
$local
))
{
$this
->
plugin_cascade
[
'default'
]
=
array_merge
(
$this
->
plugin_cascade
[
'default'
],
$this
->
checkRequire
(
$local
));
}
...
...
This diff is collapsed.
Click to expand it.
inc/pluginutils.php
+
0
−
27
View file @
98aafb56
...
...
@@ -40,30 +40,3 @@ function plugin_getcascade() {
global
$plugin_controller
;
return
$plugin_controller
->
getCascade
();
}
/**
* return a list (name & type) of all the component plugins that make up this plugin
*
*/
function
get_plugin_components
(
$plugin
)
{
global
$plugin_types
;
static
$plugins
;
if
(
empty
(
$plugins
[
$plugin
]))
{
$components
=
array
();
$path
=
DOKU_PLUGIN
.
plugin_directory
(
$plugin
)
.
'/'
;
foreach
(
$plugin_types
as
$type
)
{
if
(
@
file_exists
(
$path
.
$type
.
'.php'
))
{
$components
[]
=
array
(
'name'
=>
$plugin
,
'type'
=>
$type
);
continue
;
}
if
(
$dh
=
@
opendir
(
$path
.
$type
.
'/'
))
{
while
(
false
!==
(
$cp
=
readdir
(
$dh
)))
{
if
(
$cp
==
'.'
||
$cp
==
'..'
||
strtolower
(
substr
(
$cp
,
-
4
))
!=
'.php'
)
continue
;
$components
[]
=
array
(
'name'
=>
$plugin
.
'_'
.
substr
(
$cp
,
0
,
-
4
),
'type'
=>
$type
);
}
closedir
(
$dh
);
}
}
$plugins
[
$plugin
]
=
$components
;
}
return
$plugins
[
$plugin
];
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment