Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M3P2 HTML Generator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
12
Issues
12
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
M3P2
M3P2 HTML Generator
Commits
d7764e0d
Commit
d7764e0d
authored
Mar 19, 2019
by
Administrator
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up the M3P2 plugin.
parent
b2d91018
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
28 deletions
+5
-28
m3-p2.php
user/plugins/m3-p2/m3-p2.php
+5
-28
No files found.
user/plugins/m3-p2/m3-p2.php
View file @
d7764e0d
...
@@ -3,10 +3,11 @@ namespace Grav\Plugin;
...
@@ -3,10 +3,11 @@ namespace Grav\Plugin;
use
Grav\Common\Page\Page
;
use
Grav\Common\Page\Page
;
use
Grav\Common\Plugin
;
use
Grav\Common\Plugin
;
use
mysql_xdevapi\Exception
;
use
RocketTheme\Toolbox\Event\Event
;
/**
/**
* Features:
* - /sync Cheap git-sync (did not knew about it at the time)
*
* Class M3P2Plugin
* Class M3P2Plugin
* @package Grav\Plugin
* @package Grav\Plugin
*/
*/
...
@@ -39,13 +40,6 @@ class M3P2Plugin extends Plugin
...
@@ -39,13 +40,6 @@ class M3P2Plugin extends Plugin
return
;
return
;
}
}
// // Enable the main event we are interested in
// $this->enable([
// 'onPageContentRaw' => ['onPageContentRaw', 0]
// ]);
$uri
=
$this
->
grav
[
'uri'
];
$uri
=
$this
->
grav
[
'uri'
];
$route
=
$this
->
config
->
get
(
'plugins.m3-p2.route'
);
$route
=
$this
->
config
->
get
(
'plugins.m3-p2.route'
);
// throw new \Exception($route." - ".$uri->path());
// throw new \Exception($route." - ".$uri->path());
...
@@ -57,24 +51,6 @@ class M3P2Plugin extends Plugin
...
@@ -57,24 +51,6 @@ class M3P2Plugin extends Plugin
}
}
}
}
// /**
// * Do some work for this event, full details of events can be found
// * on the learn site: http://learn.getgrav.org/plugins/event-hooks
// *
// * @param Event $e
// */
// public function onPageContentRaw(Event $e)
// {
// // Get a variable from the plugin configuration
// $text = $this->grav['config']->get('plugins.m3-p2.text_var');
//
// // Get the current raw content
// $content = $e['page']->getRawContent();
//
// // Prepend the output with the custom text and set back on the page
// $e['page']->setRawContent($text . "\n\n" . $content);
// }
/**
/**
* Send user to a random page
* Send user to a random page
*/
*/
...
@@ -84,7 +60,8 @@ class M3P2Plugin extends Plugin
...
@@ -84,7 +60,8 @@ class M3P2Plugin extends Plugin
# shell pwd is project root
# shell pwd is project root
$out
.=
shell_exec
(
"cd user/pages && git pull --rebase --autostash origin master 2>&1"
)
.
"
\n
"
;
$out
.=
shell_exec
(
"cd user/pages && git pull --rebase --autostash origin master 2>&1"
)
.
"
\n
"
;
$out
.=
shell_exec
(
"fortune | cowsay -e Oø -f dragon"
)
.
"
\n
"
;
$out
.=
shell_exec
(
"fortune"
)
.
"
\n
"
;
//$out .= shell_exec("fortune | cowsay -e Oø -f dragon") . "\n";
$out
.=
"Done."
;
$out
.=
"Done."
;
...
...
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