Fixed some issue
* Fixed PHP Warning when the wiki page is not created * Fixed the author and description method
This commit is contained in:
parent
4cc8b6a330
commit
95f02e1bff
2 changed files with 19 additions and 9 deletions
20
action.php
20
action.php
|
@ -28,7 +28,7 @@ class action_plugin_semantic extends DokuWiki_Action_Plugin {
|
|||
$controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'json_ld');
|
||||
}
|
||||
|
||||
if ($this->getConf('useDescription')) {
|
||||
if ($this->getConf('useMetaDescription')) {
|
||||
$controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'meta_description');
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ class action_plugin_semantic extends DokuWiki_Action_Plugin {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (isset($meta['date'])) {
|
||||
if (isset($meta['date']) && $meta['date'] !== '') {
|
||||
|
||||
$type = ((isset($meta['semantic']['schema.org']['type']))
|
||||
? $meta['semantic']['schema.org']['type']
|
||||
|
@ -161,7 +161,11 @@ class action_plugin_semantic extends DokuWiki_Action_Plugin {
|
|||
|
||||
$meta = $INFO['meta'];
|
||||
|
||||
if ($meta['date'] && $meta['semantic']['enabled']) {
|
||||
if (isset($meta['semantic']['enabled']) && ! $meta['semantic']['enabled']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($meta['date']) && $meta['date'] !== '') {
|
||||
|
||||
$description = str_replace("\n", ' ', trim(ltrim($meta['description']['abstract'], $meta['title'])));
|
||||
|
||||
|
@ -186,9 +190,15 @@ class action_plugin_semantic extends DokuWiki_Action_Plugin {
|
|||
return false;
|
||||
}
|
||||
|
||||
if ($this->getConf('useMetaAuthor') && $INFO['perm'] > 0) {
|
||||
if ($INFO['perm'] > 0) {
|
||||
|
||||
if ($meta['date'] && $meta['semantic']['enabled']) {
|
||||
$meta = $INFO['meta'];
|
||||
|
||||
if (isset($meta['semantic']['enabled']) && ! $meta['semantic']['enabled']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((isset($meta['date']) && $meta['date'] !== '')) {
|
||||
|
||||
$meta = $INFO['meta'];
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
base semantic
|
||||
author Giuseppe Di Terlizzi
|
||||
email giuseppe.diterlizzi@gmail.com
|
||||
date 2015-03-26
|
||||
date 2015-03-30
|
||||
name Semantic Plugin
|
||||
desc Add Semantic Data in Dokuwiki
|
||||
url http://www.dokuwiki.org/plugin:semantic
|
||||
|
|
Loading…
Reference in a new issue