diff options
Diffstat (limited to 'mod/profile/views/default')
41 files changed, 246 insertions, 2354 deletions
diff --git a/mod/profile/views/default/admin/appearance/defaultprofile.php b/mod/profile/views/default/admin/appearance/defaultprofile.php deleted file mode 100644 index 7c498780b..000000000 --- a/mod/profile/views/default/admin/appearance/defaultprofile.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Elgg profile - Admin area: edit default profile fields - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ - -$title = elgg_view_title(elgg_echo('profile:edit:default')); -$form = elgg_view('profile/editdefaultprofile'); - -// List form elements -$n = 0; -$loaded_defaults = array(); -$items = array(); -if ($fieldlist = get_plugin_setting('user_defined_fields', 'profile')) { - $fieldlistarray = explode(',', $fieldlist); - foreach($fieldlistarray as $listitem) { - if ($translation = get_plugin_setting("admin_defined_profile_{$listitem}", 'profile')) { - $item = new stdClass; - $item->translation = $translation; - $item->shortname = $listitem; - $item->name = "admin_defined_profile_{$listitem}"; - $item->type = get_plugin_setting("admin_defined_profile_type_{$listitem}", 'profile'); - $items[] = $item; - } - } -} - -$listing = elgg_view('profile/editdefaultprofileitems',array('items' => $items, 'fieldlist' => $fieldlist)); - -$resetlisting = elgg_view('input/form', - array ( - 'body' => elgg_view('input/submit', array('value' => elgg_echo('profile:resetdefault'), 'class' => 'action_button disabled')), - 'action' => $CONFIG->wwwroot . 'action/profile/editdefault/reset' - ) - ); - -$body = <<<__HTML -$title -$form -$listing -<div class="default_profile_reset"> - $resetlisting -</div> -__HTML; - -echo $body; diff --git a/mod/profile/views/default/icon/user/default/large.php b/mod/profile/views/default/icon/user/default/large.php deleted file mode 100644 index 3ce382532..000000000 --- a/mod/profile/views/default/icon/user/default/large.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - echo $vars['url'] . "mod/profile/graphics/defaultlarge.gif"; -?>
\ No newline at end of file diff --git a/mod/profile/views/default/icon/user/default/master.php b/mod/profile/views/default/icon/user/default/master.php deleted file mode 100644 index 7c5ea847c..000000000 --- a/mod/profile/views/default/icon/user/default/master.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - echo $vars['url'] . "mod/profile/graphics/defaultmaster.gif"; -?>
\ No newline at end of file diff --git a/mod/profile/views/default/icon/user/default/medium.php b/mod/profile/views/default/icon/user/default/medium.php deleted file mode 100644 index d5f6db343..000000000 --- a/mod/profile/views/default/icon/user/default/medium.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - echo $vars['url'] . "mod/profile/graphics/defaultmedium.gif"; -?>
\ No newline at end of file diff --git a/mod/profile/views/default/icon/user/default/small.php b/mod/profile/views/default/icon/user/default/small.php deleted file mode 100644 index 55f113c41..000000000 --- a/mod/profile/views/default/icon/user/default/small.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - echo $vars['url'] . "mod/profile/graphics/defaultsmall.gif"; -?>
\ No newline at end of file diff --git a/mod/profile/views/default/icon/user/default/tiny.php b/mod/profile/views/default/icon/user/default/tiny.php deleted file mode 100644 index e47cdd3da..000000000 --- a/mod/profile/views/default/icon/user/default/tiny.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - echo $vars['url'] . "mod/profile/graphics/defaulttiny.gif"; -?>
\ No newline at end of file diff --git a/mod/profile/views/default/icon/user/default/topbar.php b/mod/profile/views/default/icon/user/default/topbar.php deleted file mode 100644 index ad11588fa..000000000 --- a/mod/profile/views/default/icon/user/default/topbar.php +++ /dev/null @@ -1,3 +0,0 @@ -<?php - echo $vars['url'] . "mod/profile/graphics/defaulttopbar.gif"; -?>
\ No newline at end of file diff --git a/mod/profile/views/default/js/jquery.imgareaselect-0.8.js b/mod/profile/views/default/js/jquery.imgareaselect-0.8.js deleted file mode 100644 index 456114755..000000000 --- a/mod/profile/views/default/js/jquery.imgareaselect-0.8.js +++ /dev/null @@ -1,635 +0,0 @@ -/* - * imgAreaSelect jQuery plugin - * version 0.8 - * - * Copyright (c) 2008-2009 Michal Wojciechowski (odyniec.net) - * - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://odyniec.net/projects/imgareaselect/ - * - */ - -(function($) { - -$.imgAreaSelect = { onKeyPress: null }; - -$.imgAreaSelect.init = function (img, options) { - var $img = $(img), imgLoaded, $box = $('<div />'), $area = $('<div />'), - $border1 = $('<div />'), $border2 = $('<div />'), $areaOpera, - $outLeft = $('<div />'), $outTop = $('<div />'), - $outRight = $('<div />'), $outBottom = $('<div />'), - $handles = $([]), handleWidth, handles = [ ], left, top, M = Math, - imgOfs, imgWidth, imgHeight, $parent, parOfs, - zIndex = 0, position = 'absolute', $p, startX, startY, - scaleX = 1, scaleY = 1, resizeMargin = 10, resize = [ ], V = 0, H = 1, - d, aspectRatio, x1, x2, y1, y2, x, y, adjusted, shown, i, - selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 }; - - var $o = $outLeft.add($outTop).add($outRight).add($outBottom); - - function viewX(x) - { - return x + imgOfs.left - parOfs.left; - } - - function viewY(y) - { - return y + imgOfs.top - parOfs.top; - } - - function selX(x) - { - return x - imgOfs.left + parOfs.left; - } - - function selY(y) - { - return y - imgOfs.top + parOfs.top; - } - - function evX(event) - { - return event.pageX - parOfs.left; - } - - function evY(event) - { - return event.pageY - parOfs.top; - } - - function trueSelection() - { - return { x1: M.round(selection.x1 * scaleX), - y1: M.round(selection.y1 * scaleY), - x2: M.round(selection.x2 * scaleX), - y2: M.round(selection.y2 * scaleY), - width: M.round(selection.x2 * scaleX) - M.round(selection.x1 * scaleX), - height: M.round(selection.y2 * scaleY) - M.round(selection.y1 * scaleY) }; - } - - function getZIndex() - { - $p = $img; - - while ($p.length && !$p.is('body')) { - if (!isNaN($p.css('z-index')) && $p.css('z-index') > zIndex) - zIndex = $p.css('z-index'); - if ($p.css('position') == 'fixed') - position = 'fixed'; - - $p = $p.parent(); - } - - if (!isNaN(options.zIndex)) - zIndex = options.zIndex; - } - - function adjust() - { - imgOfs = { left: M.round($img.offset().left), top: M.round($img.offset().top) }; - imgWidth = $img.width(); - imgHeight = $img.height(); - - if ($().jquery == '1.3.2' && $.browser.safari && position == 'fixed') { - imgOfs.top += M.max(document.documentElement.scrollTop, $('body').scrollTop()); - imgOfs.left += M.max(document.documentElement.scrollLeft, $('body').scrollLeft()); - } - - parOfs = $.inArray($parent.css('position'), ['absolute', 'relative']) != -1 ? - { left: M.round($parent.offset().left) - $parent.scrollLeft(), - top: M.round($parent.offset().top) - $parent.scrollTop() } : - position == 'fixed' ? - { left: $(document).scrollLeft(), top: $(document).scrollTop() } : - { left: 0, top: 0 }; - - left = viewX(0); - top = viewY(0); - } - - function update(resetKeyPress) - { - if (!shown) return; - - $box.css({ - left: viewX(selection.x1) + 'px', top: viewY(selection.y1) + 'px', - width: selection.width + 'px', height: selection.height + 'px' - }); - $area.add($border1).add($border2).css({ - left: '0px', top: '0px', - width: M.max(selection.width - options.borderWidth * 2, 0) + 'px', - height: M.max(selection.height - options.borderWidth * 2, 0) + 'px' - }); - $border1.css({ borderStyle: 'solid', borderColor: options.borderColor1 }); - $border2.css({ borderStyle: 'dashed', borderColor: options.borderColor2 }); - $border1.add($border2).css({ opacity: options.borderOpacity }); - $outLeft.css({ left: left + 'px', top: top + 'px', - width: selection.x1 + 'px', height: imgHeight + 'px' }); - $outTop.css({ left: left + selection.x1 + 'px', top: top + 'px', - width: selection.width + 'px', height: selection.y1 + 'px' }); - $outRight.css({ left: left + selection.x2 + 'px', top: top + 'px', - width: imgWidth - selection.x2 + 'px', height: imgHeight + 'px' }); - $outBottom.css({ left: left + selection.x1 + 'px', top: top + selection.y2 + 'px', - width: selection.width + 'px', height: imgHeight - selection.y2 + 'px' }); - - if (handles.length) { - handles[1].css({ left: selection.width - handleWidth + 'px' }); - handles[2].css({ left: selection.width - handleWidth + 'px', - top: selection.height - handleWidth + 'px' }); - handles[3].css({ top: selection.height - handleWidth + 'px' }); - - if (handles.length == 8) { - handles[4].css({ left: (selection.width - handleWidth) / 2 + 'px' }); - handles[5].css({ left: selection.width - handleWidth + 'px', - top: (selection.height - handleWidth) / 2 + 'px' }); - handles[6].css({ left: (selection.width - handleWidth) / 2 + 'px', - top: selection.height - handleWidth + 'px' }); - handles[7].css({ top: (selection.height - handleWidth) / 2 + 'px' }); - } - } - - if (resetKeyPress !== false) { - if ($.imgAreaSelect.keyPress != docKeyPress) - $(document).unbind($.imgAreaSelect.keyPress, - $.imgAreaSelect.onKeyPress); - - if (options.keys) - $(document).bind($.imgAreaSelect.keyPress, - $.imgAreaSelect.onKeyPress = docKeyPress); - } - - if ($.browser.msie && options.borderWidth == 1 && options.borderOpacity < 1) { - $border1.add($border2).css('margin', '0'); - setTimeout(function () { $border1.add($border2).css('margin', 'auto'); }, 0); - } - } - - function areaMouseMove(event) - { - if (!adjusted) { - adjust(); - adjusted = true; - - $box.one('mouseout', function () { adjusted = false; }); - } - - x = selX(evX(event)) - selection.x1; - y = selY(evY(event)) - selection.y1; - - resize = [ ]; - - if (options.resizable) { - if (y <= resizeMargin) - resize[V] = 'n'; - else if (y >= selection.height - resizeMargin) - resize[V] = 's'; - if (x <= resizeMargin) - resize[H] = 'w'; - else if (x >= selection.width - resizeMargin) - resize[H] = 'e'; - } - - $box.css('cursor', resize.length ? resize.join('') + '-resize' : - options.movable ? 'move' : ''); - if ($areaOpera) - $areaOpera.toggle(); - } - - function docMouseUp(event) - { - resize = [ ]; - - $('body').css('cursor', ''); - - if (options.autoHide || selection.width * selection.height == 0) - $box.add($o).hide(); - - options.onSelectEnd(img, trueSelection()); - - $(document).unbind('mousemove', selectingMouseMove); - $box.mousemove(areaMouseMove); - } - - function areaMouseDown(event) - { - if (event.which != 1) return false; - - adjust(); - - if (options.resizable && resize.length > 0) { - $('body').css('cursor', resize.join('') + '-resize'); - - x1 = viewX(selection[resize[H] == 'w' ? 'x2' : 'x1']); - y1 = viewY(selection[resize[V] == 'n' ? 'y2' : 'y1']); - - $(document).mousemove(selectingMouseMove) - .one('mouseup', docMouseUp); - $box.unbind('mousemove', areaMouseMove); - } - else if (options.movable) { - startX = left + selection.x1 - evX(event); - startY = top + selection.y1 - evY(event); - - $box.unbind('mousemove', areaMouseMove); - - $(document).mousemove(movingMouseMove) - .one('mouseup', function () { - options.onSelectEnd(img, trueSelection()); - - $(document).unbind('mousemove', movingMouseMove); - $box.mousemove(areaMouseMove); - }); - } - else - $img.mousedown(event); - - return false; - } - - function aspectRatioXY() - { - x2 = M.max(left, M.min(left + imgWidth, - x1 + M.abs(y2 - y1) * aspectRatio * (x2 < x1 ? -1 : 1))); - y2 = M.round(M.max(top, M.min(top + imgHeight, - y1 + M.abs(x2 - x1) / aspectRatio * (y2 < y1 ? -1 : 1)))); - x2 = M.round(x2); - } - - function aspectRatioYX() - { - y2 = M.max(top, M.min(top + imgHeight, - y1 + M.abs(x2 - x1) / aspectRatio * (y2 < y1 ? -1 : 1))); - x2 = M.round(M.max(left, M.min(left + imgWidth, - x1 + M.abs(y2 - y1) * aspectRatio * (x2 < x1 ? -1 : 1)))); - y2 = M.round(y2); - } - - function doResize() - { - if (options.minWidth && M.abs(x2 - x1) < options.minWidth) { - x2 = x1 - options.minWidth * (x2 < x1 ? 1 : -1); - - if (x2 < left) - x1 = left + options.minWidth; - else if (x2 > left + imgWidth) - x1 = left + imgWidth - options.minWidth; - } - - if (options.minHeight && M.abs(y2 - y1) < options.minHeight) { - y2 = y1 - options.minHeight * (y2 < y1 ? 1 : -1); - - if (y2 < top) - y1 = top + options.minHeight; - else if (y2 > top + imgHeight) - y1 = top + imgHeight - options.minHeight; - } - - x2 = M.max(left, M.min(x2, left + imgWidth)); - y2 = M.max(top, M.min(y2, top + imgHeight)); - - if (aspectRatio) - if (M.abs(x2 - x1) / aspectRatio > M.abs(y2 - y1)) - aspectRatioYX(); - else - aspectRatioXY(); - - if (options.maxWidth && M.abs(x2 - x1) > options.maxWidth) { - x2 = x1 - options.maxWidth * (x2 < x1 ? 1 : -1); - if (aspectRatio) aspectRatioYX(); - } - - if (options.maxHeight && M.abs(y2 - y1) > options.maxHeight) { - y2 = y1 - options.maxHeight * (y2 < y1 ? 1 : -1); - if (aspectRatio) aspectRatioXY(); - } - - selection = { x1: selX(M.min(x1, x2)), x2: selX(M.max(x1, x2)), - y1: selY(M.min(y1, y2)), y2: selY(M.max(y1, y2)), - width: M.abs(x2 - x1), height: M.abs(y2 - y1) }; - - update(); - - options.onSelectChange(img, trueSelection()); - } - - function selectingMouseMove(event) - { - x2 = !resize.length || resize[H] || aspectRatio ? evX(event) : viewX(selection.x2); - y2 = !resize.length || resize[V] || aspectRatio ? evY(event) : viewY(selection.y2); - - doResize(); - - return false; - } - - function doMove(newX1, newY1) - { - x2 = (x1 = newX1) + selection.width; - y2 = (y1 = newY1) + selection.height; - - selection = $.extend(selection, { x1: selX(x1), y1: selY(y1), - x2: selX(x2), y2: selY(y2) }); - - update(); - - options.onSelectChange(img, trueSelection()); - } - - function movingMouseMove(event) - { - x1 = M.max(left, M.min(startX + evX(event), left + imgWidth - selection.width)); - y1 = M.max(top, M.min(startY + evY(event), top + imgHeight - selection.height)); - - doMove(x1, y1); - - event.preventDefault(); - return false; - } - - function startSelection(event) - { - adjust(); - - x2 = x1; - y2 = y1; - doResize(); - - resize = [ ]; - - $box.add($o.is(':visible') ? null : $o).show(); - shown = true; - - $(document).unbind('mouseup', cancelSelection) - .mousemove(selectingMouseMove).one('mouseup', docMouseUp); - $box.unbind('mousemove', areaMouseMove); - - options.onSelectStart(img, trueSelection()); - } - - function cancelSelection() - { - $(document).unbind('mousemove', startSelection); - $box.add($o).hide(); - - selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 }; - - options.onSelectChange(img, selection); - options.onSelectEnd(img, selection); - } - - function imgMouseDown(event) - { - if (event.which != 1) return false; - - adjust(); - startX = x1 = evX(event); - startY = y1 = evY(event); - - $(document).one('mousemove', startSelection) - .one('mouseup', cancelSelection); - - return false; - } - - function parentScroll() - { - adjust(); - update(false); - x1 = viewX(selection.x1); y1 = viewY(selection.y1); - x2 = viewX(selection.x2); y2 = viewY(selection.y2); - } - - function imgLoad() - { - imgLoaded = true; - - if (options.show) { - shown = true; - adjust(); - update(); - $box.add($o).show(); - } - - $box.add($o).css({ visibility: '' }); - } - - var docKeyPress = function(event) { - var k = options.keys, d, t, key = event.keyCode || event.which; - - d = !isNaN(k.alt) && (event.altKey || event.originalEvent.altKey) ? k.alt : - !isNaN(k.ctrl) && event.ctrlKey ? k.ctrl : - !isNaN(k.shift) && event.shiftKey ? k.shift : - !isNaN(k.arrows) ? k.arrows : 10; - - if (k.arrows == 'resize' || (k.shift == 'resize' && event.shiftKey) || - (k.ctrl == 'resize' && event.ctrlKey) || - (k.alt == 'resize' && (event.altKey || event.originalEvent.altKey))) - { - switch (key) { - case 37: - d = -d; - case 39: - t = M.max(x1, x2); - x1 = M.min(x1, x2); - x2 = M.max(t + d, x1); - if (aspectRatio) aspectRatioYX(); - break; - case 38: - d = -d; - case 40: - t = M.max(y1, y2); - y1 = M.min(y1, y2); - y2 = M.max(t + d, y1); - if (aspectRatio) aspectRatioXY(); - break; - default: - return; - } - - doResize(); - } - else { - x1 = M.min(x1, x2); - y1 = M.min(y1, y2); - - switch (key) { - case 37: - doMove(M.max(x1 - d, left), y1); - break; - case 38: - doMove(x1, M.max(y1 - d, top)); - break; - case 39: - doMove(x1 + M.min(d, imgWidth - selX(x2)), y1); - break; - case 40: - doMove(x1, y1 + M.min(d, imgHeight - selY(y2))); - break; - default: - return; - } - } - - return false; - }; - - this.setOptions = function(newOptions) - { - if (newOptions.parent) - ($parent = $(newOptions.parent)).append($box.add($o)); - - adjust(); - getZIndex(); - - if (newOptions.x1 != null) { - selection = { x1: newOptions.x1, y1: newOptions.y1, - x2: newOptions.x2, y2: newOptions.y2 }; - newOptions.show = !newOptions.hide; - - x1 = viewX(selection.x1); y1 = viewY(selection.y1); - x2 = viewX(selection.x2); y2 = viewY(selection.y2); - selection.width = x2 - x1; - selection.height = y2 - y1; - } - - if (newOptions.handles != null) { - $handles.remove(); - $handles = $(handles = [ ]); - - i = newOptions.handles ? newOptions.handles == 'corners' ? 4 : 8 : 0; - - while (i--) - $handles = $handles.add(handles[i] = $('<div />')); - - handleWidth = 4 + options.borderWidth; - - $handles.css({ position: 'absolute', borderWidth: options.borderWidth + 'px', - borderStyle: 'solid', borderColor: options.borderColor1, - opacity: options.borderOpacity, backgroundColor: options.borderColor2, - width: handleWidth + 'px', height: handleWidth + 'px', - fontSize: '0px', zIndex: zIndex > 0 ? zIndex + 1 : '1' }) - .addClass(options.classPrefix + '-handle'); - - handleWidth += options.borderWidth * 2; - } - - update(); - - options = $.extend(options, newOptions); - - if (options.imageWidth || options.imageHeight) { - scaleX = (parseInt(options.imageWidth) || imgWidth) / imgWidth; - scaleY = (parseInt(options.imageHeight) || imgHeight) / imgHeight; - } - - if (newOptions.keys) - options.keys = $.extend({ shift: 1, ctrl: 'resize' }, - newOptions.keys === true ? { } : newOptions.keys); - - $o.addClass(options.classPrefix + '-outer'); - $area.addClass(options.classPrefix + '-selection'); - $border1.addClass(options.classPrefix + '-border1'); - $border2.addClass(options.classPrefix + '-border2'); - - $box.add($area).add($border1).add($border2).css({ borderWidth: options.borderWidth + 'px' }); - $area.css({ backgroundColor: options.selectionColor, opacity: options.selectionOpacity }); - $border1.css({ borderStyle: 'solid', borderColor: options.borderColor1 }); - $border2.css({ borderStyle: 'dashed', borderColor: options.borderColor2 }); - $border1.add($border2).css({ opacity: options.borderOpacity }); - $o.css({ opacity: options.outerOpacity, backgroundColor: options.outerColor }); - - $box.append($area.add($border1).add($border2).add($handles).add($areaOpera)); - - if (newOptions.hide) - $box.add($o).hide(); - else if (newOptions.show && imgLoaded) { - shown = true; - update(); - $box.add($o).show(); - } - - aspectRatio = options.aspectRatio && (d = options.aspectRatio.split(/:/)) ? - d[0] / d[1] : null; - - if (aspectRatio) - if (options.minWidth) - options.minHeight = parseInt(options.minWidth / aspectRatio); - else if (options.minHeight) - options.minWidth = parseInt(options.minHeight * aspectRatio); - - if (options.disable || options.enable === false) { - $box.unbind('mousemove', areaMouseMove).unbind('mousedown', areaMouseDown); - $img.add($o).unbind('mousedown', imgMouseDown); - $(window).unbind('resize', parentScroll); - $img.add($img.parents()).unbind('scroll', parentScroll); - } - else if (options.enable || options.disable === false) { - if (options.resizable || options.movable) - $box.mousemove(areaMouseMove).mousedown(areaMouseDown); - - if (!options.persistent) - $img.add($o).mousedown(imgMouseDown); - $(window).resize(parentScroll); - $img.add($img.parents()).scroll(parentScroll); - } - - options.enable = options.disable = undefined; - }; - - if ($.browser.msie) - $img.attr('unselectable', 'on'); - - $.imgAreaSelect.keyPress = $.browser.msie || - $.browser.safari ? 'keydown' : 'keypress'; - - if ($.browser.opera) - ($areaOpera = $('<div style="width: 100%; height: 100%; position: absolute;" />')) - .css({ zIndex: zIndex > 0 ? zIndex + 2 : '2' }); - - this.setOptions(options = $.extend({ - borderColor1: '#000', - borderColor2: '#fff', - borderWidth: 1, - borderOpacity: .5, - classPrefix: 'imgareaselect', - movable: true, - resizable: true, - selectionColor: '#fff', - selectionOpacity: 0, - outerColor: '#000', - outerOpacity: .4, - parent: 'body', - onSelectStart: function () {}, - onSelectChange: function () {}, - onSelectEnd: function () {} - }, options)); - - $box.add($o).css({ visibility: 'hidden', position: position, - overflow: 'hidden', zIndex: zIndex > 0 ? zIndex : '0' }); - $area.css({ borderStyle: 'solid' }); - $box.css({ position: position, zIndex: zIndex > 0 ? zIndex + 2 : '2' }); - $area.add($border1).add($border2).css({ position: 'absolute' }); - - img.complete || img.readyState == 'complete' || !$img.is('img') ? - imgLoad() : $img.one('load', imgLoad); -}; - -$.fn.imgAreaSelect = function (options) { - options = options || {}; - - this.each(function () { - if ($(this).data('imgAreaSelect')) - $(this).data('imgAreaSelect').setOptions(options); - else { - if (options.enable === undefined && options.disable === undefined) - options.enable = true; - - $(this).data('imgAreaSelect', new $.imgAreaSelect.init(this, options)); - } - }); - - return this; -}; - -})(jQuery); diff --git a/mod/profile/views/default/js/jquery.imgareaselect-0.8.min.js b/mod/profile/views/default/js/jquery.imgareaselect-0.8.min.js deleted file mode 100644 index d9605de1d..000000000 --- a/mod/profile/views/default/js/jquery.imgareaselect-0.8.min.js +++ /dev/null @@ -1 +0,0 @@ -(function($){$.imgAreaSelect={onKeyPress:null};$.imgAreaSelect.init=function(img,options){var $img=$(img),imgLoaded,$box=$('<div />'),$area=$('<div />'),$border1=$('<div />'),$border2=$('<div />'),$areaOpera,$outLeft=$('<div />'),$outTop=$('<div />'),$outRight=$('<div />'),$outBottom=$('<div />'),$handles=$([]),handleWidth,handles=[],left,top,M=Math,imgOfs,imgWidth,imgHeight,$parent,parOfs,zIndex=0,position='absolute',$p,startX,startY,scaleX=1,scaleY=1,resizeMargin=10,resize=[],V=0,H=1,d,aspectRatio,x1,x2,y1,y2,x,y,adjusted,shown,i,selection={x1:0,y1:0,x2:0,y2:0,width:0,height:0};var $o=$outLeft.add($outTop).add($outRight).add($outBottom);function viewX(x){return x+imgOfs.left-parOfs.left}function viewY(y){return y+imgOfs.top-parOfs.top}function selX(x){return x-imgOfs.left+parOfs.left}function selY(y){return y-imgOfs.top+parOfs.top}function evX(event){return event.pageX-parOfs.left}function evY(event){return event.pageY-parOfs.top}function trueSelection(){return{x1:M.round(selection.x1*scaleX),y1:M.round(selection.y1*scaleY),x2:M.round(selection.x2*scaleX),y2:M.round(selection.y2*scaleY),width:M.round(selection.x2*scaleX)-M.round(selection.x1*scaleX),height:M.round(selection.y2*scaleY)-M.round(selection.y1*scaleY)}}function getZIndex(){$p=$img;while($p.length&&!$p.is('body')){if(!isNaN($p.css('z-index'))&&$p.css('z-index')>zIndex)zIndex=$p.css('z-index');if($p.css('position')=='fixed')position='fixed';$p=$p.parent()}if(!isNaN(options.zIndex))zIndex=options.zIndex}function adjust(){imgOfs={left:M.round($img.offset().left),top:M.round($img.offset().top)};imgWidth=$img.width();imgHeight=$img.height();if($().jquery=='1.3.2'&&$.browser.safari&&position=='fixed'){imgOfs.top+=M.max(document.documentElement.scrollTop,$('body').scrollTop());imgOfs.left+=M.max(document.documentElement.scrollLeft,$('body').scrollLeft())}parOfs=$.inArray($parent.css('position'),['absolute','relative'])!=-1?{left:M.round($parent.offset().left)-$parent.scrollLeft(),top:M.round($parent.offset().top)-$parent.scrollTop()}:position=='fixed'?{left:$(document).scrollLeft(),top:$(document).scrollTop()}:{left:0,top:0};left=viewX(0);top=viewY(0)}function update(resetKeyPress){if(!shown)return;$box.css({left:viewX(selection.x1)+'px',top:viewY(selection.y1)+'px',width:selection.width+'px',height:selection.height+'px'});$area.add($border1).add($border2).css({left:'0px',top:'0px',width:M.max(selection.width-options.borderWidth*2,0)+'px',height:M.max(selection.height-options.borderWidth*2,0)+'px'});$border1.css({borderStyle:'solid',borderColor:options.borderColor1});$border2.css({borderStyle:'dashed',borderColor:options.borderColor2});$border1.add($border2).css({opacity:options.borderOpacity});$outLeft.css({left:left+'px',top:top+'px',width:selection.x1+'px',height:imgHeight+'px'});$outTop.css({left:left+selection.x1+'px',top:top+'px',width:selection.width+'px',height:selection.y1+'px'});$outRight.css({left:left+selection.x2+'px',top:top+'px',width:imgWidth-selection.x2+'px',height:imgHeight+'px'});$outBottom.css({left:left+selection.x1+'px',top:top+selection.y2+'px',width:selection.width+'px',height:imgHeight-selection.y2+'px'});if(handles.length){handles[1].css({left:selection.width-handleWidth+'px'});handles[2].css({left:selection.width-handleWidth+'px',top:selection.height-handleWidth+'px'});handles[3].css({top:selection.height-handleWidth+'px'});if(handles.length==8){handles[4].css({left:(selection.width-handleWidth)/2+'px'});handles[5].css({left:selection.width-handleWidth+'px',top:(selection.height-handleWidth)/2+'px'});handles[6].css({left:(selection.width-handleWidth)/2+'px',top:selection.height-handleWidth+'px'});handles[7].css({top:(selection.height-handleWidth)/2+'px'})}}if(resetKeyPress!==false){if($.imgAreaSelect.keyPress!=docKeyPress)$(document).unbind($.imgAreaSelect.keyPress,$.imgAreaSelect.onKeyPress);if(options.keys)$(document).bind($.imgAreaSelect.keyPress,$.imgAreaSelect.onKeyPress=docKeyPress)}if($.browser.msie&&options.borderWidth==1&&options.borderOpacity<1){$border1.add($border2).css('margin','0');setTimeout(function(){$border1.add($border2).css('margin','auto')},0)}}function areaMouseMove(event){if(!adjusted){adjust();adjusted=true;$box.one('mouseout',function(){adjusted=false})}x=selX(evX(event))-selection.x1;y=selY(evY(event))-selection.y1;resize=[];if(options.resizable){if(y<=resizeMargin)resize[V]='n';else if(y>=selection.height-resizeMargin)resize[V]='s';if(x<=resizeMargin)resize[H]='w';else if(x>=selection.width-resizeMargin)resize[H]='e'}$box.css('cursor',resize.length?resize.join('')+'-resize':options.movable?'move':'');if($areaOpera)$areaOpera.toggle()}function docMouseUp(event){resize=[];$('body').css('cursor','');if(options.autoHide||selection.width*selection.height==0)$box.add($o).hide();options.onSelectEnd(img,trueSelection());$(document).unbind('mousemove',selectingMouseMove);$box.mousemove(areaMouseMove)}function areaMouseDown(event){if(event.which!=1)return false;adjust();if(options.resizable&&resize.length>0){$('body').css('cursor',resize.join('')+'-resize');x1=viewX(selection[resize[H]=='w'?'x2':'x1']);y1=viewY(selection[resize[V]=='n'?'y2':'y1']);$(document).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove)}else if(options.movable){startX=left+selection.x1-evX(event);startY=top+selection.y1-evY(event);$box.unbind('mousemove',areaMouseMove);$(document).mousemove(movingMouseMove).one('mouseup',function(){options.onSelectEnd(img,trueSelection());$(document).unbind('mousemove',movingMouseMove);$box.mousemove(areaMouseMove)})}else $img.mousedown(event);return false}function aspectRatioXY(){x2=M.max(left,M.min(left+imgWidth,x1+M.abs(y2-y1)*aspectRatio*(x2<x1?-1:1)));y2=M.round(M.max(top,M.min(top+imgHeight,y1+M.abs(x2-x1)/aspectRatio*(y2<y1?-1:1))));x2=M.round(x2)}function aspectRatioYX(){y2=M.max(top,M.min(top+imgHeight,y1+M.abs(x2-x1)/aspectRatio*(y2<y1?-1:1)));x2=M.round(M.max(left,M.min(left+imgWidth,x1+M.abs(y2-y1)*aspectRatio*(x2<x1?-1:1))));y2=M.round(y2)}function doResize(){if(options.minWidth&&M.abs(x2-x1)<options.minWidth){x2=x1-options.minWidth*(x2<x1?1:-1);if(x2<left)x1=left+options.minWidth;else if(x2>left+imgWidth)x1=left+imgWidth-options.minWidth}if(options.minHeight&&M.abs(y2-y1)<options.minHeight){y2=y1-options.minHeight*(y2<y1?1:-1);if(y2<top)y1=top+options.minHeight;else if(y2>top+imgHeight)y1=top+imgHeight-options.minHeight}x2=M.max(left,M.min(x2,left+imgWidth));y2=M.max(top,M.min(y2,top+imgHeight));if(aspectRatio)if(M.abs(x2-x1)/aspectRatio>M.abs(y2-y1))aspectRatioYX();else aspectRatioXY();if(options.maxWidth&&M.abs(x2-x1)>options.maxWidth){x2=x1-options.maxWidth*(x2<x1?1:-1);if(aspectRatio)aspectRatioYX()}if(options.maxHeight&&M.abs(y2-y1)>options.maxHeight){y2=y1-options.maxHeight*(y2<y1?1:-1);if(aspectRatio)aspectRatioXY()}selection={x1:selX(M.min(x1,x2)),x2:selX(M.max(x1,x2)),y1:selY(M.min(y1,y2)),y2:selY(M.max(y1,y2)),width:M.abs(x2-x1),height:M.abs(y2-y1)};update();options.onSelectChange(img,trueSelection())}function selectingMouseMove(event){x2=!resize.length||resize[H]||aspectRatio?evX(event):viewX(selection.x2);y2=!resize.length||resize[V]||aspectRatio?evY(event):viewY(selection.y2);doResize();return false}function doMove(newX1,newY1){x2=(x1=newX1)+selection.width;y2=(y1=newY1)+selection.height;selection=$.extend(selection,{x1:selX(x1),y1:selY(y1),x2:selX(x2),y2:selY(y2)});update();options.onSelectChange(img,trueSelection())}function movingMouseMove(event){x1=M.max(left,M.min(startX+evX(event),left+imgWidth-selection.width));y1=M.max(top,M.min(startY+evY(event),top+imgHeight-selection.height));doMove(x1,y1);event.preventDefault();return false}function startSelection(event){adjust();x2=x1;y2=y1;doResize();resize=[];$box.add($o.is(':visible')?null:$o).show();shown=true;$(document).unbind('mouseup',cancelSelection).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove);options.onSelectStart(img,trueSelection())}function cancelSelection(){$(document).unbind('mousemove',startSelection);$box.add($o).hide();selection={x1:0,y1:0,x2:0,y2:0,width:0,height:0};options.onSelectChange(img,selection);options.onSelectEnd(img,selection)}function imgMouseDown(event){if(event.which!=1)return false;adjust();startX=x1=evX(event);startY=y1=evY(event);$(document).one('mousemove',startSelection).one('mouseup',cancelSelection);return false}function parentScroll(){adjust();update(false);x1=viewX(selection.x1);y1=viewY(selection.y1);x2=viewX(selection.x2);y2=viewY(selection.y2)}function imgLoad(){imgLoaded=true;if(options.show){shown=true;adjust();update();$box.add($o).show()}$box.add($o).css({visibility:''})}var docKeyPress=function(event){var k=options.keys,d,t,key=event.keyCode||event.which;d=!isNaN(k.alt)&&(event.altKey||event.originalEvent.altKey)?k.alt:!isNaN(k.ctrl)&&event.ctrlKey?k.ctrl:!isNaN(k.shift)&&event.shiftKey?k.shift:!isNaN(k.arrows)?k.arrows:10;if(k.arrows=='resize'||(k.shift=='resize'&&event.shiftKey)||(k.ctrl=='resize'&&event.ctrlKey)||(k.alt=='resize'&&(event.altKey||event.originalEvent.altKey))){switch(key){case 37:d=-d;case 39:t=M.max(x1,x2);x1=M.min(x1,x2);x2=M.max(t+d,x1);if(aspectRatio)aspectRatioYX();break;case 38:d=-d;case 40:t=M.max(y1,y2);y1=M.min(y1,y2);y2=M.max(t+d,y1);if(aspectRatio)aspectRatioXY();break;default:return}doResize()}else{x1=M.min(x1,x2);y1=M.min(y1,y2);switch(key){case 37:doMove(M.max(x1-d,left),y1);break;case 38:doMove(x1,M.max(y1-d,top));break;case 39:doMove(x1+M.min(d,imgWidth-selX(x2)),y1);break;case 40:doMove(x1,y1+M.min(d,imgHeight-selY(y2)));break;default:return}}return false};this.setOptions=function(newOptions){if(newOptions.parent)($parent=$(newOptions.parent)).append($box.add($o));adjust();getZIndex();if(newOptions.x1!=null){selection={x1:newOptions.x1,y1:newOptions.y1,x2:newOptions.x2,y2:newOptions.y2};newOptions.show=!newOptions.hide;x1=viewX(selection.x1);y1=viewY(selection.y1);x2=viewX(selection.x2);y2=viewY(selection.y2);selection.width=x2-x1;selection.height=y2-y1}if(newOptions.handles!=null){$handles.remove();$handles=$(handles=[]);i=newOptions.handles?newOptions.handles=='corners'?4:8:0;while(i--)$handles=$handles.add(handles[i]=$('<div />'));handleWidth=4+options.borderWidth;$handles.css({position:'absolute',borderWidth:options.borderWidth+'px',borderStyle:'solid',borderColor:options.borderColor1,opacity:options.borderOpacity,backgroundColor:options.borderColor2,width:handleWidth+'px',height:handleWidth+'px',fontSize:'0px',zIndex:zIndex>0?zIndex+1:'1'}).addClass(options.classPrefix+'-handle');handleWidth+=options.borderWidth*2}update();options=$.extend(options,newOptions);if(options.imageWidth||options.imageHeight){scaleX=(parseInt(options.imageWidth)||imgWidth)/imgWidth;scaleY=(parseInt(options.imageHeight)||imgHeight)/imgHeight}if(newOptions.keys)options.keys=$.extend({shift:1,ctrl:'resize'},newOptions.keys===true?{}:newOptions.keys);$o.addClass(options.classPrefix+'-outer');$area.addClass(options.classPrefix+'-selection');$border1.addClass(options.classPrefix+'-border1');$border2.addClass(options.classPrefix+'-border2');$box.add($area).add($border1).add($border2).css({borderWidth:options.borderWidth+'px'});$area.css({backgroundColor:options.selectionColor,opacity:options.selectionOpacity});$border1.css({borderStyle:'solid',borderColor:options.borderColor1});$border2.css({borderStyle:'dashed',borderColor:options.borderColor2});$border1.add($border2).css({opacity:options.borderOpacity});$o.css({opacity:options.outerOpacity,backgroundColor:options.outerColor});$box.append($area.add($border1).add($border2).add($handles).add($areaOpera));if(newOptions.hide)$box.add($o).hide();else if(newOptions.show&&imgLoaded){shown=true;update();$box.add($o).show()}aspectRatio=options.aspectRatio&&(d=options.aspectRatio.split(/:/))?d[0]/d[1]:null;if(aspectRatio)if(options.minWidth)options.minHeight=parseInt(options.minWidth/aspectRatio);else if(options.minHeight)options.minWidth=parseInt(options.minHeight*aspectRatio);if(options.disable||options.enable===false){$box.unbind('mousemove',areaMouseMove).unbind('mousedown',areaMouseDown);$img.add($o).unbind('mousedown',imgMouseDown);$(window).unbind('resize',parentScroll);$img.add($img.parents()).unbind('scroll',parentScroll)}else if(options.enable||options.disable===false){if(options.resizable||options.movable)$box.mousemove(areaMouseMove).mousedown(areaMouseDown);if(!options.persistent)$img.add($o).mousedown(imgMouseDown);$(window).resize(parentScroll);$img.add($img.parents()).scroll(parentScroll)}options.enable=options.disable=undefined};if($.browser.msie)$img.attr('unselectable','on');$.imgAreaSelect.keyPress=$.browser.msie||$.browser.safari?'keydown':'keypress';if($.browser.opera)($areaOpera=$('<div style="width: 100%; height: 100%; position: absolute;" />')).css({zIndex:zIndex>0?zIndex+2:'2'});this.setOptions(options=$.extend({borderColor1:'#000',borderColor2:'#fff',borderWidth:1,borderOpacity:.5,classPrefix:'imgareaselect',movable:true,resizable:true,selectionColor:'#fff',selectionOpacity:0,outerColor:'#000',outerOpacity:.4,parent:'body',onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},options));$box.add($o).css({visibility:'hidden',position:position,overflow:'hidden',zIndex:zIndex>0?zIndex:'0'});$area.css({borderStyle:'solid'});$box.css({position:position,zIndex:zIndex>0?zIndex+2:'2'});$area.add($border1).add($border2).css({position:'absolute'});img.complete||img.readyState=='complete'||!$img.is('img')?imgLoad():$img.one('load',imgLoad)};$.fn.imgAreaSelect=function(options){options=options||{};this.each(function(){if($(this).data('imgAreaSelect'))$(this).data('imgAreaSelect').setOptions(options);else{if(options.enable===undefined&&options.disable===undefined)options.enable=true;$(this).data('imgAreaSelect',new $.imgAreaSelect.init(this,options))}});return this}})(jQuery);
\ No newline at end of file diff --git a/mod/profile/views/default/profile/admin_menu.php b/mod/profile/views/default/profile/admin_menu.php deleted file mode 100755 index c89505673..000000000 --- a/mod/profile/views/default/profile/admin_menu.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * This is the admin menu that appears on a user's profile page - **/ -global $CONFIG; - -if (isadminloggedin()){ - if ($_SESSION['id']!=page_owner()){ - $user = get_user(page_owner()); - $url = $vars['url']; - $ts = time(); - $token = generate_action_token($ts); - -?> -<div class="owner_block_links"> -<ul class="admin_menu"> -<li><a href="#" onclick="elgg_slide_toggle(this,'.owner_block_links','.admin_menu_options');">Admin options…</a> - - <ul class="admin_menu_options"> - <li><a href="<?php echo $url; ?>pg/settings/user/<?php echo $user->username; ?>/"><?php echo elgg_echo('profile:editdetails'); ?></a></li> - <?php - if (!$user->isBanned()) { - echo "<li>".elgg_view('output/confirmlink', array('text' => elgg_echo("ban"), 'href' => "{$url}action/admin/user/ban?guid={$user->guid}&__elgg_token=$token&__elgg_ts=$ts")) . "</li>"; - } else { - echo "<li>".elgg_view('output/confirmlink', array('text' => elgg_echo("unban"), 'href' => "{$url}action/admin/user/unban?guid={$user->guid}&__elgg_token=$token&__elgg_ts=$ts")) . "</li>"; - } - echo "<li>".elgg_view('output/confirmlink', array('text' => elgg_echo("delete"), 'href' => "{$url}action/admin/user/delete?guid={$user->guid}&__elgg_token=$token&__elgg_ts=$ts")) . "</li>"; - echo "<li>".elgg_view('output/confirmlink', array('text' => elgg_echo("resetpassword"), 'href' => "{$url}action/admin/user/resetpassword?guid={$user->guid}&__elgg_token=$token&__elgg_ts=$ts")) . "</li>"; - if (!$vars['entity']->admin) { - echo "<li>".elgg_view('output/confirmlink', array('text' => elgg_echo("makeadmin"), 'href' => "{$url}action/admin/user/makeadmin?guid={$user->guid}&__elgg_token=$token&__elgg_ts=$ts")) . "</li>"; - } else { - echo "<li>".elgg_view('output/confirmlink', array('text' => elgg_echo("removeadmin"), 'href' => "{$url}action/admin/user/removeadmin?guid={$user->guid}&__elgg_token=$token&__elgg_ts=$ts")) . "</li>"; - } - ?> - </ul> -</li> -</ul> -</div> -<?php - } -} -?> diff --git a/mod/profile/views/default/profile/commentwall/commentwall.php b/mod/profile/views/default/profile/commentwall/commentwall.php deleted file mode 100644 index a45c3adde..000000000 --- a/mod/profile/views/default/profile/commentwall/commentwall.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * Elgg Commentwall display page - */ -//start the div which will wrap all the message board contents -echo "<div id='comment_wall_display'>"; - -// If there is any content to view, view it -if (is_array($vars['annotation']) && sizeof($vars['annotation']) > 0) { - //loop through all annotations and display - foreach($vars['annotation'] as $content) { - echo elgg_view("profile/commentwall/commentwall_content", array('annotation' => $content)); - } -} else { - echo "<p class='margin_top'>" . elgg_echo("profile:commentwall:none") . "</p>"; -} -//close the wrapper div -echo "</div>";
\ No newline at end of file diff --git a/mod/profile/views/default/profile/commentwall/commentwall_content.php b/mod/profile/views/default/profile/commentwall/commentwall_content.php deleted file mode 100644 index cacea117c..000000000 --- a/mod/profile/views/default/profile/commentwall/commentwall_content.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -/** -* Elgg Message board individual item display page - */ -?> -<div class="entity_listing clearfloat"> - <!-- display the user icon of the user that posted the message --> - <div class="entity_listing_icon"> - <?php - echo elgg_view("profile/icon",array('entity' => get_entity($vars['annotation']->owner_guid), 'size' => 'tiny')); - ?> - </div> - - <div class="entity_listing_info"> - <?php - // if the user looking at the comment can edit, show the delete link - if ($vars['annotation']->canEdit()) { - echo "<div class='entity_metadata'><span class='delete_button'>" . elgg_view("output/confirmlink",array( - 'href' => $vars['url'] . "action/profile/deletecomment?annotation_id=" . $vars['annotation']->id, - 'text' => elgg_echo('delete'), - 'confirm' => elgg_echo('deleteconfirm'), - )) . "</span></div>"; - } //end of can edit if statement - ?> - <!-- display the user's name who posted and the date/time --> - <p class="entity_subtext"> - <?php echo get_entity($vars['annotation']->owner_guid)->name . " " . friendly_time($vars['annotation']->time_created); ?> - </p> - <!-- output the actual comment --> - <?php echo elgg_view("output/longtext",array("value" => parse_urls($vars['annotation']->value))); ?> - </div> -</div> diff --git a/mod/profile/views/default/profile/commentwall/commentwalladd.php b/mod/profile/views/default/profile/commentwall/commentwalladd.php deleted file mode 100644 index f5bd1bdce..000000000 --- a/mod/profile/views/default/profile/commentwall/commentwalladd.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * Elgg profile comment wall add - */ -?> -<div id="comment_wall_add"> -<form action="<?php echo $vars['url']; ?>action/profile/addcomment" method="post" name="messageboardForm"> - <!-- textarea for the contents --> - <textarea name="message_content" value="" class="commentwall"></textarea><br /> - <!-- the person posting an item on the message board --> - <input type="hidden" name="guid" value="<?php echo $_SESSION['guid']; ?>" /> - <!-- the page owner, this will be the profile owner --> - <input type="hidden" name="pageOwner" value="<?php echo page_owner(); ?>" /> - <?php echo elgg_view('input/securitytoken'); ?> - <!-- submit messages input --> - <input type="submit" id="postit" value="<?php echo elgg_echo('profile:commentwall:add'); ?>"> -</form> -</div> diff --git a/mod/profile/views/default/profile/css.php b/mod/profile/views/default/profile/css.php index 78c496670..e24f555a9 100644 --- a/mod/profile/views/default/profile/css.php +++ b/mod/profile/views/default/profile/css.php @@ -1,487 +1,126 @@ <?php /** - * Elgg Profile + * Elgg Profile CSS * * @package Profile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ */ ?> /* *************************************** - main layout blocks + Profile *************************************** */ -#profile_content { - float:right; - width:700px; - position: relative; -} -#profile_sidebar { - width:230px; - float:left; -} -.elgg_horizontal_tabbed_nav.profile { - margin-top:0px; - margin-bottom:25px; - position:relative; -} -.elgg_horizontal_tabbed_nav.profile .profile_name { - display:block; - width:265px; - position:absolute; -} -.elgg_horizontal_tabbed_nav.profile .profile_name h2 { - margin:0; - padding:0; - border:none; -} -.elgg_horizontal_tabbed_nav.profile ul { - margin-left:260px; -} - -/* *************************************** - default avatar icons -*************************************** */ -.usericon { - position:relative; -} -.usericon.tiny, -img.tiny { - width:25px; - height:25px; - /* remove the border-radius if you don't want rounded avatars in supported browsers */ - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - -moz-background-clip: border; - - -o-background-size: 25px; - -webkit-background-size: 25px; - -khtml-background-size: 25px; - -moz-background-size: 25px; +.profile { + float: left; + margin-bottom: 15px; } -.usericon.small, -img.small { - width:40px; - height:40px; - /* remove the border-radius if you don't want rounded avatars in supported browsers */ - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - -moz-background-clip: border; +.profile .elgg-inner { + margin: 0 5px; + border: 2px solid #eee; - -o-background-size: 40px; - -webkit-background-size: 40px; - -khtml-background-size: 40px; - -moz-background-size: 40px; -} -img.large { - width:200px; - height:200px; -} -img.medium { - width:100px; - height:100px; -} - -/* *************************************** - ownerblock in sidebar -*************************************** */ -#profile_sidebar #owner_block { - background-color: #eeeeee; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - padding:15px; - min-height:270px; -} -#elgg_sidebar #owner_block { - background-color: white; - -webkit-border-radius: 8px; + -webkit-border-radius: 8px; -moz-border-radius: 8px; - padding:5px; - margin-bottom:10px; -} -#owner_block .owner_block_icon { - float:left; - padding:0; - margin:0; + border-radius: 8px; } -#owner_block .owner_block_icon.large { - width:200px; - height:200px; - overflow: hidden; - float:none; +#profile-details { + padding: 15px; } -#owner_block .owner_block_contents { - margin-left: 50px; -} -#elgg_sidebar #owner_block .owner_block_contents { - margin-left: 34px; -} -#owner_block .owner_block_contents h3 { - margin-top:-4px; - border-bottom:none; - margin-bottom:0; - padding-bottom:0; -} -#owner_block .owner_block_contents p.profile_info { - margin:0; - padding:0; - color: #666666; -} -#owner_block .owner_block_contents p.profile_info.briefdescription { - font-size: 90%; - line-height:1.2em; - font-style: italic; -} -#owner_block .owner_block_contents p.profile_info.location { - font-size: 90%; +/*** ownerblock ***/ +#profile-owner-block { + width: 200px; + float: left; + background-color: #eee; + padding: 15px; } -#owner_block .profile_actions { - margin-top:10px; +#profile-owner-block .large { + margin-bottom: 10px; } -#owner_block .profile_actions a.action_button { - margin-bottom:4px; +#profile-owner-block a.elgg-button-action { + margin-bottom: 4px; display: table; } -/* ownerblock links to owners tools */ -#owner_block .owners_content_links { - border-top:1px dotted #cccccc; - margin-top:4px; - padding-top:2px; -} -#owner_block .owners_content_links ul { - margin:0; - padding:0; -} -#owner_block .owners_content_links ul li { - display:block; - float:left; - width:95px; - font-size: 90%; -} -/* profile pages - ownerblock links to owners tools */ -.owner_block_links { - margin-top:5px; -} -.owner_block_links ul { - margin:0; - padding:0; - list-style: none; -} -.owner_block_links ul li.selected a { - background: #4690D6; - color:white; -} -.owner_block_links ul li a { - display:block; - -webkit-border-radius: 8px; +.profile-content-menu a { + display: block; + + -webkit-border-radius: 8px; -moz-border-radius: 8px; - background-color:white; - margin:3px 0 5px 0; - padding:2px 4px 2px 8px; + border-radius: 8px; + + background-color: white; + margin: 3px 0 5px 0; + padding: 2px 4px 2px 8px; } -.owner_block_links ul li a:hover { - background:#0054A7; - color:white; - text-decoration:none; +.profile-content-menu a:hover { + background: #0054A7; + color: white; + text-decoration: none; } - - -/* *************************************** - admin menu in sidebar -*************************************** */ -.owner_block_links .admin_menu_options { +.profile-admin-menu { display: none; } -.owner_block_links ul.admin_menu { - background-color:white; +.profile-admin-menu-wrapper a { + display: block; + -webkit-border-radius: 8px; -moz-border-radius: 8px; - cursor:pointer; -} -.owner_block_links ul.admin_menu li a { + border-radius: 8px; + background-color: white; - color:red; - margin-bottom:0; + margin: 3px 0 5px 0; + padding: 2px 4px 2px 8px; } -.owner_block_links ul.admin_menu li a:hover { - color:black; +.profile-admin-menu-wrapper { + background-color: white; + + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; } -.owner_block_links ul.admin_menu li ul.admin_menu_options li a { - color:red; - background-color:white; - display:block; - margin:0px; - padding:2px 4px 2px 13px; +.profile-admin-menu-wrapper li a { + background-color: white; + color: red; + margin-bottom: 0; } -.owner_block_links ul.admin_menu li ul.admin_menu_options li a:hover { - color:black; - background:none; - text-decoration: underline; +.profile-admin-menu-wrapper a:hover { + color: black; } - - -/* *************************************** - full profile info panel -*************************************** */ -#profile_content .odd { - background-color:#f4f4f4; +/*** profile details ***/ +#profile-details .odd { + background-color: #f4f4f4; + -webkit-border-radius: 4px; -moz-border-radius: 4px; - margin:0 0 7px 0; - padding:2px 4px 2px 4px; + border-radius: 4px; + + margin: 0 0 7px; + padding: 2px 4px; } -#profile_content .even { +#profile-details .even { background-color:#f4f4f4; + -webkit-border-radius: 4px; -moz-border-radius: 4px; - margin:0 0 7px 0; - padding:2px 4px 2px 4px; + border-radius: 4px; + + margin: 0 0 7px; + padding: 2px 4px; } -#profile_content .aboutme_title { +.profile-aboutme-title { background-color:#f4f4f4; + -webkit-border-radius: 4px; -moz-border-radius: 4px; - margin:0 0 0px 0; - padding:2px 4px 2px 4px; -} -#profile_content .aboutme_contents { - padding:2px 0 0 3px; -} - - -/* *************************************** - friends panel within profile -*************************************** */ -#profile_content .entity_listing .entity_listing_info { - width:664px; -} - - -/* *************************************** - commentwall within profile -*************************************** */ -#comment_wall_add textarea { - width:685px; -} -#comment_wall_add #postit { - float:right; -} - - -/* *************************************** - twitter panel within profile -*************************************** */ -ul#twitter_update_list li { - background-image: url(<?php echo $vars['url']; ?>mod/profile/graphics/speech_bubble_tail.gif); - background-position:right bottom; - background-repeat: no-repeat; - list-style-image:none; - list-style-position:outside; - list-style-type:none; - margin:0 0 5px 0; - padding:0; - overflow-x: hidden; -} -ul#twitter_update_list li span { - color:#666666; - background:#ececec; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - padding:3px 5px 4px 5px; - display:block; -} -ul#twitter_update_list li a { - display:block; - margin:-2px 0 0 4px; -} -ul#twitter_update_list li span a { - display:inline !important; -} -p.visit_twitter a { - background:url(<?php echo $vars['url']; ?>mod/profile/graphics/twitter16px.png) left no-repeat; - padding:0 0 0 20px; - margin:0; -} -.visit_twitter { - padding:5px 0; - margin:0 0 0 0; - border-top:1px solid #dedede; + border-radius: 4px; + + margin: 0; + padding: 2px 4px; } - - -/* *************************************** - user avatar upload & crop page -*************************************** */ -#avatar_upload { - height:145px; -} -#current_user_avatar { - float:left; - width:160px; - height:130px; - border-right:1px solid #cccccc; - margin:0 20px 0 0; -} -#avatar_croppingtool { - border-top: 1px solid #cccccc; - margin:20px 0 0 0; - padding:10px 0 0 0; -} -#user_avatar { - float: left; - margin-right: 20px; -} -#user_avatar_preview { - float: left; - position: relative; - overflow: hidden; - width: 100px; - height: 100px; +.profile-aboutme-contents { + padding: 2px 0 0 3px; } - - -/* *************************************** - banned user -*************************************** */ -/* banned user full profile panel */ -#profile_content .banned_user { - border:2px solid red; - padding:4px 8px; +.profile-banned-user { + border: 2px solid red; + padding: 4px 8px; + -webkit-border-radius: 6px; -moz-border-radius: 6px; -} -/* banned user in friends lists */ -.entity_listing_info p.entity_title.user.banned { - text-decoration: line-through; -} -.entity_listing_info p.entity_title.user.banned a { - color:red; -} - - -/* *************************************** - admin area - custom profile fields -*************************************** */ -.default_profile_reset { - border-top: 1px solid #dedede; - margin-top:30px; -} -.default_profile_reset .action_button { - float:right; -} -/* field re-order */ -#sortable_profile_fields { - padding:0; - border-top:1px solid #cccccc; -} -#sortable_profile_fields li { - padding:5px 0 5px 0; - border-bottom:1px solid #cccccc; -} -#sortable_profile_fields li img.handle { - margin-right: 7px; - cursor: move; -} -#sortable_profile_fields .ui-sortable-helper { - background: #eeeeee; - color:#333333; - padding: 5px 0 5px 0; - margin: 0; - width:100%; -} - - -/* *************************************** - avatar drop-down menu -*************************************** */ -.avatar_menu_button { - width:15px; - height:15px; - position:absolute; - cursor:pointer; - display:none; - right:0; - bottom:0; -} -.avatar_menu_arrow { - background: url(<?php echo $vars['url']; ?>_graphics/elgg_sprites.png) no-repeat -150px top; - width:15px; - height:15px; -} -.avatar_menu_arrow_on { - background: url(<?php echo $vars['url']; ?>_graphics/elgg_sprites.png) no-repeat -150px -16px; - width:15px; - height:15px; -} -.avatar_menu_arrow_hover { - background: url(<?php echo $vars['url']; ?>_graphics/elgg_sprites.png) no-repeat -150px -32px; - width:15px; - height:15px; -} -/* user avatar submenu options */ -.usericon .sub_menu { - display:none; - position:absolute; - padding:0; - margin:0; - border-top:solid 1px #E5E5E5; - border-left:solid 1px #E5E5E5; - border-right:solid 1px #999999; - border-bottom:solid 1px #999999; - width:164px; - background:#FFFFFF; - text-align:left; - -webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.50); - -moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.50); - font-size:14px; -} -div.usericon a.icon img { - z-index:10; -} -.usericon .sub_menu a:link, -.usericon .sub_menu a:visited, -.usericon .sub_menu a:hover { - display:block; -} -.usericon .sub_menu a:hover { - background:#cccccc; - text-decoration:none; -} -.usericon .sub_menu .displayname { - padding:0 !important; - margin:0 !important; - border-bottom:solid 1px #dddddd !important; - font-size:14px !important; -} -.usericon .sub_menu .displayname a { - padding:3px 3px 3px 8px; - font-size:14px; -} -.usericon .sub_menu .displayname a .username { - display:block; - font-weight: normal; - font-size:12px; - text-align: left; - margin:0; -} -.sub_menu ul.sub_menu_list { - list-style: none; - margin-bottom:0; - padding-left:0; -} -.usericon .sub_menu a { - padding:2px 3px 2px 8px; - font-size:12px; -} -/* admin menu options in avatar submenu */ -.user_menu_admin { - border-top:solid 1px #dddddd; -} -.usericon .sub_menu li.user_menu_admin a { - color:red; -} -.usericon .sub_menu li.user_menu_admin a:hover { - color:white; - background:red; + 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..da4e95690 --- /dev/null +++ b/mod/profile/views/default/profile/details.php @@ -0,0 +1,68 @@ +<?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)) { + + // fix profile URLs populated by https://github.com/Elgg/Elgg/issues/5232 + // @todo Replace with upgrade script, only need to alter users with last_update after 1.8.13 + if ($valtype == 'url' && $value == 'http://') { + $user->$shortname = ''; + continue; + } + + // validate urls + if ($valtype == 'url' && !preg_match('~^https?\://~i', $value)) { + $value = "http://$value"; + } + + // this 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/edit.php b/mod/profile/views/default/profile/edit.php deleted file mode 100644 index f67d6e5d5..000000000 --- a/mod/profile/views/default/profile/edit.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php -/** - * Elgg profile edit form - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['entity'] The user entity - * @uses $vars['profile'] Profile items from $CONFIG->profile, defined in profile/start.php for now - */ -?> -<form action="<?php echo $vars['url']; ?>action/profile/edit" method="post" id="edit_profile" class="margin_top"> -<?php echo elgg_view('input/securitytoken') ?> - - <p><label> - <?php echo elgg_echo('user:name:label'); ?></label> - <?php - echo elgg_view('input/text',array('internalname' => 'name', 'value' => page_owner_entity()->name)); - ?> - </p> - -<?php - if (is_array($vars['config']->profile) && sizeof($vars['config']->profile) > 0) - foreach($vars['config']->profile as $shortname => $valtype) { - if ($metadata = get_metadata_byname($vars['entity']->guid, $shortname)) { - if (is_array($metadata)) { - $value = ''; - foreach($metadata as $md) { - if (!empty($value)) $value .= ', '; - $value .= $md->value; - $access_id = $md->access_id; - } - } else { - $value = $metadata->value; - $access_id = $metadata->access_id; - } - } else { - $value = ''; - $access_id = ACCESS_DEFAULT; - } - - if ($shortname == 'description') { // change label positioning to allow for additional longtext field controls -?> - <p> - <label> - <?php echo elgg_echo("profile:{$shortname}") ?></label> - <?php echo elgg_view("input/{$valtype}",array( - 'internalname' => $shortname, - 'value' => $value, - )); ?> - - <?php echo elgg_view('input/access',array('internalname' => 'accesslevel['.$shortname.']', 'value' => $access_id)); ?> - </p> -<?php - } else { -?> - - <p> - <label> - <?php echo elgg_echo("profile:{$shortname}") ?><br /> - <?php echo elgg_view("input/{$valtype}",array( - 'internalname' => $shortname, - 'value' => $value, - )); ?> - </label> - <?php echo elgg_view('input/access',array('internalname' => 'accesslevel['.$shortname.']', 'value' => $access_id)); ?> - </p> - -<?php - } - - } - -?> - - <p> - <input type="hidden" name="username" value="<?php echo page_owner_entity()->username; ?>" /> - <input type="submit" class="submit_button" value="<?php echo elgg_echo("save"); ?>" /> - </p> - -</form>
\ No newline at end of file diff --git a/mod/profile/views/default/profile/editdefaultprofile.php b/mod/profile/views/default/profile/editdefaultprofile.php deleted file mode 100644 index ae05e6da1..000000000 --- a/mod/profile/views/default/profile/editdefaultprofile.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** - * Elgg profile index - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ - -$label_text = elgg_echo('profile:label'); -$type_text = elgg_echo('profile:type'); - -$label_control = elgg_view('input/text', array('internalname' => 'label')); -$type_control = elgg_view('input/pulldown', array('internalname' => 'type', 'options_values' => array( - 'text' => elgg_echo('text'), - 'longtext' => elgg_echo('longtext'), - 'tags' => elgg_echo('tags'), - 'url' => elgg_echo('url'), - 'email' => elgg_echo('email') -))); - -$submit_control = elgg_view('input/submit', array('internalname' => elgg_echo('add'), 'value' => elgg_echo('add'))); - -$formbody = <<< END - <p>$label_text: $label_control - $type_text: $type_control - $submit_control</p> -END; - -echo "<p class='margin_top'>" . elgg_echo('profile:explainchangefields') . "</p>"; -echo elgg_view('input/form', array('body' => $formbody, 'action' => $vars['url'] . 'action/profile/editdefault')); diff --git a/mod/profile/views/default/profile/editdefaultprofileitems.php b/mod/profile/views/default/profile/editdefaultprofileitems.php deleted file mode 100644 index 4b0564d2d..000000000 --- a/mod/profile/views/default/profile/editdefaultprofileitems.php +++ /dev/null @@ -1,67 +0,0 @@ -<script language="javascript" type="text/javascript" src="<?php echo $vars['url']?>mod/profile/vendor/jquery.jeditable.mini.js"></script> -<script language="javascript" type="text/javascript"> -var reorderURL = '<?php echo elgg_add_action_tokens_to_url($vars['url'] . 'action/profile/editdefault/reorder', FALSE); ?>'; -function sortCallback(event, ui) { - var orderArr = $('#sortable_profile_fields').sortable('toArray'); - var orderStr = orderArr.join(','); - console.log(orderArr); - console.log(orderStr); - jQuery.post(reorderURL, {'fieldorder': orderStr}); -} - -$(document).ready(function() { - $('#sortable_profile_fields').sortable({ - items: 'li', - handle: '.handle', - stop: sortCallback - }); -}); - -</script> - -<div id="list"> - <ul id="sortable_profile_fields"> -<?php - - $save = elgg_echo('save'); - $cancel = elgg_echo('cancel'); - $edit_url = elgg_add_action_tokens_to_url("{$vars['url']}action/profile/editdefault/editfield", FALSE); - - foreach($vars['items'] as $item) { - echo <<< END - -<script language="javascript" type="text/javascript"> - - $(function() { - $(".{$item->shortname}_editable").editable("$edit_url ", { - type : 'text', - submitdata: { _method: "post", 'field': '{$item->shortname}' }, - onblur: 'submit', - width:'300px', - height:'none', - style:'display:inline;', - tooltip:'Click to edit label' - }); - }); - -</script> - -END; - - echo elgg_view("profile/", array('value' => $item->translation)); - - //$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - $url = elgg_add_action_tokens_to_url("{$vars['url']}action/profile/editdefault/delete?id={$item->shortname}"); - echo "<li id=\"{$item->shortname}\"><div class=\"delete_note\" style=\"float:right\"><a href=\"$url\">" . elgg_echo('delete') . "</a></div>"; - echo "<img width='16' height='16' class='handle' alt='move' title='Drag here to reorder this item' src='{$vars['url']}mod/profile/graphics/drag_handle.png'/>"; - echo "<b class=\"profile_field_editable\"><span class=\"{$item->shortname}_editable\">$item->translation</span></b>: [".elgg_echo($item->type)."]"; - echo "</li>"; - - } - -?> - </ul> -</div> -<div id="tempList"></div> - -<input name="sortableListOrder" type="hidden" id="sortableListOrder" value="<?php echo $vars['fieldlist']; ?>" /> diff --git a/mod/profile/views/default/profile/editicon.php b/mod/profile/views/default/profile/editicon.php deleted file mode 100644 index c71b7113d..000000000 --- a/mod/profile/views/default/profile/editicon.php +++ /dev/null @@ -1,145 +0,0 @@ -<?php -/** - * Elgg profile icon edit form - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['entity'] The user entity - * @uses $vars['profile'] Profile items from $CONFIG->profile, defined in profile/start.php for now - */ - -// user is passed to view and set by caller (normally the page editicon) -$currentuser = $vars['user']; -?> -<div id="edit_profile_avatar"> -<!-- grab the required js for icon cropping --> -<script type="text/javascript" src="<?php echo $vars['url']; ?>mod/profile/views/default/js/jquery.imgareaselect-0.8.min.js"></script> - -<p class="margin_top"><?php echo elgg_echo('profile:profilepictureinstructions'); ?></p> - -<div id="current_user_avatar"> - - <label><?php echo elgg_echo('profile:currentavatar'); ?></label> - <?php - - $user_avatar = $currentuser->getIcon('medium'); - echo "<img src=\"{$user_avatar}\" alt=\"avatar\" />"; - - ?> - -</div> - -<div id="avatar_upload"> - <form action="<?php echo $vars['url']; ?>action/profile/iconupload" method="post" enctype="multipart/form-data"> - <?php echo elgg_view('input/securitytoken'); ?> - <input type="hidden" name="username" value="<?php echo $currentuser->username; ?>" /> - <p><label><?php echo elgg_echo("profile:editicon"); ?></label><br /> - - <?php - - echo elgg_view("input/file",array('internalname' => 'profileicon')); - ?> - <br /><input type="submit" class="submit_button" value="<?php echo elgg_echo("upload"); ?>" /> - </p> - </form> -</div> - -<div id="avatar_croppingtool"> -<label><?php echo elgg_echo('profile:profilepicturecroppingtool'); ?></label><br /> -<p> -<?php - - echo elgg_echo("profile:createicon:instructions"); - - //display the current user photo - - $user_master_image = $currentuser->getIcon('master'); - -?> -</p> -<script type="text/javascript"> - - //function to display a preview of the users cropped section - function preview(img, selection) { - // catch for the first click on the image - if (selection.width == 0 || selection.height == 0) { - return; - } - - var origWidth = $("#user_avatar").width(); //get the width of the users master photo - var origHeight = $("#user_avatar").height(); //get the height of the users master photo - var scaleX = 100 / selection.width; - var scaleY = 100 / selection.height; - $('#user_avatar_preview > img').css({ - width: Math.round(scaleX * origWidth) + 'px', - height: Math.round(scaleY * origHeight) + 'px', - marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px', - marginTop: '-' + Math.round(scaleY * selection.y1) + 'px' - }); - } - - //variables for the newly cropped avatar - //var $x1, $y1, $x2, $y2, $w, $h; - - function selectChange(img, selection){ - - //populate the form with the correct coordinates once a user has cropped their image - $('#x_1').val(selection.x1); - $('#x_2').val(selection.x2); - $('#y_1').val(selection.y1); - $('#y_2').val(selection.y2); - - } - - $(document).ready(function () { - - //get the coordinates from the form - /* - var x_1 = $('#x_1').val(); - var x_2 = $('#x_2').val(); - var y_1 = $('#y_1').val(); - var y_2 = $('#y_2').val(); - var w = x_2 - x_1; - var h = y_2 - y_1; - selection = { x1: x_1, y1: y_1, x2: x_2, y2: y_2, width: w, height: h }; - */ - - $('<div id="user_avatar_preview"><img src="<?php echo $user_master_image; ?>" /></div>') - .insertAfter($('#user_avatar')); - - $('<div id="user_avatar_preview_title"><label><?php echo elgg_echo('profile:preview'); ?></label></div>').insertBefore($('#user_avatar_preview')); - }); - - $(window).load(function () { - - //this produces the coordinates - $('#user_avatar').imgAreaSelect({ selectionOpacity: 0, onSelectEnd: selectChange }); - //show the preview - $('#user_avatar').imgAreaSelect({ aspectRatio: '1:1', onSelectChange: preview }); - - }); - -</script> - -<p> -<img id="user_avatar" src="<?php echo $user_master_image; ?>" alt="<?php echo elgg_echo("profile:icon"); ?>" /> -</p> - -<div class="clearfloat"></div> - -<form action="<?php echo $vars['url']; ?>action/profile/cropicon" method="post" /> - <?php echo elgg_view('input/securitytoken'); ?> - <input type="hidden" name="username" value="<?php echo $vars['user']->username; ?>" /> - <input type="hidden" name="x_1" value="<?php echo $vars['user']->x1; ?>" id="x_1" /> - <input type="hidden" name="x_2" value="<?php echo $vars['user']->x2; ?>" id="x_2" /> - <input type="hidden" name="y_1" value="<?php echo $vars['user']->y1; ?>" id="y_1" /> - <input type="hidden" name="y_2" value="<?php echo $vars['user']->y2; ?>" id="y_2" /> - <input type="submit" name="submit" value="<?php echo elgg_echo("profile:createicon"); ?>" /> -</form> - -</div> -</div> diff --git a/mod/profile/views/default/profile/hoverover.php b/mod/profile/views/default/profile/hoverover.php deleted file mode 100644 index 5250377a1..000000000 --- a/mod/profile/views/default/profile/hoverover.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -/** - * Elgg profile icon hover over - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. - */ -?> -<li class="user_menu_name"> - <?php echo $vars['entity']->name; ?> -</li> -<?php - echo elgg_view('profile/hoverover/actions', $vars); - echo elgg_view('profile/hoverover/links', $vars); -?>
\ No newline at end of file diff --git a/mod/profile/views/default/profile/icon.php b/mod/profile/views/default/profile/icon.php deleted file mode 100644 index ef1b32b36..000000000 --- a/mod/profile/views/default/profile/icon.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php - -/** - * Elgg profile icon - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. - * @uses $vars['size'] The size - small, medium or large. If none specified, medium is assumed. - */ - -// Get entity -if (empty($vars['entity'])) { - $vars['entity'] = $vars['user']; -} - -if ($vars['entity'] instanceof ElggUser) { - $name = htmlentities($vars['entity']->name, ENT_QUOTES, 'UTF-8'); - $username = $vars['entity']->username; - - if ($icontime = $vars['entity']->icontime) { - $icontime = "{$icontime}"; - } else { - $icontime = "default"; - } - - // Get size - if (!in_array($vars['size'],array('small','medium','large','tiny','master','topbar'))) { - $vars['size'] = 'medium'; - } - - // Get any align and js - if (!empty($vars['align'])) { - $align = " align=\"{$vars['align']}\" "; - } else { - $align = ''; - } - - // Override - if (isset($vars['override']) && $vars['override'] == true) { - $override = true; - } else { - $override = false; - } - // profile avatar drop-down menu - if (!$override) { - ?> - <div class="usericon <?php echo $vars['size']; ?>"> - <div class="avatar_menu_button"><img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" border="0" width="15px" height="15px" /></div> - <div class="sub_menu"> - <h3 class="displayname"><a href="<?php echo $vars['entity']->getURL(); ?>"><?php echo $vars['entity']->name; ?> - <span class="username"><?php echo "@" . $vars['entity']->username; ?></span></a></h3> - <?php - echo "<ul class='sub_menu_list'>"; - if (isloggedin()) { - // if not looking at your own avatar menu - if ($vars['entity']->getGUID() != $vars['user']->getGUID()) { - - // Add / Remove friend link - $friendlinks = elgg_view('profile/menu/friendlinks',$vars); - if (!empty($friendlinks)) { - echo "<li class='user_menu_profile'>{$friendlinks}</li>"; - } - // view for plugins to extend - echo elgg_view('profile/menu/links',$vars); - } else { - // if looking at your own avatar menu - provide a couple of handy links - ?> - <li class="user_menu_profile"> - <a class="edit_profile" href="<?php echo $vars['url']?>pg/profile/<?php echo $vars['entity']->username; ?>/edit/details"><?php echo elgg_echo("profile:edit"); ?></a> - </li> - <li class="user_menu_profile"> - <a class="edit_avatar" href="<?php echo $vars['url']?>pg/profile/<?php echo $vars['entity']->username; ?>/edit/icon"><?php echo elgg_echo("profile:editicon"); ?></a> - </li> - <?php - } - - // if Admin is logged in, and not looking at admins own avatar menu - if (isadminloggedin() && ($_SESSION['id']!=$vars['entity']->guid) ){ - $adminlinks = elgg_view('profile/menu/adminlinks', $vars); - if (!empty($adminlinks)) { - echo "<li class='user_menu_admin'>{$adminlinks}</li>"; - } - } - - } - echo "</ul>"; - ?> - </div> - <?php - if ((isadminloggedin()) || (!$vars['entity']->isBanned())) { - ?><a href="<?php echo $vars['entity']->getURL(); ?>" class="icon" ><?php - } - - } - - // Rounded avatar corners - CSS3 method - users avatar as background image so we can clip it with border-radius in supported browsers - ?> - <img src="<?php echo $vars['url']; ?>_graphics/spacer.gif" border="0" <?php echo $align; ?> alt="<?php echo htmlentities($vars['entity']->name, ENT_QUOTES, 'UTF-8'); ?>" title="<?php echo htmlentities($vars['entity']->name, ENT_QUOTES, 'UTF-8'); ?>" <?php echo $vars['js']; ?> style="background: url(<?php echo $vars['entity']->getIcon($vars['size']); ?>) no-repeat;" class="<?php echo $vars['size']; ?>" /> - <?php - /* - original avatar method - <img src="<?php echo $vars['entity']->getIcon($vars['size']); ?>" border="0" <?php echo $align; ?> alt="<?php echo htmlentities($vars['entity']->name, ENT_QUOTES, 'UTF-8'); ?>" title="<?php echo htmlentities($vars['entity']->name, ENT_QUOTES, 'UTF-8'); ?>" <?php echo $vars['js']; ?> /> - */ - - if (!$override) { - ?> - </a></div> - <?php - } -}
\ No newline at end of file diff --git a/mod/profile/views/default/profile/javascript.php b/mod/profile/views/default/profile/javascript.php deleted file mode 100644 index a408d1c84..000000000 --- a/mod/profile/views/default/profile/javascript.php +++ /dev/null @@ -1,138 +0,0 @@ -<?php - -/** - * Elgg profile image Javascript - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['entity'] The user entity - */ - -// header("Content-type: text/javascript"); -// header("Pragma: public"); -// header("Cache-Control: public"); - -?> - -var submenuLayer = 1000; - -function setup_avatar_menu() { - - // avatar image menu link - $("div.usericon img").mouseover(function() { - // find nested avatar_menu_button and show - $(this.parentNode.parentNode).children(".avatar_menu_button").show(); - $(this.parentNode.parentNode).children("div.avatar_menu_button").addClass("avatar_menu_arrow"); - //$(this.parentNode.parentNode).css("z-index", submenuLayer); - }) - .mouseout(function() { - if($(this).parent().parent().find("div.sub_menu").css('display')!="block") { - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow_on"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow_hover"); - $(this.parentNode.parentNode).children(".avatar_menu_button").hide(); - } - else { - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow_on"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow_hover"); - $(this.parentNode.parentNode).children(".avatar_menu_button").show(); - $(this.parentNode.parentNode).children("div.avatar_menu_button").addClass("avatar_menu_arrow"); - } - }); - - - // avatar contextual menu - $(".avatar_menu_button img").click(function(e) { - - var submenu = $(this).parent().parent().find("div.sub_menu"); - - // close submenu if arrow is clicked & menu already open - if(submenu.css('display') == "block") { - //submenu.hide(); - } - else { - // get avatar dimensions - var avatar = $(this).parent().parent().parent().find("div.usericon"); - //alert( "avatarWidth: " + avatar.width() + ", avatarHeight: " + avatar.height() ); - - // move submenu position so it aligns with arrow graphic - if (e.pageX < 840) { // popup menu to left of arrow if we're at edge of page - submenu.css("top",(avatar.height()) + "px") - .css("left",(avatar.width()-15) + "px") - .fadeIn('normal'); - } - else { - submenu.css("top",(avatar.height()) + "px") - .css("left",(avatar.width()-166) + "px") - .fadeIn('normal'); - } - - // force z-index - workaround for IE z-index bug - avatar.css("z-index", submenuLayer); - avatar.find("a.icon img").css("z-index", submenuLayer); - submenu.css("z-index", submenuLayer+1); - - submenuLayer++; - - // change arrow to 'on' state - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow_hover"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").addClass("avatar_menu_arrow_on"); - } - - // hide any other open submenus and reset arrows - $("div.sub_menu:visible").not(submenu).hide(); - $(".avatar_menu_button").removeClass("avatar_menu_arrow"); - $(".avatar_menu_button").removeClass("avatar_menu_arrow_on"); - $(".avatar_menu_button").removeClass("avatar_menu_arrow_hover"); - $(".avatar_menu_button").hide(); - $(this.parentNode.parentNode).children("div.avatar_menu_button").addClass("avatar_menu_arrow_on"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").show(); - //alert("submenuLayer = " +submenu.css("z-index")); - }) - // hover arrow each time mouseover enters arrow graphic (eg. when menu is already shown) - .mouseover(function() { - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow_on"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").addClass("avatar_menu_arrow_hover"); - }) - // if menu not shown revert arrow, else show 'menu open' arrow - .mouseout(function() { - if($(this).parent().parent().find("div.sub_menu").css('display')!="block"){ - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow_hover"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").addClass("avatar_menu_arrow"); - } - else { - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow_hover"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").removeClass("avatar_menu_arrow"); - $(this.parentNode.parentNode).children("div.avatar_menu_button").addClass("avatar_menu_arrow_on"); - } - }); - - // hide avatar menu if click occurs outside of menu - // and hide arrow button - $(document).click(function(event) { - var target = $(event.target); - if (target.parents(".usericon").length == 0) { - $(".usericon div.sub_menu").fadeOut(); - $(".avatar_menu_button").removeClass("avatar_menu_arrow"); - $(".avatar_menu_button").removeClass("avatar_menu_arrow_on"); - $(".avatar_menu_button").removeClass("avatar_menu_arrow_hover"); - $(".avatar_menu_button").hide(); - } - }); - - -} - -$(document).ready(function() { - - setup_avatar_menu(); - -}); 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/listing.php b/mod/profile/views/default/profile/listing.php deleted file mode 100644 index e53f9df75..000000000 --- a/mod/profile/views/default/profile/listing.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Elgg user display (small) - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['entity'] The user entity - */ - -$icon = elgg_view( - "profile/icon", array( - 'entity' => $vars['entity'], - 'size' => 'tiny', - ) -); - -$banned = $vars['entity']->isBanned(); - -// Simple XFN -$rel = ""; -if (page_owner() == $vars['entity']->guid) - $rel = 'me'; -else if (check_entity_relationship(page_owner(), 'friend', $vars['entity']->guid)) - $rel = 'friend'; - -if (!$banned) { - $info .= "<p class='entity_title user'><a href=\"" . $vars['entity']->getUrl() . "\" rel=\"$rel\">" . $vars['entity']->name . "</a></p>"; - $location = $vars['entity']->location; - if (!empty($location)) { - $info .= "<p class='entity_subtext user'>" . elgg_echo("profile:location") . ": " . elgg_view("output/tags",array('value' => $vars['entity']->location)) . "</p>"; - } - //create a view that a status plugin could extend - in the default case, this is the wire - $info .= elgg_view("profile/status", array("entity" => $vars['entity'])); -}else{ - $info .= "<p class='entity_title user banned'>"; - if (isadminloggedin()) - $info .= "<a href=\"" . $vars['entity']->getUrl() . "\">"; - $info .= $vars['entity']->name; - if (isadminloggedin()) - $info .= "</a>"; - $info .= "</p>"; -} - -echo elgg_view_listing($icon, $info);
\ No newline at end of file diff --git a/mod/profile/views/default/profile/menu/adminlinks.php b/mod/profile/views/default/profile/menu/adminlinks.php deleted file mode 100644 index d2a36397d..000000000 --- a/mod/profile/views/default/profile/menu/adminlinks.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -/** - * Profile admin context links - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['entity'] The user entity - */ - -if (isadminloggedin()){ - if ($_SESSION['id']!=$vars['entity']->guid){ -?> - <a href="<?php echo $vars['url']; ?>pg/settings/user/<?php echo $vars['entity']->username; ?>/"><?php echo elgg_echo('profile:editdetails'); ?></a> -<?php - if (!$vars['entity']->isBanned()) { - echo elgg_view('output/confirmlink', array('text' => elgg_echo("ban"), 'href' => "{$vars['url']}action/admin/user/ban?guid={$vars['entity']->guid}")); - } else { - echo elgg_view('output/confirmlink', array('text' => elgg_echo("unban"), 'href' => "{$vars['url']}action/admin/user/unban?guid={$vars['entity']->guid}")); - } - echo elgg_view('output/confirmlink', array('text' => elgg_echo("delete"), 'href' => "{$vars['url']}action/admin/user/delete?guid={$vars['entity']->guid}")); - echo elgg_view('output/confirmlink', array('text' => elgg_echo("resetpassword"), 'href' => "{$vars['url']}action/admin/user/resetpassword?guid={$vars['entity']->guid}")); - if (!$vars['entity']->isAdmin()) { - echo elgg_view('output/confirmlink', array('text' => elgg_echo("makeadmin"), 'href' => "{$vars['url']}action/admin/user/makeadmin?guid={$vars['entity']->guid}")); - } else { - echo elgg_view('output/confirmlink', array('text' => elgg_echo("removeadmin"), 'href' => "{$vars['url']}action/admin/user/removeadmin?guid={$vars['entity']->guid}")); - } - } - } diff --git a/mod/profile/views/default/profile/menu/friendlinks.php b/mod/profile/views/default/profile/menu/friendlinks.php deleted file mode 100644 index f7ca3c2fd..000000000 --- a/mod/profile/views/default/profile/menu/friendlinks.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php -/** - * Elgg profile icon avatar menu: Add / Remove friend links - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. - */ -$ts = time(); -$token = generate_action_token($ts); -if ($vars['entity']->isFriend()) { - echo elgg_view('output/confirmlink', array( - 'href' => "{$vars['url']}action/friends/remove?friend={$vars['entity']->getGUID()}", - 'text' => elgg_echo('friend:remove'), - 'class' => 'remove_friend' - )); -} else { - echo elgg_view('output/confirmlink', array( - 'href' => "{$vars['url']}action/friends/add?friend={$vars['entity']->getGUID()}", - 'text' => elgg_echo('friend:add'), - 'class' => 'add_friend' - )); -}
\ No newline at end of file diff --git a/mod/profile/views/default/profile/menu/links.php b/mod/profile/views/default/profile/menu/links.php deleted file mode 100644 index de2b28926..000000000 --- a/mod/profile/views/default/profile/menu/links.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg profile icon avatar menu: view for plugins to extend - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. - */ -?> diff --git a/mod/profile/views/default/profile/metatags.php b/mod/profile/views/default/profile/metatags.php index 0039281f0..52048b8a7 100644 --- a/mod/profile/views/default/profile/metatags.php +++ b/mod/profile/views/default/profile/metatags.php @@ -1,15 +1,16 @@ <?php /** - * Adds metatags to load Javascript required for the profile + * FOAF * * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd <info@elgg.com> - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ * */ -if ($owner = page_owner_entity()) { ?> - <link rel="meta" type="application/rdf+xml" title="FOAF" href="<?php echo full_url(); ?>?view=foaf" /> -<?php } ?>
\ No newline at end of file +$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/profile_contents/activity.php b/mod/profile/views/default/profile/profile_contents/activity.php deleted file mode 100755 index 588ed89d1..000000000 --- a/mod/profile/views/default/profile/profile_contents/activity.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -/** - * Elgg user display (details) - * @uses $vars['entity'] The user entity - */ - $limit = 20; -?> -<div id="profile_content"> - <?php - if(is_plugin_enabled('thewire')) { - // users last status msg, if they posted one - echo elgg_view("profile/status", array("entity" => $vars['entity'])); - } - if(is_plugin_enabled('conversations')) { - // users last status msg, if they posted one - echo elgg_view("profile/status", array("entity" => $vars['entity'])); - } - if(is_plugin_enabled('riverdashboard')) { - //select the correct river - if (get_plugin_setting('activitytype', 'riverdashboard') == 'classic') { - echo elgg_view_river_items($vars['entity']->getGuid(), 0, '', '', '', '', $limit,0,0,false,true); - } else { - echo elgg_view_river_items($vars['entity']->getGuid(), 0, '', '', '', '', $limit,0,0,false,false); - echo elgg_view('riverdashboard/js'); - } - } else { - echo "Riverdashboard not loaded"; - } - ?> -</div> diff --git a/mod/profile/views/default/profile/profile_contents/commentwall.php b/mod/profile/views/default/profile/profile_contents/commentwall.php deleted file mode 100644 index f3a2adb1c..000000000 --- a/mod/profile/views/default/profile/profile_contents/commentwall.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg profile comment wall - */ -?> -<div id="profile_content"> -<?php -if(isloggedin()){ - echo elgg_view("profile/commentwall/commentwalladd"); -} -echo elgg_view("profile/commentwall/commentwall", array('annotation' => $vars['comments'])); -?> -</div>
\ No newline at end of file diff --git a/mod/profile/views/default/profile/profile_contents/details.php b/mod/profile/views/default/profile/profile_contents/details.php deleted file mode 100755 index d040cef75..000000000 --- a/mod/profile/views/default/profile/profile_contents/details.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * Elgg user display (details) - * @uses $vars['entity'] The user entity - */ -?> -<div id="profile_content"> -<?php - // Simple XFN - $rel = ""; - if (page_owner() == $vars['entity']->guid) - $rel = 'me'; - else if (check_entity_relationship(page_owner(), 'friend', $vars['entity']->guid)) - $rel = 'friend'; - - $even_odd = null; - if (is_array($vars['config']->profile) && sizeof($vars['config']->profile) > 0) - foreach($vars['config']->profile as $shortname => $valtype) { - if ($shortname != "description") { - $value = $vars['entity']->$shortname; - if (!empty($value)) { - //This function controls the alternating class - $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; -?> - <p class="<?php echo $even_odd; ?>"> - <b><?php - echo elgg_echo("profile:{$shortname}"); - ?>: </b> - <?php - echo elgg_view("output/{$valtype}",array('value' => $vars['entity']->$shortname)); - ?> - </p> - <?php - } - } - } -?> -<?php - if (!get_plugin_setting('user_defined_fields', 'profile')) { -?> -<?php - if ($vars['entity']->isBanned()) { - echo "<div class='banned_user'>"; - echo elgg_echo('profile:banned'); - echo "</div>"; - }else{ - if($vars['entity']->description){ - echo "<p class='aboutme_title'><b>" . elgg_echo("profile:aboutme") . "</b></p>"; - echo "<div class='aboutme_contents'>" .elgg_view('output/longtext', array('value' => $vars['entity']->description))."</div>"; - } - ?> -<?php } ?> - <?php - } - - echo "</div>";
\ No newline at end of file diff --git a/mod/profile/views/default/profile/profile_contents/friends.php b/mod/profile/views/default/profile/profile_contents/friends.php deleted file mode 100755 index a097f3830..000000000 --- a/mod/profile/views/default/profile/profile_contents/friends.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -/** - * Profile friends - **/ - -$friends = list_entities_from_relationship('friend',$vars['entity']->getGUID(),false,'user','',0,10,false); -if(!$friends) - $friends = "<p>This user has not made any friends yet.</p>"; - -?> -<div id="profile_content"> - <?php - echo $friends; - ?> -</div>
\ No newline at end of file diff --git a/mod/profile/views/default/profile/profile_contents/sidebar.php b/mod/profile/views/default/profile/profile_contents/sidebar.php deleted file mode 100644 index 43e3d1087..000000000 --- a/mod/profile/views/default/profile/profile_contents/sidebar.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -/** - * Elgg profile icon edit form - * - * @package ElggProfile - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ -?> -<div id="profile_sidebar"> -<?php - $section = $vars['section']; - echo elgg_view('profile/profile_ownerblock', array('section' => $section)); -?> -</div>
\ No newline at end of file diff --git a/mod/profile/views/default/profile/profile_contents/twitter.php b/mod/profile/views/default/profile/profile_contents/twitter.php deleted file mode 100755 index f9b6f5d54..000000000 --- a/mod/profile/views/default/profile/profile_contents/twitter.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Elgg twitter view page - */ - -$twitter_username = $vars['entity']->twitter; - -// if the twitter username is empty, then do not show -if($twitter_username){ -?> -<div id="profile_content"> - <ul id="twitter_update_list"></ul> - <p class="visit_twitter"><a href="http://twitter.com/<?php echo $twitter_username; ?>" target="_blank"><?php echo elgg_echo("twitter:visit"); ?></a></p> - <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script> - <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/<?php echo $twitter_username; ?>.json?callback=twitterCallback2&count=10"></script> -</div> - -<?php -}
\ No newline at end of file diff --git a/mod/profile/views/default/profile/profile_navigation.php b/mod/profile/views/default/profile/profile_navigation.php deleted file mode 100755 index e4627d37a..000000000 --- a/mod/profile/views/default/profile/profile_navigation.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -$section = 'activity'; -if (isset($vars['section'])) { - $section = $vars['section']; -} - -$profile = $vars['entity']; -$activity = ''; -$friends = ''; -$extend = ''; -$twitter = ''; - -$url = "{$profile->getURL()}/"; - -//select section -switch($section){ - case 'friends': - $friends = 'class="selected"'; - break; - - case 'details': - $details = 'class="selected"'; - break; - - case 'twitter': - $twitter = 'class="selected"'; - break; - - case 'commentwall': - $commentwall = 'class="selected"'; - break; - case 'activity': - default: - $activity = 'class="selected"'; - break; -} -?> -<div class="elgg_horizontal_tabbed_nav profile"> -<div class="profile_name"><h2><?php echo $profile->name; ?></h2></div> -<ul> - <li <?php echo $activity; ?>><a href="<?php echo $url; ?>">Activity</a></li> - <li <?php echo $details; ?>><a href="<?php echo $url . 'details'; ?>">Details</a></li> - <li <?php echo $friends; ?>><a href="<?php echo $url . 'friends'; ?>">Friends</a></li> - <li <?php echo $commentwall; ?>><a href="<?php echo $url . 'commentwall'; ?>">Comment Wall</a></li> - <?php - //check to see if the twitter username is set - if($vars['entity']->twitter){ - ?> - <li <?php echo $twitter; ?>><a href="<?php echo $url . 'twitter'; ?>">Twitter</a></li> - <?php - } - //insert a view which others can extend - echo elgg_view('profilenav/extend', $profile); - ?> -</ul> -</div>
\ No newline at end of file diff --git a/mod/profile/views/default/profile/profile_ownerblock.php b/mod/profile/views/default/profile/profile_ownerblock.php deleted file mode 100755 index a0c551b94..000000000 --- a/mod/profile/views/default/profile/profile_ownerblock.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php - -/** - * A simple owner block which houses info about the user whose 'stuff' you are looking at - */ - -//get the page owner -if($vars['entity']){ - if($vars['context'] == 'edit') - $user = get_entity($vars['entity']->container_guid); - else - $user = get_entity($vars['entity']->guid); -}else{ - $user = page_owner_entity(); -} -$more_info = ''; -//set some variables -$location = elgg_view("output/tags",array('value' => $user->location)); -$section = $vars['section']; -if($section == 'details'){ - $icon = elgg_view("profile/icon",array('entity' => $user, 'size' => 'large', 'override' => 'true')); - $icon_class = "large"; -}else{ - $icon = elgg_view("profile/icon",array('entity' => $user, 'size' => 'small')); - $more_info = "<div class='owner_block_contents clearfloat'>"; - $more_info .= "<h3><a href='{$url}'>{$user->name}</a></h3>"; - $more_info .= "<p class='profile_info briefdescription'>{$user->briefdescription}</p>"; - $more_info .= "<p class='profile_info location'>{$location}</p>"; - $more_info .= "</div>"; -} -$profile_actions = ""; -if(isloggedin() && (get_loggedin_user()->getGuid() == page_owner())){ - $profile_actions = "<div class='clearfloat profile_actions'>"; - $profile_actions .= "<a href='{$vars['url']}pg/profile/{$user->username}/edit/details' class='action_button'>". elgg_echo('profile:edit') ."</a>"; - $profile_actions .= "<a href='{$vars['url']}pg/profile/{$user->username}/edit/icon' class='action_button'>". elgg_echo('profile:editicon') ."</a>"; - $profile_actions .= "</div>"; -}else{ - $profile_actions = "<div class='profile_actions'>"; - if (isloggedin()) { - if ($_SESSION['user']->getGUID() != $user->getGUID()) { - $ts = time(); - $token = generate_action_token($ts); - - if ($user->isFriend()) { - $profile_actions .= "<a href=\"{$vars['url']}action/friends/remove?friend={$user->getGUID()}&__elgg_token=$token&__elgg_ts=$ts\" class='action_button'>" . elgg_echo('friend:remove') . "</a>"; - } else { - $profile_actions .= "<a href=\"{$vars['url']}action/friends/add?friend={$user->getGUID()}&__elgg_token=$token&__elgg_ts=$ts\" class='action_button'>" . elgg_echo('friend:add') . "</a>"; - } - } - } - if(is_plugin_enabled('messages') && isloggedin()){ - $profile_actions .= "<a href=\"{$vars['url']}mod/messages/send.php?send_to={$user->guid}\" class='action_button'>". elgg_echo('messages:send') ."</a>"; - } - $profile_actions .= "</div>"; -} - -$username = $user->username; -$email = $user->email; -$phone = $user->phone; - -//get correct links -$url = $vars['url']; - -//if admin display admin links -if(isadminloggedin()){ - $admin_links = elgg_view('profile/admin_menu'); -}else{ - $admin_links = ''; -} - - -//check tools are enabled - hard-coded for phase1 -// @todo - provide a view to extend for profile pages ownerblock tool-links -if(is_plugin_enabled('blog')){ - $blog_link = "<li><a href=\"{$vars['url']}pg/blog/{$username}\">Blog</a></li>"; -}else{ - $blog_link = ""; -} -if(is_plugin_enabled('bookmarks')){ - $bookmark_link = "<li><a href=\"{$vars['url']}pg/bookmarks/{$username}\">Bookmarks</a></li>"; -}else{ - $bookmark_link = ""; -} -if(is_plugin_enabled('document')){ - $docs_link = "<li><a href=\"{$vars['url']}pg/document/{$username}\">Documents</a></li>"; -}else{ - $docs_link = ""; -} -if(is_plugin_enabled('feeds')){ - $feeds_link = "<li><a href=\"{$vars['url']}pg/feeds/{$username}\">Feeds</a></li>"; -}else{ - $feeds_link = ""; -} -if(is_plugin_enabled('tidypics')){ - $tidypics_link = "<li><a href=\"{$vars['url']}pg/photos/owned/{$username}\">Photos</a></li>"; -}else{ - $tidypics_link = ""; -} -if(is_plugin_enabled('videolist')){ - $video_link = "<li><a href=\"{$vars['url']}pg/videolist/{$username}\">Videos</a></li>"; -}else{ - $video_link = ""; -} - -//contruct the display -$display = <<<EOT - -<div id="owner_block"> - <div class="owner_block_icon {$icon_class}"> - {$icon} - </div> - {$more_info} - {$profile_actions} - <div class="owner_block_links"> - <ul> - {$blog_link} - {$bookmark_link} - {$docs_link} - {$feeds_link} - {$tidypics_link} - {$video_link} - </ul> - </div> - <!-- if admin user --> - {$admin_links} -</div> - -EOT; - -echo $display; diff --git a/mod/profile/views/default/profile/topbar_extend.php b/mod/profile/views/default/profile/topbar_extend.php deleted file mode 100644 index c1c4e13bb..000000000 --- a/mod/profile/views/default/profile/topbar_extend.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * - */ - -$user = get_loggedin_user(); - -if (($user instanceof ElggUser) && ($user->guid > 0)) { - $friends = elgg_echo('friends'); - echo "<a class='myfriends' href=\"{$vars['url']}pg/friends/{$user->username}\" title=\"$friends\">$friends</a>"; -} 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 diff --git a/mod/profile/views/default/river/user/default/profileiconupdate.php b/mod/profile/views/default/river/user/default/profileiconupdate.php deleted file mode 100644 index 1dca77df6..000000000 --- a/mod/profile/views/default/river/user/default/profileiconupdate.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - - $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject(); - - $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; - $string = sprintf(elgg_echo("profile:river:update"),$url) ." <span class='entity_subtext'>" . friendly_time($vars['item']->posted) . "</span>"; - - echo $string;
\ No newline at end of file diff --git a/mod/profile/views/default/river/user/default/profileupdate.php b/mod/profile/views/default/river/user/default/profileupdate.php deleted file mode 100644 index e609e1a40..000000000 --- a/mod/profile/views/default/river/user/default/profileupdate.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - - $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject(); - - $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; - $string = sprintf(elgg_echo("profile:river:update"),$url) ." <span class='entity_subtext'>" . friendly_time($vars['item']->posted) . "</span>"; - -?> - -<?php echo $string; ?>
\ No newline at end of file |
