Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set Owner for notes in documents. Added utility function for user inf…
…o+smarty wrapper. Display owner name.
- Loading branch information
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,45 @@ | |||
<?php | |||
/** | |||
* Smarty plugin | |||
* @package Smarty | |||
* @subpackage plugins | |||
* user_info() version for smarty templates | |||
* Kevin Yeh 2013 | |||
*/ | |||
|
|||
|
|||
/** | |||
* Smarty {user_info} function plugin | |||
* | |||
* Type: function<br> | |||
* Name: user_info<br> | |||
* Purpose: Return the user info for a given ID<br> | |||
* | |||
* Examples: | |||
* | |||
* {user_info id=1} | |||
* | |||
* @param array | |||
* @param Smarty | |||
*/ | |||
|
|||
require_once(dirname(__FILE__) . '../../user.inc'); | |||
|
|||
function smarty_function_user_info($params, &$smarty) | |||
{ | |||
if (empty($params['id'])) { | |||
$smarty->trigger_error("user_info: missing 'id' parameter"); | |||
return; | |||
} else { | |||
$user_id = $params['id']; | |||
} | |||
|
|||
$user_info=getUserIDInfo($user_id); | |||
if($user_info) | |||
{ | |||
echo $user_info['fname']." ".$user_info['lname']; | |||
} | |||
} | |||
|
|||
|
|||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters