diff options
Diffstat (limited to 'mod/profile/views')
-rw-r--r-- | mod/profile/views/default/profile/css.php | 126 | ||||
-rw-r--r-- | mod/profile/views/default/profile/details.php | 54 | ||||
-rw-r--r-- | mod/profile/views/default/profile/js.php | 9 | ||||
-rw-r--r-- | mod/profile/views/default/profile/metatags.php | 16 | ||||
-rw-r--r-- | mod/profile/views/default/profile/owner_block.php | 66 | ||||
-rw-r--r-- | mod/profile/views/default/profile/wrapper.php | 12 |
6 files changed, 283 insertions, 0 deletions
diff --git a/mod/profile/views/default/profile/css.php b/mod/profile/views/default/profile/css.php new file mode 100644 index 000000000..e24f555a9 --- /dev/null +++ b/mod/profile/views/default/profile/css.php @@ -0,0 +1,126 @@ +<?php +/** + * Elgg Profile CSS + * + * @package Profile + */ +?> +/* *************************************** + Profile +*************************************** */ +.profile { + float: left; + margin-bottom: 15px; +} +.profile .elgg-inner { + margin: 0 5px; + border: 2px solid #eee; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; +} +#profile-details { + padding: 15px; +} +/*** ownerblock ***/ +#profile-owner-block { + width: 200px; + float: left; + background-color: #eee; + padding: 15px; +} +#profile-owner-block .large { + margin-bottom: 10px; +} +#profile-owner-block a.elgg-button-action { + margin-bottom: 4px; + display: table; +} +.profile-content-menu a { + display: block; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + + background-color: white; + margin: 3px 0 5px 0; + padding: 2px 4px 2px 8px; +} +.profile-content-menu a:hover { + background: #0054A7; + color: white; + text-decoration: none; +} +.profile-admin-menu { + display: none; +} +.profile-admin-menu-wrapper a { + display: block; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + + background-color: white; + margin: 3px 0 5px 0; + padding: 2px 4px 2px 8px; +} +.profile-admin-menu-wrapper { + background-color: white; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; +} +.profile-admin-menu-wrapper li a { + background-color: white; + color: red; + margin-bottom: 0; +} +.profile-admin-menu-wrapper a:hover { + color: black; +} +/*** profile details ***/ +#profile-details .odd { + background-color: #f4f4f4; + + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + + margin: 0 0 7px; + padding: 2px 4px; +} +#profile-details .even { + background-color:#f4f4f4; + + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + + margin: 0 0 7px; + padding: 2px 4px; +} +.profile-aboutme-title { + background-color:#f4f4f4; + + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + + margin: 0; + padding: 2px 4px; +} +.profile-aboutme-contents { + padding: 2px 0 0 3px; +} +.profile-banned-user { + border: 2px solid red; + padding: 4px 8px; + + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} diff --git a/mod/profile/views/default/profile/details.php b/mod/profile/views/default/profile/details.php new file mode 100644 index 000000000..7b05b0e15 --- /dev/null +++ b/mod/profile/views/default/profile/details.php @@ -0,0 +1,54 @@ +<?php +/** + * Elgg user display (details) + * @uses $vars['entity'] The user entity + */ + +$user = elgg_get_page_owner_entity(); + +$profile_fields = elgg_get_config('profile_fields'); + +echo '<div id="profile-details" class="elgg-body pll">'; +echo "<h2>{$user->name}</h2>"; + +echo elgg_view("profile/status", array("entity" => $user)); + +$even_odd = null; +if (is_array($profile_fields) && sizeof($profile_fields) > 0) { + foreach ($profile_fields as $shortname => $valtype) { + if ($shortname == "description") { + // skip about me and put at bottom + continue; + } + $value = $user->$shortname; + if (!empty($value)) { + //This function controls the alternating class + $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + ?> + <div class="<?php echo $even_odd; ?>"> + <b><?php echo elgg_echo("profile:{$shortname}"); ?>: </b> + <?php + echo elgg_view("output/{$valtype}", array('value' => $value)); + ?> + </div> + <?php + } + } +} + +if (!elgg_get_config('profile_custom_fields')) { + if ($user->isBanned()) { + echo "<p class='profile-banned-user'>"; + echo elgg_echo('banned'); + echo "</p>"; + } else { + if ($user->description) { + echo "<p class='profile-aboutme-title'><b>" . elgg_echo("profile:aboutme") . "</b></p>"; + echo "<div class='profile-aboutme-contents'>"; + echo elgg_view('output/longtext', array('value' => $user->description, 'class' => 'mtn')); + echo "</div>"; + } + } +} + +echo '</div>';
\ No newline at end of file diff --git a/mod/profile/views/default/profile/js.php b/mod/profile/views/default/profile/js.php new file mode 100644 index 000000000..5a08a90bd --- /dev/null +++ b/mod/profile/views/default/profile/js.php @@ -0,0 +1,9 @@ + +// force the first column to at least be as large as the profile box in cols 2 and 3 +// we also want to run before the widget init happens so priority is < 500 +elgg.register_hook_handler('init', 'system', function() { + // only do this on the profile page's widget canvas. + if ($('.profile').length) { + $('#elgg-widget-col-1').css('min-height', $('.profile').outerHeight(true) + 1); + } +}, 400); diff --git a/mod/profile/views/default/profile/metatags.php b/mod/profile/views/default/profile/metatags.php new file mode 100644 index 000000000..52048b8a7 --- /dev/null +++ b/mod/profile/views/default/profile/metatags.php @@ -0,0 +1,16 @@ +<?php +/** + * FOAF + * + * @package ElggProfile + * + */ + +$owner = elgg_get_page_owner_entity(); + +if (elgg_instanceof($owner, 'user')) { +?> + <link rel="meta" type="application/rdf+xml" title="FOAF" href="<?php echo current_page_url(); ?>?view=foaf" /> +<?php + +} diff --git a/mod/profile/views/default/profile/owner_block.php b/mod/profile/views/default/profile/owner_block.php new file mode 100644 index 000000000..63cb5391a --- /dev/null +++ b/mod/profile/views/default/profile/owner_block.php @@ -0,0 +1,66 @@ +<?php +/** + * Profile owner block + */ + +$user = elgg_get_page_owner_entity(); + +if (!$user) { + // no user so we quit view + echo elgg_echo('viewfailure', array(__FILE__)); + return TRUE; +} + +$icon = elgg_view_entity_icon($user, 'large', array( + 'use_hover' => false, + 'use_link' => false, +)); + +// grab the actions and admin menu items from user hover +$menu = elgg_trigger_plugin_hook('register', "menu:user_hover", array('entity' => $user), array()); +$builder = new ElggMenuBuilder($menu); +$menu = $builder->getMenu(); +$actions = elgg_extract('action', $menu, array()); +$admin = elgg_extract('admin', $menu, array()); + +$profile_actions = ''; +if (elgg_is_logged_in() && $actions) { + $profile_actions = '<ul class="elgg-menu profile-action-menu mvm">'; + foreach ($actions as $action) { + $profile_actions .= '<li>' . $action->getContent(array('class' => 'elgg-button elgg-button-action')) . '</li>'; + } + $profile_actions .= '</ul>'; +} + +// if admin, display admin links +$admin_links = ''; +if (elgg_is_admin_logged_in() && elgg_get_logged_in_user_guid() != elgg_get_page_owner_guid()) { + $text = elgg_echo('admin:options'); + + $admin_links = '<ul class="profile-admin-menu-wrapper">'; + $admin_links .= "<li><a rel=\"toggle\" href=\"#profile-menu-admin\">$text…</a>"; + $admin_links .= '<ul class="profile-admin-menu" id="profile-menu-admin">'; + foreach ($admin as $menu_item) { + $admin_links .= elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); + } + $admin_links .= '</ul>'; + $admin_links .= '</li>'; + $admin_links .= '</ul>'; +} + +// content links +$content_menu = elgg_view_menu('owner_block', array( + 'entity' => elgg_get_page_owner_entity(), + 'class' => 'profile-content-menu', +)); + +echo <<<HTML + +<div id="profile-owner-block"> + $icon + $profile_actions + $content_menu + $admin_links +</div> + +HTML; diff --git a/mod/profile/views/default/profile/wrapper.php b/mod/profile/views/default/profile/wrapper.php new file mode 100644 index 000000000..73b7934f2 --- /dev/null +++ b/mod/profile/views/default/profile/wrapper.php @@ -0,0 +1,12 @@ +<?php +/** + * Profile info box + */ + +?> +<div class="profile elgg-col-2of3"> + <div class="elgg-inner clearfix"> + <?php echo elgg_view('profile/owner_block'); ?> + <?php echo elgg_view('profile/details'); ?> + </div> +</div>
\ No newline at end of file |