summaryrefslogtreecommitdiff
path: root/plugins/data.creationtime.php
blob: 4019888a62f6c5c174d1afe0c963da0233253c6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php

namespace Bitweaver\Liberty;

use Bitweaver\KernelTools;

/**
 * @version  $Revision$
 * @package  liberty
 * @subpackage plugins_data
 */
// +----------------------------------------------------------------------+
// | Copyright (c) 2005, bitweaver.org
// +----------------------------------------------------------------------+
// | All Rights Reserved. See below for details and a complete list of authors.
// | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
// |
// | For comments, please use phpdocu.sourceforge.net documentation standards!!!
// | -> see http://phpdocu.sourceforge.net/
// +----------------------------------------------------------------------+
// | Author: James H Thompson (jht@lj.net)
// +----------------------------------------------------------------------+

/**
 * definitions
 */
global $gBitSystem;
// this executes before all packages are registered so can't reliably check isPackageActive here!
define( 'PLUGIN_GUID_DATA_CREATIONTIME', 'datacreationtime' );
global $gLibertySystem;
$pluginParams = [
	'tag'           => 'CREATIONTIME',
	'auto_activate' => true,
	'requires_pair' => false,
	'load_function' => '\data_creationtime',
	'title'         => 'Creation Time',
	'help_page'     => 'DataPluginCreationTime',
	'description'   => KernelTools::tra("This plugin will display the creation time of a page."),
	'help_function' => '\data_creationtime_help',
	'syntax'        => "{creationtime}",
	'plugin_type'   => DATA_PLUGIN,
];
$gLibertySystem->registerPlugin( PLUGIN_GUID_DATA_CREATIONTIME, $pluginParams );
$gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATA_CREATIONTIME );

// Help Routine
function data_creationtime_help() {
	return KernelTools::tra( "Example: " )."{creationtime}<br />";
}

//The actual handler for the plugin
function data_creationtime( $data, $params, &$pCommonObject ) {
	return \Bitweaver\Liberty\smarty_modifier_bit_short_datetime( $pCommonObject->mInfo['created'] );
}