Skip to content

Commit

Permalink
Merge pull request #7 from splitbrain/master
Browse files Browse the repository at this point in the history
create the needed metadata in the plugin, don't rely on another plugin
  • Loading branch information
TomCafferty committed Jul 13, 2013
2 parents ad15b02 + 8b81886 commit bf2e639
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
9 changes: 3 additions & 6 deletions action.php
Expand Up @@ -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',
Expand Down Expand Up @@ -126,4 +123,4 @@ function convert(&$event, $param) {
header("HTTP/1.1 204 No Content");
exit();
}
}
}
9 changes: 8 additions & 1 deletion syntax.php
Expand Up @@ -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']))
Expand Down Expand Up @@ -185,4 +192,4 @@ function render($mode, &$R, $data) {
$R->doc .='<script>window.onResize=onResize();</script> ';
return true;
}
}
}

0 comments on commit bf2e639

Please sign in to comment.