diff --git a/action.php b/action.php index fefa9c2..8e0d2ed 100644 --- a/action.php +++ b/action.php @@ -42,12 +42,9 @@ function register(&$controller) { function eventline_hookjs(&$event, $param) { global $INFO; global $ID; - $key = 'keywords'; - - $metadata = p_get_metadata($ID, $key, false); - // keyword timeline used to include timeline javascript files - if (strpos($metadata, 'timeline') !== false) { + // metadata check to include javascript files if needed + if (p_get_metadata($ID, 'plugin eventline')) { $event->data['script'][] = array( 'type' => 'text/javascript', 'charset' => 'utf-8', @@ -126,4 +123,4 @@ function convert(&$event, $param) { header("HTTP/1.1 204 No Content"); exit(); } -} \ No newline at end of file +} diff --git a/syntax.php b/syntax.php index d501df6..bc20182 100644 --- a/syntax.php +++ b/syntax.php @@ -71,6 +71,13 @@ function render($mode, &$R, $data) { global $INFO; global $ID; global $conf; + + // store meta info for this page + if($mode == 'metadata'){ + $R->meta['plugin']['eventline'] = true; + return true; + } + if($mode != 'xhtml') return false; // Initialize settings from user input or conf file if (isset($data['bubbleMaxHeight'])) @@ -185,4 +192,4 @@ function render($mode, &$R, $data) { $R->doc .=' '; return true; } -} \ No newline at end of file +}