[geeklog-cvs] geeklog: More owner-related template variables for the Static Pa...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Dec 13 10:43:17 EST 2009
changeset 7522:450d18b0273d
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/450d18b0273d
user: Dirk Haun <dirk at haun-online.de>
date: Sat Dec 12 20:25:50 2009 +0100
description:
More owner-related template variables for the Static Pages editor
diffstat:
public_html/admin/plugins/staticpages/index.php | 46 ++++++++++++++++++++---
1 files changed, 40 insertions(+), 6 deletions(-)
diffs (64 lines):
diff -r 286d5782c3b8 -r 450d18b0273d public_html/admin/plugins/staticpages/index.php
--- a/public_html/admin/plugins/staticpages/index.php Sat Dec 12 17:24:33 2009 +0100
+++ b/public_html/admin/plugins/staticpages/index.php Sat Dec 12 20:25:50 2009 +0100
@@ -68,7 +68,7 @@
{
global $_CONF, $_TABLES, $_USER, $_GROUPS, $_SP_CONF, $mode, $sp_id,
$LANG21, $LANG_STATIC, $LANG_ACCESS, $LANG_ADMIN, $LANG24,
- $LANG_postmodes, $MESSAGE;
+ $LANG_postmodes, $MESSAGE, $_IMAGE_TYPE;
$template_path = staticpages_templatePath('admin');
if (!empty($sp_id) && $mode=='edit') {
@@ -140,12 +140,46 @@
$sp_template->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
$sp_template->set_var('lang_owner', $LANG_ACCESS['owner']);
- $ownername = COM_getDisplayName($A['owner_id']);
- $sp_template->set_var('owner_username', DB_getItem($_TABLES['users'],
- 'username', "uid = {$A['owner_id']}"));
- $sp_template->set_var('owner_name', $ownername);
- $sp_template->set_var('owner', $ownername);
+
+ $owner_name = COM_getDisplayName($A['owner_id']);
+ $owner_username = DB_getItem($_TABLES['users'], 'username',
+ "uid = {$A['owner_id']}");
+ $profile_link = $_CONF['site_url']
+ . '/users.php?mode=profile&uid=' . $A['owner_id'];
+
$sp_template->set_var('owner_id', $A['owner_id']);
+ $sp_template->set_var('owner', $owner_name);
+ $sp_template->set_var('owner_name', $owner_name);
+ $sp_template->set_var('owner_username', $owner_username);
+
+ if ($A['owner_id'] > 1) {
+ $sp_template->set_var('start_owner_anchortag',
+ '<a href="' . $profile_link . '">' );
+ $sp_template->set_var('end_owner_anchortag', '</a>');
+ $sp_template->set_var('owner_link',
+ COM_createLink($owner_name, $profile_link));
+
+ $photo = '';
+ if ($_CONF['allow_user_photo']) {
+ $photo = DB_getItem($_TABLES['users'], 'photo',
+ "uid = {$A['owner_id']}");
+ if (! empty($photo)) {
+ $camera_icon = '<img src="' . $_CONF['layout_url']
+ . '/images/smallcamera.' . $_IMAGE_TYPE
+ . '" alt=""' . XHTML . '>';
+ $sp_template->set_var('camera_icon',
+ COM_createLink($camera_icon, $profile_link));
+ }
+ }
+ if (empty($photo)) {
+ $sp_template->set_var('camera_icon', '');
+ }
+ } else {
+ $sp_template->set_var('start_owner_anchortag', '');
+ $sp_template->set_var('end_owner_anchortag', '');
+ $sp_template->set_var('owner_link', $owner_username);
+ }
+
$sp_template->set_var('lang_group', $LANG_ACCESS['group']);
$sp_template->set_var('group_dropdown',
SEC_getGroupDropdown($A['group_id'], $access));
More information about the geeklog-cvs
mailing list