Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pro
bpwiki
Commits
12a0c1cc
Commit
12a0c1cc
authored
Sep 19, 2015
by
Krzysztof Kutt
Browse files
support for templating (2012-06-13)
parent
91c813bc
Changes
5
Hide whitespace changes
Inline
Side-by-side
simplebpmn/action/findtemplate.php
0 → 100644
View file @
12a0c1cc
<?php
/**
* DokuWiki Plugin simplebpmn (Action Component)
*
* Based (and copy & pasted) on http://www.dokuwiki.org/plugin:templatebyname
* plugin by Jan Van Opstal
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Urszula Ciaputa <u.ciaputa@gmail.com>
*/
// must be run within Dokuwiki
if
(
!
defined
(
'DOKU_INC'
))
die
();
if
(
!
defined
(
'DOKU_LF'
))
define
(
'DOKU_LF'
,
"
\n
"
);
if
(
!
defined
(
'DOKU_TAB'
))
define
(
'DOKU_TAB'
,
"
\t
"
);
if
(
!
defined
(
'DOKU_PLUGIN'
))
define
(
'DOKU_PLUGIN'
,
DOKU_INC
.
'lib/plugins/'
);
require_once
DOKU_PLUGIN
.
'action.php'
;
class
action_plugin_simplebpmn_findtemplate
extends
DokuWiki_Action_Plugin
{
public
function
register
(
Doku_Event_Handler
&
$controller
)
{
$controller
->
register_hook
(
'COMMON_PAGETPL_LOAD'
,
'BEFORE'
,
$this
,
'handle_common_pagetpl_load'
);
}
public
function
handle_common_pagetpl_load
(
Doku_Event
&
$event
,
$param
)
{
global
$conf
;
if
(
empty
(
$event
->
data
[
'tpl'
])){
if
(
empty
(
$event
->
data
[
'tplfile'
])){
$path
=
dirname
(
wikiFN
(
$event
->
data
[
'id'
]));
$len
=
strlen
(
rtrim
(
$conf
[
'datadir'
],
'/'
));
$dir
=
substr
(
$path
,
strrpos
(
$path
,
'/'
)
+
1
);
$blnFirst
=
true
;
$blnFirstDir
=
true
;
$partArr
=
explode
(
'_'
,
noNS
(
$event
->
data
[
'id'
]),
2
);
if
(
count
(
$partArr
)
)
{
$part
=
$partArr
[
0
];
while
(
strLen
(
$path
)
>=
$len
){
if
(
$blnFirst
==
true
&&
@
file_exists
(
$path
.
'/_'
.
$part
.
'.txt'
)){
$event
->
data
[
'tplfile'
]
=
$path
.
'/_'
.
$part
.
'.txt'
;
break
;
}
elseif
(
@
file_exists
(
$path
.
'/__'
.
$part
.
'.txt'
)){
$event
->
data
[
'tplfile'
]
=
$path
.
'/__'
.
$part
.
'.txt'
;
break
;
}
elseif
(
$blnFirst
==
true
&&
@
file_exists
(
$path
.
'/_template.txt'
)){
$event
->
data
[
'tplfile'
]
=
$path
.
'/_template.txt'
;
break
;
}
elseif
(
@
file_exists
(
$path
.
'/__template.txt'
)){
$event
->
data
[
'tplfile'
]
=
$path
.
'/__template.txt'
;
break
;
}
$path
=
substr
(
$path
,
0
,
strrpos
(
$path
,
'/'
));
if
(
$blnFirst
==
false
){
$blnFirstDir
=
false
;
}
$blnFirst
=
false
;
}
//fallback to plugin default templates
if
(
empty
(
$event
->
data
[
'tplfile'
])){
$path
=
dirname
(
__FILE__
)
.
'/../templates'
;
if
(
@
file_exists
(
$path
.
'/'
.
$part
.
'.txt'
)
)
{
$event
->
data
[
'tplfile'
]
=
$path
.
'/'
.
$part
.
'.txt'
;
}
}
}
}
$event
->
data
[
'tpl'
]
=
io_readFile
(
$event
->
data
[
'tplfile'
]);
}
if
(
$event
->
data
[
'doreplace'
])
parsePageTemplate
(
$event
->
data
);
}
}
// vim:ts=4:sw=4:et:
simplebpmn/action.php
→
simplebpmn/action
/wysiwyg
.php
View file @
12a0c1cc
...
...
@@ -10,7 +10,7 @@ if (!defined('DOKU_INC')) die();
if
(
!
defined
(
'DOKU_PLUGIN'
))
define
(
'DOKU_PLUGIN'
,
DOKU_INC
.
'lib/plugins/'
);
require_once
(
DOKU_PLUGIN
.
'action.php'
);
class
action_plugin_simplebpmn
extends
DokuWiki_Action_Plugin
{
class
action_plugin_simplebpmn
_wysiwyg
extends
DokuWiki_Action_Plugin
{
/**
* Register the eventhandlers
...
...
simplebpmn/plugin.info.txt
View file @
12a0c1cc
base simplebpmn
author Urszula Ciaputa
email u.ciaputa@gmail.com
date 2012-06-
09
date 2012-06-
13
name simplebpmn plugin
desc Simple plugin that allows rendering of the diagrams specified in SimpleBPMN notation
simplebpmn/templates/process.txt
0 → 100644
View file @
12a0c1cc
====== @!!PAGE@ ======
++++ @!!PAGE@ code |
<bpmn subprocesses=collapse diagram=before>{
name: "@!!PAGE@",
activityType: none|event|call|transaction,
markers: [ subprocess, loop, parallel, sequential, adhoc, compensation ],
events: {
start: {
es_start: ""
},
end: {
ee_end: ""
},
intermediate: {
}
},
activities: {
[[bpmn>@ID@:task_init]]
},
gateways: {
},
flow: {
f1: [ es_start, task_init ],
f2: [ task_init, ee_end ]
}
}</bpmn>
++++
simplebpmn/templates/task.txt
0 → 100644
View file @
12a0c1cc
====== @!!PAGE@ ======
<bpmn subprocesses=collapse diagram=before>{
name: "@!!PAGE@",
type: none|service|send|receive|user|manual|business|script,
activityType: none|call|transaction,
markers: [ subprocess, loop, parallel, sequential, adhoc, compensation ]
}</bpmn>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment