diff options
author | Fx Nion <http://fxnion.free.fr> | 2012-05-13 19:56:15 +0200 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-05-13 19:56:15 +0200 |
commit | b070daa95241bc0c7d46011a3de7674fbf0c5e68 (patch) | |
tree | 638f771d1708194ab4a1cfb9614b73cd9fbaca5f /views | |
download | elgg-b070daa95241bc0c7d46011a3de7674fbf0c5e68.tar.gz elgg-b070daa95241bc0c7d46011a3de7674fbf0c5e68.tar.bz2 |
v2.4
Diffstat (limited to 'views')
56 files changed, 2979 insertions, 0 deletions
diff --git a/views/default/admin/appearance/custom_index_widgets.php b/views/default/admin/appearance/custom_index_widgets.php new file mode 100644 index 000000000..491c878e5 --- /dev/null +++ b/views/default/admin/appearance/custom_index_widgets.php @@ -0,0 +1,56 @@ +<?php + + +elgg_push_context('custom_index_widgets'); +elgg_set_page_owner_guid(elgg_get_config('site_guid')); + +$num_columns = elgg_extract('num_columns', $vars, 3); +$show_add_widgets = elgg_extract('show_add_widgets', $vars, true); +$exact_match = elgg_extract('exact_match', $vars, true); +$show_access = elgg_extract('show_access', $vars, true); + + +$owner = elgg_get_page_owner_entity(); + + +$context = elgg_get_context(); +$widget_types = elgg_get_widget_types($context, true); +$widgets = elgg_get_widgets($owner->guid, $context); + + +if (elgg_can_edit_widget_layout($context)) { + + if ($show_add_widgets) { + echo elgg_view('page/layouts/widgets/add_button'); + } + $params = array( + 'widgets' => $widgets, + 'context' => $context, + 'exact_match' => $exact_match, + ); + + echo elgg_view('page/layouts/widgets/add_panel', $params); +} + +echo $vars['content']; + +$widget_class = "elgg-col-1of{$num_columns}"; +for ($column_index = 1; $column_index <= $num_columns; $column_index++) { + if (isset($widgets[$column_index])) { + $column_widgets = $widgets[$column_index]; + } else { + $column_widgets = array(); + } + + echo "<div class=\"$widget_class elgg-widgets\" id=\"elgg-widget-col-$column_index\">"; + if (sizeof($column_widgets) > 0) { + foreach ($column_widgets as $widget) { + if (array_key_exists($widget->handler, $widget_types)) { + echo elgg_view_entity($widget, array('show_access' => $show_access)); + } + } + } + echo '</div>'; +} + + diff --git a/views/default/custom_index_widgets/css.php b/views/default/custom_index_widgets/css.php new file mode 100644 index 000000000..c30967cfa --- /dev/null +++ b/views/default/custom_index_widgets/css.php @@ -0,0 +1,347 @@ +<?php
+ /**
+ * Custom Index page css extender
+ *
+ * @package custom_index
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.org/
+ */
+?>
+
+.icon_members {
+ float:left;
+ margin:2pt 5px 3px 0pt;
+}
+
+.icon_latest {
+ margin:0 auto;
+}
+#login-box{
+ width:100%;
+}
+#login-box form{
+ width:auto;
+}
+
+#login-box input[type="text"],
+#login-box input[type="password"]{
+ width: 95%;
+}
+
+#rightcolumn_widgets,
+#leftcolumn_widgets,
+#middlecolumn_widgets{
+ min-height: 1px;
+}
+
+
+#rightcolumn_widgets.small_edit_mode_box,
+#leftcolumn_widgets.small_edit_mode_box,
+#middlecolumn_widgets.small_edit_mode_box,
+#customise_page_view table tr td h2.small_edit_mode_box {
+ margin:5px 10px 0 0;
+ width: auto;
+}
+#rightcolumn_widgets.medium_edit_mode_box,
+#leftcolumn_widgets.medium_edit_mode_box,
+#middlecolumn_widgets.medium_edit_mode_box,
+#customise_page_view table tr td h2.medium_edit_mode_box{
+ margin:5px 10px 0 0;
+ width: auto;
+}
+#rightcolumn_widgets.big_edit_mode_box,
+#leftcolumn_widgets.big_edit_mode_box,
+#middlecolumn_widgets.big_edit_mode_box,
+#customise_page_view table tr td h2.big_edit_mode_box{
+ margin:5px 10px 0 0;
+ width: auto;
+}
+#rightcolumn_widgets.half_edit_mode_box,
+#leftcolumn_widgets.half_edit_mode_box,
+#middlecolumn_widgets.half_edit_mode_box,
+#customise_page_view table tr td h2.half_edit_mode_box{
+ margin:5px 10px 0 0;
+ width: auto;
+}
+
+#rightcolumn_widgets.small_index_mode_box,
+#leftcolumn_widgets.small_index_mode_box,
+#middlecolumn_widgets.small_index_mode_box,
+#customise_page_view table tr td h2.small_index_mode_box {
+ /*width: 312px;*/
+ width: auto;
+ padding: 0 0 5px;
+ margin-right: 10px;
+ border: 0 none;
+}
+#rightcolumn_widgets.medium_index_mode_box,
+#leftcolumn_widgets.medium_index_mode_box,
+#middlecolumn_widgets.medium_index_mode_box,
+#customise_page_view table tr td h2.medium_index_mode_box{
+ /*width: 608px;*/
+ width: auto;
+ padding: 0 0 5px;
+ margin-right: 10px;
+ border: 0 none;
+}
+#rightcolumn_widgets.big_index_mode_box,
+#leftcolumn_widgets.big_index_mode_box,
+#middlecolumn_widgets.big_index_mode_box,
+#customise_page_view table tr td h2.big_index_mode_box{
+ width: auto;
+ padding: 0 0 5px;
+ margin-right: 10px;
+ border: 0 none;
+}
+#rightcolumn_widgets.half_index_mode_box,
+#leftcolumn_widgets.half_index_mode_box,
+#middlecolumn_widgets.half_index_mode_box,
+#customise_page_view.half_index_mode_box h2{
+ /*width: 460px;*/
+ width: auto;
+ padding: 0 0 5px;
+ margin-right: 10px;
+ border: 0 none;
+}
+
+table.index_mode{
+ width: 99%;
+ border: 0 none;
+ margin: 20px 0;
+}
+
+td.small {
+ width: 38%;
+}
+td.half {
+ width: 47%;
+}
+td.medium {
+ width: 57%;
+}
+td.big {
+ width: 100%;
+}
+.logintop{
+ margin:0 auto;
+ padding:0;
+ padding-top: 3px;
+ width:990px;
+}
+.logintop_links{
+ margin-left:80px;
+}
+
+.logintop_links a {
+ margin:0 0 0 2px;
+ color:#999999;
+ padding:3px;
+}
+.logintop_links a:hover {
+ color:#eeeeee;
+}
+
+#logintopform{
+ color: #BBBBBB;
+ font-size: 12px;
+}
+
+#logintopform input.logintop_input {
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ background-color:#FFFFFF;
+ border:1px solid #BBBBBB;
+ color:#999999;
+ font-size:12px;
+ font-weight:bold;
+ margin:0pt;
+ padding:2px;
+ width:180px;
+ height:12px;
+}
+#logintopform input.logintop_submit_button {
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ color:#333333;
+ background: #cccccc;
+ border:none;
+ font-size:12px;
+ font-weight:bold;
+ margin:0px;
+ padding:2px;
+ width:auto;
+ height:18px;
+ cursor:pointer;
+}
+#logintopform input.logintop_submit_button:hover {
+ color:#ffffff;
+ background: #4690d6;
+}
+ +/* *************************************** +STANDARD BOXES +*************************************** */ +.standard_box { + margin: 0 0 20px 0; + height:auto; + +} +/* IE6 fix */ +* html .standard_box { + height:10px; +} +.standard_box_header { + color: #4690d6; + padding: 5px 10px 5px 10px; + margin:0; + border-left: 1px solid white; + border-right: 1px solid #cccccc; + border-bottom: 1px solid #cccccc; + -moz-border-radius-topleft:8px; + -moz-border-radius-topright:8px; + -webkit-border-top-right-radius:8px; + -webkit-border-top-left-radius:8px; + background:#dedede; +} +.standard_box_header h1 { + color: #0054a7; + font-size:1.25em; + line-height: 1.2em; +} +.standard_box_content { + padding: 10px 0 10px 0; + margin:0; + height:auto; + background:#dedede; + -moz-border-radius-bottomleft:8px; + -moz-border-radius-bottomright:8px; + -webkit-border-bottom-right-radius:8px; + -webkit-border-bottom-left-radius:8px; + border-left: 1px solid white; + border-right: 1px solid #cccccc; + border-bottom: 1px solid #cccccc; +} +.standard_box_content .contentWrapper { + margin-bottom:5px; +} +.standard_box_editpanel { + display: none; + background: #a8a8a8; + padding:10px 10px 5px 10px; + border-left: 1px solid white; + border-bottom: 1px solid white; +} +.standard_box_editpanel p { + margin:0 0 5px 0; +} +.standard_box_header a.toggle_box_contents { + color: #4690d6; + cursor:pointer; + font-family: Arial, Helvetica, sans-serif; + font-size:20px; + font-weight: bold; + text-decoration:none; + float:right; + margin: 0; + margin-top: -7px; +} +.standard_box_header a.toggle_box_edit_panel { + color: #4690d6; + cursor:pointer; + font-size:9px; + text-transform: uppercase; + text-decoration:none; + font-weight: normal; + float:right; + margin: 3px 10px 0 0; +} +.standard_box_editpanel label { + font-weight: normal; + font-size: 100%; +} + + +/* *************************************** +PLAIN BOXES +*************************************** */ +.plain_box , .plain.collapsable_box{ + margin: 0 0 20px 0; + height:auto; + +} +/* IE6 fix */ +* html .plain_box , * html .plain.collapsable_box { + height:10px; +} +.plain_box_header , .plain.collapsable_box_header{ + color: #4690d6; + padding: 5px 10px 5px 10px; + margin:0; + border-left: 1px solid #cccccc; + border-right: 1px solid #cccccc; + border-top: 1px solid #cccccc; + -moz-border-radius-topleft:8px; + -moz-border-radius-topright:8px; + -webkit-border-top-right-radius:8px; + -webkit-border-top-left-radius:8px; + background:transparent; +} +.plain_box_header h1, .plain.collapsable_box_header h1 { + color: #0054a7; + font-size:1.25em; + line-height: 1.2em; +} +.plain_box_content, .plain.collapsable_box_content { + padding: 10px 0 10px 0; + margin:0; + height:auto; + -moz-border-radius-bottomleft:8px; + -moz-border-radius-bottomright:8px; + -webkit-border-bottom-right-radius:8px; + -webkit-border-bottom-left-radius:8px; + border-left: 1px solid #cccccc; + border-right: 1px solid #cccccc; + border-bottom: 1px solid #cccccc; + background:transparent; + +} +.plain_box_content .contentWrapper , .plain.collapsable_box_content .contentWrapper{ + margin-bottom:5px; +} +.plain_box_editpanel .plain.collapsable_box_editpanel{ + display: none; + background: #a8a8a8; + padding:10px 10px 5px 10px; + border-left: 1px solid white; + border-bottom: 1px solid white; +} +.plain_box_editpanel p , .plain.collapsable_box_editpanel{ + margin:0 0 5px 0; +} +.plain_box_header a.toggle_box_contents , .plain.collapsable_box_header a.toggle_box_contents{ + color: #4690d6; + cursor:pointer; + font-family: Arial, Helvetica, sans-serif; + font-size:20px; + font-weight: bold; + text-decoration:none; + float:right; + margin: 0; + margin-top: -7px; +} +.plain_box_header a.toggle_box_edit_panel , .plain.collapsable_box_header a.toggle_box_edit_panel { + color: #4690d6; + cursor:pointer; + font-size:9px; + text-transform: uppercase; + text-decoration:none; + font-weight: normal; + float:right; + margin: 3px 10px 0 0; +} +.plain_box_editpanel label , .plain.collapsable_box_editpanel label{ + font-weight: normal; + font-size: 100%; +} diff --git a/views/default/custom_index_widgets/footerlinks.php b/views/default/custom_index_widgets/footerlinks.php new file mode 100644 index 000000000..ed92a9032 --- /dev/null +++ b/views/default/custom_index_widgets/footerlinks.php @@ -0,0 +1,3 @@ +<div class="mts float-alt"> +<a href="http://fxnion.free.fr/"><img src="<?php echo elgg_get_site_url(); ?>mod/custom_index_widgets/images/fxnion_elgg_custom_index.gif" alt="Elgg Custom index by Fx Nion" title="Elgg Custom index by Fx Nion"/></a> +</div> diff --git a/views/default/custom_index_widgets/js.php b/views/default/custom_index_widgets/js.php new file mode 100644 index 000000000..9b432d90b --- /dev/null +++ b/views/default/custom_index_widgets/js.php @@ -0,0 +1 @@ +<script type="text/javascript" src="<?php echo $vars['url']; ?>mod/custom_index_widgets/vendors/swfobject.js"></script>
<script type="text/javascript">
/*
* jQuery Media Plugin for converting elements into rich media content.
*
* Examples and documentation at: http://malsup.com/jquery/media/
* Copyright (c) 2007-2008 M. Alsup
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* @author: M. Alsup
* @version: 0.92 (24-SEP-2009)
* @requires jQuery v1.1.2 or later
* $Id: jquery.media.js 2460 2007-07-23 02:53:15Z malsup $
*
* Supported Media Players:
* - Flash
* - Quicktime
* - Real Player
* - Silverlight
* - Windows Media Player
* - iframe
*
* Supported Media Formats:
* Any types supported by the above players, such as:
* Video: asf, avi, flv, mov, mpg, mpeg, mp4, qt, smil, swf, wmv, 3g2, 3gp
* Audio: aif, aac, au, gsm, mid, midi, mov, mp3, m4a, snd, rm, wav, wma
* Other: bmp, html, pdf, psd, qif, qtif, qti, tif, tiff, xaml
*
* Thanks to Mark Hicken and Brent Pedersen for helping me debug this on the Mac!
* Thanks to Dan Rossi for numerous bug reports and code bits!
* Thanks to Skye Giordano for several great suggestions!
* Thanks to Richard Connamacher for excellent improvements to the non-IE behavior!
*/
;(function($) {
/**
* Chainable method for converting elements into rich media.
*
* @param options
* @param callback fn invoked for each matched element before conversion
* @param callback fn invoked for each matched element after conversion
*/
$.fn.media = function(options, f1, f2) {
if (options == 'undo') {
return this.each(function() {
var $this = $(this);
var html = $this.data('media.origHTML');
if (html)
$this.replaceWith(html);
});
}
return this.each(function() {
if (typeof options == 'function') {
f2 = f1;
f1 = options;
options = {};
}
var o = getSettings(this, options);
// pre-conversion callback, passes original element and fully populated options
if (typeof f1 == 'function') f1(this, o);
var r = getTypesRegExp();
var m = r.exec(o.src.toLowerCase()) || [''];
o.type ? m[0] = o.type : m.shift();
for (var i=0; i < m.length; i++) {
fn = m[i].toLowerCase();
if (isDigit(fn[0])) fn = 'fn' + fn; // fns can't begin with numbers
if (!$.fn.media[fn])
continue; // unrecognized media type
// normalize autoplay settings
var player = $.fn.media[fn+'_player'];
if (!o.params) o.params = {};
if (player) {
var num = player.autoplayAttr == 'autostart';
o.params[player.autoplayAttr || 'autoplay'] = num ? (o.autoplay ? 1 : 0) : o.autoplay ? true : false;
}
var $div = $.fn.media[fn](this, o);
$div.css('backgroundColor', o.bgColor).width(o.width);
if (o.canUndo) {
var $temp = $('<div></div>').append(this);
$div.data('media.origHTML', $temp.html()); // store original markup
}
// post-conversion callback, passes original element, new div element and fully populated options
if (typeof f2 == 'function') f2(this, $div[0], o, player.name);
break;
}
});
};
/**
* Non-chainable method for adding or changing file format / player mapping
* @name mapFormat
* @param String format File format extension (ie: mov, wav, mp3)
* @param String player Player name to use for the format (one of: flash, quicktime, realplayer, winmedia, silverlight or iframe
*/
$.fn.media.mapFormat = function(format, player) {
if (!format || !player || !$.fn.media.defaults.players[player]) return; // invalid
format = format.toLowerCase();
if (isDigit(format[0])) format = 'fn' + format;
$.fn.media[format] = $.fn.media[player];
$.fn.media[format+'_player'] = $.fn.media.defaults.players[player];
};
// global defautls; override as needed
$.fn.media.defaults = {
standards: false, // use object tags only (no embeds for non-IE browsers)
canUndo: true, // tells plugin to store the original markup so it can be reverted via: $(sel).mediaUndo()
width: 400,
height: 400,
autoplay: 0, // normalized cross-player setting
bgColor: '#ffffff', // background color
params: { wmode: 'transparent'}, // added to object element as param elements; added to embed element as attrs
attrs: {}, // added to object and embed elements as attrs
flvKeyName: 'file', // key used for object src param (thanks to Andrea Ercolino)
flashvars: {}, // added to flash content as flashvars param/attr
flashVersion: '7', // required flash version
expressInstaller: null, // src for express installer
// default flash video and mp3 player (@see: http://jeroenwijering.com/?item=Flash_Media_Player)
flvPlayer: '<?php echo $vars["url"]; ?>mod/custom_index_widgets/vendors/player.swf',
mp3Player: '<?php echo $vars["url"]; ?>mod/custom_index_widgets/vendors/player.swf',
// @see http://msdn2.microsoft.com/en-us/library/bb412401.aspx
silverlight: {
inplaceInstallPrompt: 'true', // display in-place install prompt?
isWindowless: 'true', // windowless mode (false for wrapping markup)
framerate: '24', // maximum framerate
version: '0.9', // Silverlight version
onError: null, // onError callback
onLoad: null, // onLoad callback
initParams: null, // object init params
userContext: null // callback arg passed to the load callback
}
};
// Media Players; think twice before overriding
$.fn.media.defaults.players = {
flash: {
name: 'flash',
title: 'Flash',
types: 'flv,mp3,swf',
mimetype: 'application/x-shockwave-flash',
pluginspage: 'http://www.adobe.com/go/getflashplayer',
ieAttrs: {
classid: 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
type: 'application/x-oleobject',
codebase: 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + $.fn.media.defaults.flashVersion
}
},
quicktime: {
name: 'quicktime',
title: 'QuickTime',
mimetype: 'video/quicktime',
pluginspage: 'http://www.apple.com/quicktime/download/',
types: 'aif,aiff,aac,au,bmp,gsm,mov,mid,midi,mpg,mpeg,mp4,m4a,psd,qt,qtif,qif,qti,snd,tif,tiff,wav,3g2,3gp',
ieAttrs: {
classid: 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
codebase: 'http://www.apple.com/qtactivex/qtplugin.cab'
}
},
realplayer: {
name: 'real',
title: 'RealPlayer',
types: 'ra,ram,rm,rpm,rv,smi,smil',
mimetype: 'audio/x-pn-realaudio-plugin',
pluginspage: 'http://www.real.com/player/',
autoplayAttr: 'autostart',
ieAttrs: {
classid: 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'
}
},
winmedia: {
name: 'winmedia',
title: 'Windows Media',
types: 'asx,asf,avi,wma,wmv',
mimetype: $.browser.mozilla && isFirefoxWMPPluginInstalled() ? 'application/x-ms-wmp' : 'application/x-mplayer2',
pluginspage: 'http://www.microsoft.com/Windows/MediaPlayer/',
autoplayAttr: 'autostart',
oUrl: 'url',
ieAttrs: {
classid: 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6',
type: 'application/x-oleobject'
}
},
// special cases
iframe: {
name: 'iframe',
types: 'html,pdf'
},
silverlight: {
name: 'silverlight',
types: 'xaml'
}
};
//
// everything below here is private
//
// detection script for FF WMP plugin (http://www.therossman.org/experiments/wmp_play.html)
// (hat tip to Mark Ross for this script)
function isFirefoxWMPPluginInstalled() {
var plugs = navigator.plugins;
for (i = 0; i < plugs.length; i++) {
var plugin = plugs[i];
if (plugin['filename'] == 'np-mswmp.dll')
return true;
}
return false;
}
var counter = 1;
for (var player in $.fn.media.defaults.players) {
var types = $.fn.media.defaults.players[player].types;
$.each(types.split(','), function(i,o) {
if (isDigit(o[0])) o = 'fn' + o;
$.fn.media[o] = $.fn.media[player] = getGenerator(player);
$.fn.media[o+'_player'] = $.fn.media.defaults.players[player];
});
};
function getTypesRegExp() {
var types = '';
for (var player in $.fn.media.defaults.players) {
if (types.length) types += ',';
types += $.fn.media.defaults.players[player].types;
};
return new RegExp('\\.(' + types.replace(/,/ig,'|') + ')\\b');
};
function getGenerator(player) {
return function(el, options) {
return generate(el, options, player);
};
};
function isDigit(c) {
return '0123456789'.indexOf(c) > -1;
};
// flatten all possible options: global defaults, meta, option obj
function getSettings(el, options) {
options = options || {};
var $el = $(el);
var cls = el.className || '';
// support metadata plugin (v1.0 and v2.0)
var meta = $.metadata ? $el.metadata() : $.meta ? $el.data() : {};
meta = meta || {};
var w = meta.width || parseInt(((cls.match(/w:(\d+)/)||[])[1]||0));
var h = meta.height || parseInt(((cls.match(/h:(\d+)/)||[])[1]||0));
if (w) meta.width = w;
if (h) meta.height = h;
if (cls) meta.cls = cls;
var a = $.fn.media.defaults;
var b = options;
var c = meta;
var p = { params: { bgColor: options.bgColor || $.fn.media.defaults.bgColor } };
var opts = $.extend({}, a, b, c);
$.each(['attrs','params','flashvars','silverlight'], function(i,o) {
opts[o] = $.extend({}, p[o] || {}, a[o] || {}, b[o] || {}, c[o] || {});
});
if (typeof opts.caption == 'undefined') opts.caption = $el.text();
// make sure we have a source!
opts.src = opts.src || $el.attr('href') || $el.attr('src') || 'unknown';
return opts;
};
//
// Flash Player
//
// generate flash using SWFObject library if possible
$.fn.media.swf = function(el, opts) {
if (!window.SWFObject && !window.swfobject) {
// roll our own
if (opts.flashvars) {
var a = [];
for (var f in opts.flashvars)
a.push(f + '=' + opts.flashvars[f]);
if (!opts.params) opts.params = {};
opts.params.flashvars = a.join('&');
}
return generate(el, opts, 'flash');
}
var id = el.id ? (' id="'+el.id+'"') : '';
var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
var $div = $('<div' + id + cls + '>');
// swfobject v2+
if (window.swfobject) {
$(el).after($div).appendTo($div);
if (!el.id) el.id = 'movie_player_' + counter++;
// replace el with swfobject content
swfobject.embedSWF(opts.src, el.id, opts.width, opts.height, opts.flashVersion,
opts.expressInstaller, opts.flashvars, opts.params, opts.attrs);
}
// swfobject < v2
else {
$(el).after($div).remove();
var so = new SWFObject(opts.src, 'movie_player_' + counter++, opts.width, opts.height, opts.flashVersion, opts.bgColor);
if (opts.expressInstaller) so.useExpressInstall(opts.expressInstaller);
for (var p in opts.params)
if (p != 'bgColor') so.addParam(p, opts.params[p]);
for (var f in opts.flashvars)
so.addVariable(f, opts.flashvars[f]);
so.write($div[0]);
}
if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
return $div;
};
// map flv and mp3 files to the swf player by default
$.fn.media.flv = $.fn.media.mp3 = function(el, opts) {
var src = opts.src;
var player = /\.mp3\b/i.test(src) ? $.fn.media.defaults.mp3Player : $.fn.media.defaults.flvPlayer;
var key = opts.flvKeyName;
src = encodeURIComponent(src);
opts.src = player;
opts.src = opts.src + '?'+key+'=' + (src);
var srcObj = {};
srcObj[key] = src;
opts.flashvars = $.extend({}, srcObj, opts.flashvars );
return $.fn.media.swf(el, opts);
};
//
// Silverlight
//
$.fn.media.xaml = function(el, opts) {
if (!window.Sys || !window.Sys.Silverlight) {
if ($.fn.media.xaml.warning) return;
$.fn.media.xaml.warning = 1;
alert('You must include the Silverlight.js script.');
return;
}
var props = {
width: opts.width,
height: opts.height,
background: opts.bgColor,
inplaceInstallPrompt: opts.silverlight.inplaceInstallPrompt,
isWindowless: opts.silverlight.isWindowless,
framerate: opts.silverlight.framerate,
version: opts.silverlight.version
};
var events = {
onError: opts.silverlight.onError,
onLoad: opts.silverlight.onLoad
};
var id1 = el.id ? (' id="'+el.id+'"') : '';
var id2 = opts.id || 'AG' + counter++;
// convert element to div
var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
var $div = $('<div' + id1 + cls + '>');
$(el).after($div).remove();
Sys.Silverlight.createObjectEx({
source: opts.src,
initParams: opts.silverlight.initParams,
userContext: opts.silverlight.userContext,
id: id2,
parentElement: $div[0],
properties: props,
events: events
});
if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
return $div;
};
//
// generate object/embed markup
//
function generate(el, opts, player) {
var $el = $(el);
var o = $.fn.media.defaults.players[player];
if (player == 'iframe') {
var o = $('<iframe' + ' width="' + opts.width + '" height="' + opts.height + '" >');
o.attr('src', opts.src);
o.css('backgroundColor', o.bgColor);
}
else if ($.browser.msie) {
var a = ['<object width="' + opts.width + '" height="' + opts.height + '" '];
for (var key in opts.attrs)
a.push(key + '="'+opts.attrs[key]+'" ');
for (var key in o.ieAttrs || {}) {
var v = o.ieAttrs[key];
if (key == 'codebase' && window.location.protocol == 'https:')
v = v.replace('http','https');
a.push(key + '="'+v+'" ');
}
a.push('></ob'+'ject'+'>');
var p = ['<param name="' + (o.oUrl || 'src') +'" value="' + opts.src + '">'];
for (var key in opts.params)
p.push('<param name="'+ key +'" value="' + opts.params[key] + '">');
var o = document.createElement(a.join(''));
for (var i=0; i < p.length; i++)
o.appendChild(document.createElement(p[i]));
}
else if (o.standards) {
// Rewritten to be standards compliant by Richard Connamacher
var a = ['<object type="' + o.mimetype +'" width="' + opts.width + '" height="' + opts.height +'"'];
if (opts.src) a.push(' data="' + opts.src + '" ');
a.push('>');
a.push('<param name="' + (o.oUrl || 'src') +'" value="' + opts.src + '">');
for (var key in opts.params) {
if (key == 'wmode' && player != 'flash') // FF3/Quicktime borks on wmode
continue;
a.push('<param name="'+ key +'" value="' + opts.params[key] + '">');
}
// Alternate HTML
a.push('<div><p><strong>'+o.title+' Required</strong></p><p>'+o.title+' is required to view this media. <a href="'+o.pluginspage+'">Download Here</a>.</p></div>');
a.push('</ob'+'ject'+'>');
}
else {
var a = ['<embed width="' + opts.width + '" height="' + opts.height + '" style="display:block"'];
if (opts.src) a.push(' src="' + opts.src + '" ');
for (var key in opts.attrs)
a.push(key + '="'+opts.attrs[key]+'" ');
for (var key in o.eAttrs || {})
a.push(key + '="'+o.eAttrs[key]+'" ');
for (var key in opts.params) {
if (key == 'wmode' && player != 'flash') // FF3/Quicktime borks on wmode
continue;
a.push(key + '="'+opts.params[key]+'" ');
}
a.push('></em'+'bed'+'>');
}
// convert element to div
var id = el.id ? (' id="'+el.id+'"') : '';
var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
var $div = $('<div' + id + cls + '>');
$el.after($div).remove();
($.browser.msie || player == 'iframe') ? $div.append(o) : $div.html(a.join(''));
if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
return $div;
};
})(jQuery);
</script>
\ No newline at end of file diff --git a/views/default/page/layouts/edit_widgets.php b/views/default/page/layouts/edit_widgets.php new file mode 100644 index 000000000..f61cea356 --- /dev/null +++ b/views/default/page/layouts/edit_widgets.php @@ -0,0 +1,61 @@ +<?php +/** + * Elgg widgets layout + * + * @uses $vars['content'] Optional display box at the top of layout + * @uses $vars['num_columns'] Number of widget columns for this layout (3) + * @uses $vars['show_add_widgets'] Display the add widgets button and panel (true) + * @uses $vars['exact_match'] Widgets must match the current context (false) + * @uses $vars['show_access'] Show the access control (true) + */ + +$num_columns = elgg_extract('num_columns', $vars, 3); +$show_add_widgets = elgg_extract('show_add_widgets', $vars, true); +$exact_match = elgg_extract('exact_match', $vars, false); +$show_access = elgg_extract('show_access', $vars, true); + +$owner = elgg_get_page_owner_entity(); + +$widget_types = elgg_get_widget_types(); + +$context = elgg_get_context(); +//elgg_push_context('widgets'); + +$widgets = elgg_get_widgets($owner->guid, $context); + +if (elgg_can_edit_widget_layout($context)) { + if ($show_add_widgets) { + echo elgg_view('page/layouts/widgets/add_button'); + } + $params = array( + 'widgets' => $widgets, + 'context' => $context, + 'exact_match' => $exact_match, + ); + echo elgg_view('page/layouts/widgets/add_panel', $params); +} + +echo $vars['content']; + +$widget_class = "elgg-col-1of{$num_columns}"; +for ($column_index = 1; $column_index <= $num_columns; $column_index++) { + if (isset($widgets[$column_index])) { + $column_widgets = $widgets[$column_index]; + } else { + $column_widgets = array(); + } + + echo "<div class=\"$widget_class elgg-widgets\" id=\"elgg-widget-col-$column_index\">"; + if (sizeof($column_widgets) > 0) { + foreach ($column_widgets as $widget) { + if (array_key_exists($widget->handler, $widget_types)) { + echo elgg_view_entity($widget, array('show_access' => $show_access)); + } + } + } + echo '</div>'; +} + +elgg_pop_context(); + +echo elgg_view('graphics/ajax_loader', array('id' => 'elgg-widget-loader')); diff --git a/views/default/page/layouts/index.php b/views/default/page/layouts/index.php new file mode 100644 index 000000000..a73a0d7b1 --- /dev/null +++ b/views/default/page/layouts/index.php @@ -0,0 +1,30 @@ +<?php + $area1widgets = $vars['area1']; + $area2widgets = $vars['area2']; + $area3widgets = $vars['area3']; + $layoutmode = $vars['layoutmode']; //edit, index +?> + + <table cellspacing="10" cellpadding="10" width="100%" class="<?php echo elgg_echo($layoutmode); ?>"> + <tr> + <td align="left" valign="top" class="half"> + <div id="leftcolumn_widgets" class="half_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area1widgets) ?> + </div> + </td> + <td align="left" valign="top" class="half"> + <div id="middlecolumn_widgets" class="half_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area2widgets) ?> + </div> + </td> + </tr> + <tr > + <td colspan="2" align="left" valign="top" class="big"> + <div id="rightcolumn_widgets" class="big_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area3widgets) ?> + </div> + </td> + </tr> + </table> + + diff --git a/views/default/page/layouts/index_1rsss.php b/views/default/page/layouts/index_1rsss.php new file mode 100644 index 000000000..c99bdd720 --- /dev/null +++ b/views/default/page/layouts/index_1rsss.php @@ -0,0 +1,30 @@ +<?php
+ $area1widgets = $vars['area1'];
+ $area2widgets = $vars['area2'];
+ $area3widgets = $vars['area3'];
+ $layoutmode = $vars['layoutmode']; //edit, index
+?>
+
+ <table cellspacing="10" cellpadding="10" width="100%" class="<?php echo elgg_echo($layoutmode); ?>">
+ <tr>
+ <td align="left" valign="top" class="half">
+ <div id="leftcolumn_widgets" class="half_<?php echo elgg_echo($layoutmode); ?>_box">
+ <?php custom_index_show_widget_area($area1widgets) ?>
+ </div>
+ </td>
+ <td align="left" valign="top" class="half">
+ <div id="middlecolumn_widgets" class="half_<?php echo elgg_echo($layoutmode); ?>_box">
+ <?php custom_index_show_widget_area($area2widgets) ?>
+ </div>
+ </td>
+ </tr>
+ <tr >
+ <td colspan="2" align="left" valign="top" class="big">
+ <div id="rightcolumn_widgets" class="big_<?php echo elgg_echo($layoutmode); ?>_box">
+ <?php custom_index_show_widget_area($area3widgets) ?>
+ </div>
+ </td>
+ </tr>
+ </table>
+
+
diff --git a/views/default/page/layouts/index_2rbhh.php b/views/default/page/layouts/index_2rbhh.php new file mode 100644 index 000000000..7f8c22437 --- /dev/null +++ b/views/default/page/layouts/index_2rbhh.php @@ -0,0 +1,30 @@ +<?php + $area1widgets = $vars['area1']; + $area2widgets = $vars['area2']; + $area3widgets = $vars['area3']; + $layoutmode = $vars['layoutmode']; //edit, index +?> + + <table cellspacing="10" cellpadding="10" width="100%" class="<?php echo elgg_echo($layoutmode); ?>"> + <tr> + <td colspan="2" align="left" valign="top" class="big"> + <div id="leftcolumn_widgets" class="big_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area1widgets) ?> + </div> + </td> + </tr> + <tr> + <td align="left" valign="top" class="half"> + <div id="middlecolumn_widgets" class="half_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area2widgets) ?> + </div> + </td> + <td align="left" valign="top" class="half"> + <div id="rightcolumn_widgets" class="half_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area3widgets) ?> + </div> + </td> + </tr> + </table> + + diff --git a/views/default/page/layouts/index_2rbms.php b/views/default/page/layouts/index_2rbms.php new file mode 100644 index 000000000..fdb0cf38b --- /dev/null +++ b/views/default/page/layouts/index_2rbms.php @@ -0,0 +1,30 @@ +<?php
+ $area1widgets = $vars['area1'];
+ $area2widgets = $vars['area2'];
+ $area3widgets = $vars['area3'];
+ $layoutmode = $vars['layoutmode']; //edit, index
+?>
+
+ <table cellspacing="10" cellpadding="10" width="100%" class="<?php echo elgg_echo($layoutmode); ?>">
+ <tr>
+ <td colspan="2" align="left" valign="top" class="big">
+ <div id="leftcolumn_widgets" class="big_<?php echo elgg_echo($layoutmode); ?>_box">
+ <?php custom_index_show_widget_area($area1widgets) ?>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td align="left" valign="top" class="medium">
+ <div id="middlecolumn_widgets" class="medium_<?php echo elgg_echo($layoutmode); ?>_box">
+ <?php custom_index_show_widget_area($area2widgets) ?>
+ </div>
+ </td>
+ <td align="left" valign="top" class="small">
+ <div id="rightcolumn_widgets" class="small_<?php echo elgg_echo($layoutmode); ?>_box">
+ <?php custom_index_show_widget_area($area3widgets) ?>
+ </div>
+ </td>
+ </tr>
+ </table>
+
+
diff --git a/views/default/page/layouts/index_2rbsm.php b/views/default/page/layouts/index_2rbsm.php new file mode 100644 index 000000000..d5a81f1f5 --- /dev/null +++ b/views/default/page/layouts/index_2rbsm.php @@ -0,0 +1,28 @@ +<?php + $area1widgets = $vars['area1']; + $area2widgets = $vars['area2']; + $area3widgets = $vars['area3']; + $layoutmode = $vars['layoutmode']; //edit, index +?> + + <table cellspacing="10" cellpadding="10" width="100%" class="<?php echo elgg_echo($layoutmode); ?>"> + <tr> + <td colspan="2" align="left" valign="top" class="big"> + <div id="leftcolumn_widgets" class="big_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area1widgets) ?> + </div> + </td> + </tr> + <tr> + <td align="left" valign="top" class="small"> + <div id="middlecolumn_widgets" class="small_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area2widgets) ?> + </div> + </td> + <td align="left" valign="top" class="medium"> + <div id="rightcolumn_widgets" class="medium_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area3widgets) ?> + </div> + </td> + </tr> + </table>
\ No newline at end of file diff --git a/views/default/page/layouts/index_2rhhb.php b/views/default/page/layouts/index_2rhhb.php new file mode 100644 index 000000000..ae2995ff9 --- /dev/null +++ b/views/default/page/layouts/index_2rhhb.php @@ -0,0 +1,30 @@ +<?php + $area1widgets = $vars['area1']; + $area2widgets = $vars['area2']; + $area3widgets = $vars['area3']; + $layoutmode = $vars['layoutmode']; //edit, index +?> + + <table cellspacing="10" cellpadding="10" width="100%" class="<?php echo elgg_echo($layoutmode); ?>"> + <tr> + <td align="left" valign="top" class="half"> + <div id="leftcolumn_widgets" class="half_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area1widgets) ?> + </div> + </td> + <td align="left" valign="top" class="half"> + <div id="middlecolumn_widgets" class="half_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area2widgets) ?> + </div> + </td> + </tr> + <tr> + <td colspan="2" align="left" valign="top" class="big"> + <div id="rightcolumn_widgets" class="big_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area3widgets) ?> + </div> + </td> + </tr> + </table> + + diff --git a/views/default/page/layouts/index_2rmsb.php b/views/default/page/layouts/index_2rmsb.php new file mode 100644 index 000000000..a774a4a42 --- /dev/null +++ b/views/default/page/layouts/index_2rmsb.php @@ -0,0 +1,30 @@ +<?php
+ $area1widgets = $vars['area1'];
+ $area2widgets = $vars['area2'];
+ $area3widgets = $vars['area3'];
+ $layoutmode = $vars['layoutmode']; //edit, index
+?>
+
+ <table cellspacing="10" cellpadding="10" width="100%" class="<?php echo elgg_echo($layoutmode); ?>">
+ <tr>
+ <td align="left" valign="top" class="medium">
+ <div id="leftcolumn_widgets" class="medium_<?php echo elgg_echo($layoutmode); ?>_box">
+ <?php custom_index_show_widget_area($area1widgets) ?>
+ </div>
+ </td>
+ <td align="left" valign="top" class="small">
+ <div id="middlecolumn_widgets" class="small_<?php echo elgg_echo($layoutmode); ?>_box">
+ <?php custom_index_show_widget_area($area2widgets) ?>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" align="left" valign="top" class="big">
+ <div id="rightcolumn_widgets" class="big_<?php echo elgg_echo($layoutmode); ?>_box">
+ <?php custom_index_show_widget_area($area3widgets) ?>
+ </div>
+ </td>
+ </tr>
+ </table>
+
+
diff --git a/views/default/page/layouts/index_2rsmb.php b/views/default/page/layouts/index_2rsmb.php new file mode 100644 index 000000000..72bb92d3d --- /dev/null +++ b/views/default/page/layouts/index_2rsmb.php @@ -0,0 +1,30 @@ +<?php + $area1widgets = $vars['area1']; + $area2widgets = $vars['area2']; + $area3widgets = $vars['area3']; + $layoutmode = $vars['layoutmode']; //edit, index +?> + + <table cellspacing="10" cellpadding="10" width="100%" class="<?php echo elgg_echo($layoutmode); ?>"> + <tr> + <td align="left" valign="top" class="small"> + <div id="leftcolumn_widgets" class="small_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area1widgets) ?> + </div> + </td> + <td align="left" valign="top" class="medium"> + <div id="middlecolumn_widgets" class="medium_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area2widgets) ?> + </div> + </td> + </tr> + <tr> + <td colspan="2" align="left" valign="top" class="big"> + <div id="rightcolumn_widgets" class="big_<?php echo elgg_echo($layoutmode); ?>_box"> + <?php custom_index_show_widget_area($area3widgets) ?> + </div> + </td> + </tr> + </table> + + diff --git a/views/default/plugins/custom_index_widgets/settings.php b/views/default/plugins/custom_index_widgets/settings.php new file mode 100644 index 000000000..ef70eeb8d --- /dev/null +++ b/views/default/plugins/custom_index_widgets/settings.php @@ -0,0 +1,61 @@ +<?php
+
+?>
+<div>
+ <div class="contentWrapper">
+ <table>
+ <tr>
+ <td style="width:50%"><?php echo elgg_echo("custom_index_widgets:layout"); ?></td>
+ <td>
+ <?php echo elgg_view('input/dropdown', array(
+ 'name' => 'params[ciw_layout]',
+ 'options_values' => array(
+ 'index' => 'Default',
+ 'index_2rmsb' => elgg_echo('custom_index_widgets:index_2rmsb'),
+ 'index_2rsmb' => elgg_echo('custom_index_widgets:index_2rsmb'),
+ 'index_2rhhb' => elgg_echo('custom_index_widgets:index_2rhhb'),
+ 'index_2rbhh' => elgg_echo('custom_index_widgets:index_2rbhh'),
+
+ 'index_2rbsm' => elgg_echo('custom_index_widgets:index_2rbsm'),
+ 'index_2rbms' => elgg_echo('custom_index_widgets:index_2rbms'),
+
+ 'index_1rsss' => elgg_echo('custom_index_widgets:index_1rsss')
+
+ ),
+ 'value' => $vars["entity"]->ciw_layout
+ ));
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td style="width:50%"><?php echo elgg_echo("custom_index_widgets:login_style"); ?></td>
+ <td>
+ <?php echo elgg_view('input/dropdown', array(
+ 'name' => 'params[login_style]',
+ 'options_values' => array(
+ 'inlayout' => elgg_echo('custom_index_widgets:inlayout'),
+ 'topbar' => elgg_echo('custom_index_widgets:topbar'),
+ ),
+ 'value' => $vars["entity"]->login_style
+ ));
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td style="width:50%"><?php echo elgg_echo("custom_index_widgets:showdashboard"); ?></td>
+ <td>
+ <?php echo elgg_view('input/dropdown', array(
+ 'name' => 'params[ciw_showdashboard]',
+ 'options_values' => array(
+ 'yes' => elgg_echo('custom_index_widgets:showdashboard_yes'),
+ 'no' => elgg_echo('custom_index_widgets:showdashboard_no'),
+ ),
+ 'value' => $vars["entity"]->ciw_showdashboard
+ ));
+ ?>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+</div>
diff --git a/views/default/widgets/cloud_generic_index/content.php b/views/default/widgets/cloud_generic_index/content.php new file mode 100644 index 000000000..d87e70b16 --- /dev/null +++ b/views/default/widgets/cloud_generic_index/content.php @@ -0,0 +1,29 @@ +<?php
+
+$maintype = "object";
+$subtype = $vars["entity"]->widget_subtype;
+
+if ($subtype == 'user') {$maintype='user'; $subtype='';}
+if ($subtype == 'group') {$maintype='group'; $subtype='';}
+
+$num_items = $vars['entity']->num_items;
+if (!isset($num_items))
+ $num_items = 20;
+
+$metadata_name = $vars['entity']->metadata_name;
+if (!isset($metadata_name))
+ $metadata_name = "";
+
+$threshold = $vars['entity']->threshold;
+if (!isset($threshold))
+ $threshold = 1;
+
+$widget_group = $vars["entity"]->widget_group;
+if (!isset($widget_group)) $widget_group = "";
+
+
+
+$body = elgg_view_tagcloud($threshold, $num_items, $metadata_name, $maintype, $subtype, $widget_group , -1);;
+echo $body;
+
+?>
diff --git a/views/default/widgets/cloud_generic_index/edit.php b/views/default/widgets/cloud_generic_index/edit.php new file mode 100644 index 000000000..674605568 --- /dev/null +++ b/views/default/widgets/cloud_generic_index/edit.php @@ -0,0 +1,103 @@ + <?php + $num_items = $vars['entity']->num_items; + if (!isset($num_items)) $num_items = 10; + + $widget_group = $vars["entity"]->widget_group; + if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE; + + $metadata_name = $vars['entity']->metadata_name; + if (!isset($metadata_name)) $metadata_name = ""; + + $threshold = $vars['entity']->threshold; + if (!isset($threshold)) $threshold = 1; + + $widget_title = $vars['entity']->widget_title; + $widget_group = $vars["entity"]->widget_group; + $widget_subtype = $vars["entity"]->widget_subtype; + + $guest_only = $vars['entity']->guest_only; + if (!isset($guest_only)) $guest_only = "no"; + + $box_style = $vars['entity']->box_style; + if (!isset($box_style)) $box_style = "collapsable"; + ?> + <p> + <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> + : + <?php + echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:widget_subtype'); ?> + : + <?php + + $subtypes = get_data("SELECT subtype from {$CONFIG->dbprefix}entity_subtypes"); + $subtype_list = array(); + $subtype_list['All'] = ''; + $subtype_list['user'] = 'user'; + $subtype_list['group'] = 'group'; + + if ($subtypes) { + foreach ($subtypes as $data) { + $subtype_list[$data->subtype] = $data->subtype; + } + } + echo elgg_view('input/dropdown', array('name'=>'params[widget_subtype]', 'options_values'=>$subtype_list, 'value'=>$widget_subtype)); + ?> + </p> + <p> + <?php echo elgg_echo('group'); ?> + : + <?php + $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); + $group_list = array(); + $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); + if ($groups) { + foreach ($groups as $group) { + $group_list[$group->getGUID()] = $group->name; + } + } + echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:threshold'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[threshold]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$thresholds)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:num_items'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:metadata_name'); ?> + : + <?php + echo elgg_view('input/text', array('name'=>'params[metadata_name]', 'value'=>$metadata_name)); + ?> + </p> +<p> + <?php echo elgg_echo('custom_index_widgets:box_style'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[box_style]', + 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), + 'value'=>$box_style)); + ?> +</p> +<p> + <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', + 'options_values'=>array('yes'=>'yes', 'no'=>'no'), + 'value'=>$guest_only)); + ?> +</p>
\ No newline at end of file diff --git a/views/default/widgets/feed_reader_index/content.php b/views/default/widgets/feed_reader_index/content.php new file mode 100644 index 000000000..2695315d5 --- /dev/null +++ b/views/default/widgets/feed_reader_index/content.php @@ -0,0 +1,8 @@ +<?php
+
+ include elgg_get_plugins_path() . 'simplepie/views/default/widgets/feed_reader/content.php';
+
+ //$body = elgg_view("simplepie/widgets/feed_reader/content", $vars);
+ //echo $body;
+
+?>
diff --git a/views/default/widgets/feed_reader_index/edit.php b/views/default/widgets/feed_reader_index/edit.php new file mode 100644 index 000000000..5fc36bc54 --- /dev/null +++ b/views/default/widgets/feed_reader_index/edit.php @@ -0,0 +1,5 @@ +<?php
+ include elgg_get_plugins_path() . 'simplepie/views/default/widgets/feed_reader/edit.php';
+ //echo elgg_view("simplepie/edit", $vars);
+?>
+
diff --git a/views/default/widgets/inline_content_index/content.php b/views/default/widgets/inline_content_index/content.php new file mode 100644 index 000000000..6ed53f197 --- /dev/null +++ b/views/default/widgets/inline_content_index/content.php @@ -0,0 +1,7 @@ +<div class="contentWrapper">
+ <?php
+ echo $vars[entity]->html_content;
+ ?>
+ <div class="clearfloat">
+ </div>
+</div>
diff --git a/views/default/widgets/inline_content_index/edit.php b/views/default/widgets/inline_content_index/edit.php new file mode 100644 index 000000000..e5c319bf1 --- /dev/null +++ b/views/default/widgets/inline_content_index/edit.php @@ -0,0 +1,46 @@ +<?php
+ $widget_title = $vars['entity']->widget_title;
+ $html_content = $vars['entity']->html_content;
+ + $guest_only = $vars['entity']->guest_only;
+ if (!isset($guest_only)) $guest_only = "no"; + + $box_style = $vars['entity']->box_style;
+ if (!isset($box_style)) $box_style = "collapsable";
+?>
+<p>
+ <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>:
+ <?php
+ echo elgg_view('input/text', array(
+ 'name' => 'params[widget_title]',
+ 'value' => $widget_title
+ ));
+ ?>
+</p>
+<p>
+<?php echo elgg_echo('custom_index_widgets:html_content'); ?>
+<?php
+ echo elgg_view('input/longtext', array(
+ 'name' => 'params[html_content]',
+ 'value' => $html_content
+ ));
+ ?>
+</p> +<p>
+ <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[box_style]', + 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), + 'value'=>$box_style));
+ ?> +</p>
+<p>
+ <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
+ 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
+ 'value'=>$guest_only));
+ ?>
+</p>
\ No newline at end of file diff --git a/views/default/widgets/latest_activity_index/content.php b/views/default/widgets/latest_activity_index/content.php new file mode 100644 index 000000000..4010e0cb4 --- /dev/null +++ b/views/default/widgets/latest_activity_index/content.php @@ -0,0 +1,20 @@ +<?php
+
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+
+ $widget_group = $vars["entity"]->widget_group;
+ if (!isset($widget_group)) $widget_group = 0;
+
+ /*
+ $site_categories = $vars['config']->site->categories;
+ $widget_categorie = $vars['entity']->widget_categorie;
+ $widget_context_mode = $vars['entity']->widget_context_mode;
+ if (!isset($widget_context_mode)) $widget_context_mode = 'search';
+ elgg_set_context($widget_context_mode);
+ */
+ $widget_datas = elgg_list_river(0, $widget_group, '', '', '', '', $num_items,0,0,false);
+
+ echo $widget_datas;
+?>
+
diff --git a/views/default/widgets/latest_activity_index/edit.php b/views/default/widgets/latest_activity_index/edit.php new file mode 100644 index 000000000..622655307 --- /dev/null +++ b/views/default/widgets/latest_activity_index/edit.php @@ -0,0 +1,64 @@ + <?php
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+
+ $widget_group = $vars["entity"]->widget_group;
+ if (!isset($widget_group)) $widget_group = 0;
+
+ $widget_title = $vars['entity']->widget_title;
+ $widget_group = $vars["entity"]->widget_group;
+
+ $guest_only = $vars['entity']->guest_only;
+ if (!isset($guest_only)) $guest_only = "no";
+
+ $box_style = $vars['entity']->box_style;
+ if (!isset($box_style)) $box_style = "collapsable";
+ ?>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>
+ :
+ <?php
+ echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('group'); ?>
+ :
+ <?php
+ //$groups = elgg_get_entities(array("type"=>'group','limit'=>100));
+ $groups = elgg_get_entities(array('type'=>'group'));
+ $group_list = array();
+ $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups');
+ if ($groups) {
+ foreach ($groups as $group) {
+ $group_list[$group->getGUID()] = $group->name;
+ }
+ }
+ echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:num_items'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
+ 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
+ 'value'=>$box_style));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
+ 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
+ 'value'=>$guest_only));
+ ?>
+ </p>
diff --git a/views/default/widgets/latest_album_index/content.php b/views/default/widgets/latest_album_index/content.php new file mode 100644 index 000000000..f57baee9d --- /dev/null +++ b/views/default/widgets/latest_album_index/content.php @@ -0,0 +1,64 @@ +<div class="contentWrapper"> +<?php + + $object_type ='album'; + + $num_items = $vars['entity']->num_items; + if (!isset($num_items)) + $num_items = 10; + + $widget_group = $vars["entity"]->widget_group; + if (!isset($widget_group)) + $widget_group = 0; + + $site_categories = $vars['config']->site->categories; + $widget_categorie = $vars['entity']->widget_categorie; + $widget_context_mode = $vars['entity']->widget_context_mode; + if (!isset($widget_context_mode)) + $widget_context_mode = 'search'; + elgg_set_context($widget_context_mode); + + $owner_albums = elgg_get_entities("object", $object_type, $widget_group, "", $num_items, 0, false); + + echo '<div id="tidypics_album_widget_container">'; + + if ($owner_albums) { + foreach($owner_albums as $album) { + + if($album->cover) + $album_cover = '<img src="'.$vars['url'].'mod/tidypics/thumbnail.php?file_guid='.$album->cover.'&size=small" class="tidypics_album_cover" alt="' . $album->title . '"/>'; + else + $album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="' . $album->title . '">'; +?> + <div class="tidypics_album_widget_single_item"> + <div class="tidypics_album_widget_title"><a href="<?php echo $album->getURL();?>"><?php echo $album->title;?></a></div> + <div class="tidypics_album_widget_timestamp"> <?php echo elgg_echo("album:created:on") . ' ' . friendly_time($album->time_created);?></div> +<?php + //get the number of comments + $numcomments = elgg_count_comments($album); + if ($numcomments) + echo "<a href=\"{$album->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a><br>"; +?> + <a href="<?php echo $album->getURL();?>"><?php echo $album_cover;?></a> + </div> +<?php + } //end of foreach loop + + // bottom link to all group/user albums + /*if (is_null($owner->username) || empty($owner->username)) { + echo '<p class="profile_info_edit_buttons"><a href="' . $vars['url'] . 'pg/photos/world">' . elgg_echo('album:all') . '</a></p>'; + } else { + echo '<p class="tidypics_download"><a href="' . $vars['url'] . 'pg/photos/owned/' . $owner->username . '">' . elgg_echo('album:more') . '</a></p>'; + }*/ + + } + + /*if (can_write_to_container(0, $owner->guid)) { + echo '<p class="tidypics_download"><a href=' . $CONFIG->wwwroot .'pg/photos/new/' . $owner->username . '>' . elgg_echo("album:create") . '</a></p>'; + }*/ + + + //close album_widget_container div + echo "</div>"; +?> +</div>
\ No newline at end of file diff --git a/views/default/widgets/latest_album_index/edit.php b/views/default/widgets/latest_album_index/edit.php new file mode 100644 index 000000000..86eaa19cc --- /dev/null +++ b/views/default/widgets/latest_album_index/edit.php @@ -0,0 +1,64 @@ + <?php + $num_items = $vars['entity']->num_items; + if (!isset($num_items)) $num_items = 10; + + $widget_group = $vars["entity"]->widget_group; + if (!isset($widget_group)) $widget_group = 0; + + + $widget_title = $vars['entity']->widget_title; + $widget_group = $vars["entity"]->widget_group; + + $guest_only = $vars['entity']->guest_only; + if (!isset($guest_only)) $guest_only = "no"; + + $box_style = $vars['entity']->box_style; + if (!isset($box_style)) $box_style = "collapsable"; + ?> + <p> + <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> + : + <?php + echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); + ?> + </p> + <p> + <?php echo elgg_echo('group'); ?> + : + <?php + $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); + $group_list = array(); + $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); + if ($groups) { + foreach ($groups as $group) { + $group_list[$group->getGUID()] = $group->name; + } + } + echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:num_items'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:box_style'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[box_style]', + 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), + 'value'=>$box_style)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', + 'options_values'=>array('yes'=>'yes', 'no'=>'no'), + 'value'=>$guest_only)); + ?> + </p>
\ No newline at end of file diff --git a/views/default/widgets/latest_blogs_index/content.php b/views/default/widgets/latest_blogs_index/content.php new file mode 100644 index 000000000..cce94185d --- /dev/null +++ b/views/default/widgets/latest_blogs_index/content.php @@ -0,0 +1,43 @@ +<?php
+$object_type = 'blog';
+
+$num_items = $vars['entity']->num_items;
+if (!isset($num_items))
+ $num_items = 10;
+
+$widget_group = $vars["entity"]->widget_group;
+if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
+
+$site_categories = $vars['config']->site->categories;
+$widget_categorie = $vars['entity']->widget_categorie;
+$widget_context_mode = $vars['entity']->widget_context_mode;
+if (!isset($widget_context_mode))
+ $widget_context_mode = 'search';
+elgg_set_context($widget_context_mode);
+
+if ($site_categories == NULL || $widget_categorie == NULL) {
+ $widget_datas = elgg_list_entities(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false));
+} else {
+
+ $widget_datas = elgg_list_entities_from_metadata(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false,
+ 'metadata_name' => 'universal_categories',
+ 'metadata_value' => $widget_categorie,
+ ));
+}
+echo $widget_datas;
+?>
+
diff --git a/views/default/widgets/latest_blogs_index/edit.php b/views/default/widgets/latest_blogs_index/edit.php new file mode 100644 index 000000000..e89a68304 --- /dev/null +++ b/views/default/widgets/latest_blogs_index/edit.php @@ -0,0 +1,85 @@ + <?php + $num_items = $vars['entity']->num_items; + if (!isset($num_items)) $num_items = 10; + + $widget_group = $vars["entity"]->widget_group; + if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE; + + $site_categories = $vars['config']->site->categories; + $widget_categorie = $vars['entity']->widget_categorie; + $widget_context_mode = $vars['entity']->widget_context_mode; + if (!isset($widget_context_mode)) $widget_context_mode = 'search'; + + $widget_title = $vars['entity']->widget_title; + $widget_group = $vars["entity"]->widget_group; + + $guest_only = $vars['entity']->guest_only; + if (!isset($guest_only)) $guest_only = "no"; + + $box_style = $vars['entity']->box_style; + if (!isset($box_style)) $box_style = "collapsable"; + ?> + <p> + <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> + : + <?php + echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); + ?> + </p> + <p> + <?php echo elgg_echo('group'); ?> + : + <?php + $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); + $group_list = array(); + $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); + if ($groups) { + foreach ($groups as $group) { + $group_list[$group->getGUID()] = $group->name; + } + } + echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); + ?> + </p> + <?php if ($site_categories != NULL) { ?> + <p> + <?php echo elgg_echo('categories'); ?> + : + <?php + $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories)); + echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie)); + ?> + </p> + <?php } ?> + <p> + <?php echo elgg_echo('custom_index_widgets:context_mode'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:num_items'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:box_style'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[box_style]', + 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), + 'value'=>$box_style)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', + 'options_values'=>array('yes'=>'yes', 'no'=>'no'), + 'value'=>$guest_only)); + ?> + </p> diff --git a/views/default/widgets/latest_bookmarks_index/content.php b/views/default/widgets/latest_bookmarks_index/content.php new file mode 100644 index 000000000..2622a63ea --- /dev/null +++ b/views/default/widgets/latest_bookmarks_index/content.php @@ -0,0 +1,43 @@ +<?php
+
+ $object_type ='bookmarks';
+
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+
+ $widget_group = $vars["entity"]->widget_group;
+ if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
+
+ $site_categories = $vars['config']->site->categories;
+ $widget_categorie = $vars['entity']->widget_categorie;
+ $widget_context_mode = $vars['entity']->widget_context_mode;
+ if (!isset($widget_context_mode)) $widget_context_mode = 'search';
+ elgg_set_context($widget_context_mode);
+
+ if ($site_categories == NULL || $widget_categorie == NULL) {
+ $widget_datas = elgg_list_entities(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false));
+} else {
+
+ $widget_datas = elgg_list_entities_from_metadata(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false,
+ 'metadata_name' => 'universal_categories',
+ 'metadata_value' => $widget_categorie,
+ ));
+}
+
+echo $widget_datas;
+?>
+
diff --git a/views/default/widgets/latest_bookmarks_index/edit.php b/views/default/widgets/latest_bookmarks_index/edit.php new file mode 100644 index 000000000..1a15cea49 --- /dev/null +++ b/views/default/widgets/latest_bookmarks_index/edit.php @@ -0,0 +1,85 @@ + <?php
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+
+ $widget_group = $vars["entity"]->widget_group;
+ if (!isset($widget_group)) $widget_group = 0;
+
+ $site_categories = $vars['config']->site->categories;
+ $widget_categorie = $vars['entity']->widget_categorie;
+ $widget_context_mode = $vars['entity']->widget_context_mode;
+ if (!isset($widget_context_mode)) $widget_context_mode = 'search';
+
+ $widget_title = $vars['entity']->widget_title;
+ $widget_group = $vars["entity"]->widget_group;
+
+ $guest_only = $vars['entity']->guest_only;
+ if (!isset($guest_only)) $guest_only = "no";
+
+ $box_style = $vars['entity']->box_style;
+ if (!isset($box_style)) $box_style = "collapsable";
+ ?>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>
+ :
+ <?php
+ echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('group'); ?>
+ :
+ <?php
+ $groups = elgg_get_entities(array("type"=>'group','limit'=>100));
+ $group_list = array();
+ $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups');
+ if ($groups) {
+ foreach ($groups as $group) {
+ $group_list[$group->getGUID()] = $group->name;
+ }
+ }
+ echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group));
+ ?>
+ </p>
+ <?php if ($site_categories != NULL) { ?>
+ <p>
+ <?php echo elgg_echo('categories'); ?>
+ :
+ <?php
+ $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories));
+ echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie));
+ ?>
+ </p>
+ <?php } ?>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:context_mode'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:num_items'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
+ 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
+ 'value'=>$box_style));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
+ 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
+ 'value'=>$guest_only));
+ ?>
+ </p>
diff --git a/views/default/widgets/latest_events_index/content.php b/views/default/widgets/latest_events_index/content.php new file mode 100644 index 000000000..7c5ae40f3 --- /dev/null +++ b/views/default/widgets/latest_events_index/content.php @@ -0,0 +1,95 @@ +<?php + + require_once($CONFIG->pluginspath.'event_calendar/models/model.php'); + + if(!function_exists('getLastDayOfMonth')){ + function getLastDayOfMonth($month,$year) { + return idate('d', mktime(0, 0, 0, ($month + 1), 0, $year)); + } + } + + $object_type ='event_calendar';
+
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items))
+ $num_items = 10;
+
+ $widget_group = $vars["entity"]->widget_group;
+ if (!isset($widget_group))
+ $widget_group = 0; + + $mode = $vars['mode']->mode;
+ if (!isset($mode))
+ $mode = "month";
+
+ $site_categories = $vars['config']->site->categories;
+ $widget_categorie = $vars['entity']->widget_categorie;
+ $widget_context_mode = $vars['entity']->widget_context_mode;
+ if (!isset($widget_context_mode))
+ $widget_context_mode = 'search';
+ + elgg_set_context($widget_context_mode); +
+ + $original_start_date = date('Y-m-d'); + $day = 60*60*24;
+ $week = 7*$day;
+ $month = 31*$day;
+
+ + if ($mode == "day") {
+ $start_date = $original_start_date;
+ $end_date = $start_date;
+ $start_ts = strtotime($start_date);
+ $end_ts = strtotime($end_date)+$day-1;
+ } else if ($mode == "week") {
+
+ $start_ts = strtotime($original_start_date);
+ $start_ts -= date("w",$start_ts)*$day;
+ $end_ts = $start_ts + 6*$day;
+
+ $start_date = date('Y-m-d',$start_ts);
+ $end_date = date('Y-m-d',$end_ts);
+ } else {
+ $start_ts = strtotime($original_start_date);
+ $month = date('m',$start_ts);
+ $year = date('Y',$start_ts);
+ $start_date = $year.'-'.$month.'-1';
+ $end_date = $year.'-'.$month.'-'.getLastDayOfMonth($month,$year);
+ }
+
+ if ($event_calendar_first_date && ($start_date < $event_calendar_first_date)) {
+ $start_date = $event_calendar_first_date;
+ }
+
+ if ($event_calendar_last_date && ($end_date > $event_calendar_last_date)) {
+ $end_date = $event_calendar_last_date;
+ }
+
+ $start_ts = strtotime($start_date);
+
+ if ($mode == "day") {
+ $end_ts = strtotime($end_date)+$day-1;
+ } else if ($mode == "week") {
+ $end_ts = $start_ts + 6*$day;
+ } else {
+ $end_ts = strtotime($end_date);
+ } + + $count = event_calendar_get_events_between($start_ts,$end_ts,true,$num_items,0,$widget_group,'-');
+ $events = event_calendar_get_events_between($start_ts,$end_ts,false,$num_items,0,$widget_group,'-'); + //$widget_datas= $event_list = elgg_view_entity_list($events, $count, 0, $num_items, false, false); + + $options = array( + 'list_class' => 'elgg-list-entity', + 'full_view' => FALSE, + 'pagination' => TRUE, + 'list_type' => 'listing', + 'list_type_toggle' => FALSE, + 'offset' => $vars['offset'], + 'limit' => $vars['limit'], + ); + $widget_datas = elgg_view_entity_list($events, $options); + echo $widget_datas;
+?>
+
diff --git a/views/default/widgets/latest_events_index/edit.php b/views/default/widgets/latest_events_index/edit.php new file mode 100644 index 000000000..3aa20f574 --- /dev/null +++ b/views/default/widgets/latest_events_index/edit.php @@ -0,0 +1,96 @@ + <?php
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+
+ $widget_group = $vars["entity"]->widget_group;
+ if (!isset($widget_group)) $widget_group = 0;
+
+ $site_categories = $vars['config']->site->categories;
+ $widget_categorie = $vars['entity']->widget_categorie;
+ $widget_context_mode = $vars['entity']->widget_context_mode;
+ if (!isset($widget_context_mode)) $widget_context_mode = 'search';
+
+ $widget_title = $vars['entity']->widget_title;
+ $widget_group = $vars["entity"]->widget_group;
+
+ $guest_only = $vars['entity']->guest_only;
+ if (!isset($guest_only)) $guest_only = "no";
+
+ $box_style = $vars['entity']->box_style;
+ if (!isset($box_style)) $box_style = "collapsable";
+ ?>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>
+ :
+ <?php
+ echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('group'); ?>
+ :
+ <?php
+ $groups = elgg_get_entities(array("type"=>'group','limit'=>100));
+ $group_list = array();
+ $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups');
+ if ($groups) {
+ foreach ($groups as $group) {
+ $group_list[$group->getGUID()] = $group->name;
+ }
+ }
+ echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group));
+ ?>
+ </p>
+ <?php if ($site_categories != NULL) { ?>
+ <p>
+ <?php echo elgg_echo('categories'); ?>
+ :
+ <?php
+ $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories));
+ echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie));
+ ?>
+ </p>
+ <?php } ?>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:context_mode'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:num_items'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items));
+ ?>
+ </p> + <p>
+ <?php echo elgg_echo('event_calendar:widget_title'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[mode]', + 'options_values'=>array('day'=>elgg_echo('event_calendar:day_label'), + 'week'=>elgg_echo('event_calendar:week_label'), + 'month'=>elgg_echo('event_calendar:month_label')), + 'value'=>$num_items));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
+ 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
+ 'value'=>$box_style));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
+ 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
+ 'value'=>$guest_only));
+ ?>
+ </p>
diff --git a/views/default/widgets/latest_files_index/content.php b/views/default/widgets/latest_files_index/content.php new file mode 100644 index 000000000..b726efe70 --- /dev/null +++ b/views/default/widgets/latest_files_index/content.php @@ -0,0 +1,44 @@ +<?php + + $object_type ='file'; + + $num_items = $vars['entity']->num_items; + if (!isset($num_items)) $num_items = 10; + + $widget_group = $vars["entity"]->widget_group; + if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE; + + + $site_categories = $vars['config']->site->categories; + $widget_categorie = $vars['entity']->widget_categorie; + $widget_context_mode = $vars['entity']->widget_context_mode; + if (!isset($widget_context_mode)) $widget_context_mode = 'search'; + elgg_set_context($widget_context_mode); + + if ($site_categories == NULL || $widget_categorie == NULL) { + $widget_datas = elgg_list_entities(array( + 'type'=>'object', + 'subtype'=>$object_type, + 'container_guids' => $widget_group, + 'limit'=>$num_items, + 'full_view' => false, + 'view_type_toggle' => false, + 'pagination' => false)); +} else { + + $widget_datas = elgg_list_entities_from_metadata(array( + 'type'=>'object', + 'subtype'=>$object_type, + 'container_guids' => $widget_group, + 'limit'=>$num_items, + 'full_view' => false, + 'view_type_toggle' => false, + 'pagination' => false, + 'metadata_name' => 'universal_categories', + 'metadata_value' => $widget_categorie, + )); +} + + echo $widget_datas; +?> + diff --git a/views/default/widgets/latest_files_index/edit.php b/views/default/widgets/latest_files_index/edit.php new file mode 100644 index 000000000..5625eca44 --- /dev/null +++ b/views/default/widgets/latest_files_index/edit.php @@ -0,0 +1,86 @@ + <?php
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+
+ $widget_group = $vars["entity"]->widget_group;
+ if (!isset($widget_group)) $widget_group = 0;
+
+ $site_categories = $vars['config']->site->categories;
+ $widget_categorie = $vars['entity']->widget_categorie;
+ $widget_context_mode = $vars['entity']->widget_context_mode;
+ if (!isset($widget_context_mode)) $widget_context_mode = 'search';
+
+ $widget_title = $vars['entity']->widget_title;
+ $widget_group = $vars["entity"]->widget_group;
+
+ $guest_only = $vars['entity']->guest_only;
+ if (!isset($guest_only)) $guest_only = "no";
+
+ $box_style = $vars['entity']->box_style;
+ if (!isset($box_style)) $box_style = "collapsable";
+ ?>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>
+ :
+ <?php
+ echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('group'); ?>
+ :
+ <?php
+ //$groups = elgg_get_entities(array("type"=>'group','limit'=>100));
+ $groups = elgg_get_entities(array('type'=>'group'));
+ $group_list = array();
+ $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups');
+ if ($groups) {
+ foreach ($groups as $group) {
+ $group_list[$group->getGUID()] = $group->name;
+ }
+ }
+ echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group));
+ ?>
+ </p>
+ <?php if ($site_categories != NULL) { ?>
+ <p>
+ <?php echo elgg_echo('categories'); ?>
+ :
+ <?php
+ $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories));
+ echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie));
+ ?>
+ </p>
+ <?php } ?>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:context_mode'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:num_items'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
+ 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
+ 'value'=>$box_style));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
+ 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
+ 'value'=>$guest_only));
+ ?>
+ </p>
diff --git a/views/default/widgets/latest_generic_index/content.php b/views/default/widgets/latest_generic_index/content.php new file mode 100644 index 000000000..941b5ebeb --- /dev/null +++ b/views/default/widgets/latest_generic_index/content.php @@ -0,0 +1,47 @@ +<?php
+
+$object_type = $vars["entity"]->widget_subtype;
+if (!isset($object_type))
+ $object_type = 'ELGG_ENTITIES_ANY_VALUE';
+
+$num_items = $vars['entity']->num_items;
+if (!isset($num_items))
+ $num_items = 10;
+
+$widget_group = $vars["entity"]->widget_group;
+if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
+
+$site_categories = $vars['config']->site->categories;
+$widget_categorie = $vars['entity']->widget_categorie;
+$widget_context_mode = $vars['entity']->widget_context_mode;
+if (!isset($widget_context_mode))
+ $widget_context_mode = 'search';
+elgg_set_context($widget_context_mode);
+
+if ($site_categories == NULL || $widget_categorie == NULL) {
+ $widget_datas = elgg_list_entities(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false));
+} else {
+
+ $widget_datas = elgg_list_entities_from_metadata(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false,
+ 'metadata_name' => 'universal_categories',
+ 'metadata_value' => $widget_categorie,
+ ));
+}
+
+echo $widget_datas;
+?>
+
diff --git a/views/default/widgets/latest_generic_index/edit.php b/views/default/widgets/latest_generic_index/edit.php new file mode 100644 index 000000000..f7584a847 --- /dev/null +++ b/views/default/widgets/latest_generic_index/edit.php @@ -0,0 +1,103 @@ + <?php + $num_items = $vars['entity']->num_items; + if (!isset($num_items)) $num_items = 10; + + $widget_group = $vars["entity"]->widget_group; + if (!isset($widget_group)) $widget_group = 0; + + $site_categories = $vars['config']->site->categories; + $widget_categorie = $vars['entity']->widget_categorie; + $widget_context_mode = $vars['entity']->widget_context_mode; + if (!isset($widget_context_mode)) $widget_context_mode = 'search'; + + $widget_title = $vars['entity']->widget_title; + $widget_group = $vars["entity"]->widget_group; + $widget_subtype = $vars["entity"]->widget_subtype; + + $guest_only = $vars['entity']->guest_only; + if (!isset($guest_only)) $guest_only = "no"; + + $box_style = $vars['entity']->box_style; + if (!isset($box_style)) $box_style = "collapsable"; + ?> + <p> + <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> + : + <?php + echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:widget_subtype'); ?> + : + <?php + + $subtypes = get_data("SELECT subtype from {$CONFIG->dbprefix}entity_subtypes"); + $subtype_list = array(); + if ($subtypes) { + foreach ($subtypes as $data) { + $subtype_list[$data->subtype] = $data->subtype; + } + } + echo elgg_view('input/dropdown', array('name'=>'params[widget_subtype]', 'options_values'=>$subtype_list, 'value'=>$widget_subtype)); + ?> + </p> + <p> + <?php echo elgg_echo('group'); ?> + : + <?php + //$groups = elgg_get_entities(array("type"=>'group','limit'=>100)); + $groups = elgg_get_entities(array('type'=>'group')); + $group_list = array(); + $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); + + if ($groups) { + foreach ($groups as $group) { + $group_list[$group->getGUID()] = $group->name; + } + } + echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); + ?> + </p> + <?php if ($site_categories != NULL) { ?> + <p> + <?php echo elgg_echo('categories'); ?> + : + <?php + $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories)); + echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie)); + ?> + </p> + <?php } ?> + <p> + <?php echo elgg_echo('custom_index_widgets:context_mode'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:num_items'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:box_style'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[box_style]', + 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), + 'value'=>$box_style)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', + 'options_values'=>array('yes'=>'yes', 'no'=>'no'), + 'value'=>$guest_only)); + ?> + </p> diff --git a/views/default/widgets/latest_groups_index/content.php b/views/default/widgets/latest_groups_index/content.php new file mode 100644 index 000000000..0557f874e --- /dev/null +++ b/views/default/widgets/latest_groups_index/content.php @@ -0,0 +1,21 @@ +<?php
+
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+
+ $widget_context_mode = $vars['entity']->widget_context_mode;
+ if (!isset($widget_context_mode)) $widget_context_mode = 'search';
+ elgg_set_context($widget_context_mode);
+
+ $widget_datas = elgg_list_entities(array(
+ 'type'=>'group',
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false));
+
+
+
+echo $widget_datas;
+?>
+
diff --git a/views/default/widgets/latest_groups_index/edit.php b/views/default/widgets/latest_groups_index/edit.php new file mode 100644 index 000000000..71f7d6be8 --- /dev/null +++ b/views/default/widgets/latest_groups_index/edit.php @@ -0,0 +1,63 @@ +<?php
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+
+ $widget_title = $vars['entity']->widget_title;
+
+ $guest_only = $vars['entity']->guest_only;
+ if (!isset($guest_only)) $guest_only = "no";
+
+ $box_style = $vars['entity']->box_style;
+ if (!isset($box_style)) $box_style = "collapsable";
+
+?>
+<p>
+ <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>:
+ <?php
+ echo elgg_view('input/text', array(
+ 'name' => 'params[widget_title]',
+ 'value' => $widget_title
+ ));
+ ?>
+ </p>
+<p>
+<?php echo elgg_echo('custom_index_widgets:num_items'); ?>
+
+<?php
+ echo elgg_view('input/dropdown', array(
+ 'name' => 'params[num_items]',
+ 'options_values' => array( '1' => '1',
+ '3' => '3',
+ '5' => '5',
+ '8' => '8',
+ '10' => '10',
+ '12' => '12',
+ '15' => '15',
+ '20' => '20',
+ '30' => '30',
+ '40' => '40',
+ '50' => '50',
+ '100' => '100',
+ ),
+ 'value' => $num_items
+ ));
+?>
+</p>
+<p>
+ <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
+ 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
+ 'value'=>$box_style));
+ ?>
+</p>
+<p>
+ <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
+ 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
+ 'value'=>$guest_only));
+ ?>
+</p>
\ No newline at end of file diff --git a/views/default/widgets/latest_izap_videos_index/content.php b/views/default/widgets/latest_izap_videos_index/content.php new file mode 100644 index 000000000..22b15b37c --- /dev/null +++ b/views/default/widgets/latest_izap_videos_index/content.php @@ -0,0 +1,50 @@ +<?php
+$object_type = 'izap_videos';
+
+$num_items = $vars['entity']->num_items;
+if (!isset($num_items))
+ $num_items = 10;
+
+$widget_group = $vars["entity"]->widget_group;
+if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
+
+$site_categories = $vars['config']->site->categories;
+$widget_categorie = $vars['entity']->widget_categorie;
+$widget_context_mode = $vars['entity']->widget_context_mode;
+if (!isset($widget_context_mode))
+ $widget_context_mode = 'search';
+elgg_set_context($widget_context_mode);
+
+if ($site_categories == NULL || $widget_categorie == NULL) {
+ $widget_datas = elgg_list_entities(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false));
+} else {
+
+ $widget_datas = elgg_list_entities_from_metadata(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false,
+ 'metadata_name' => 'universal_categories',
+ 'metadata_value' => $widget_categorie,
+ ));
+}
+?>
+<div class="contentWrapper">
+ <?php
+ if (isset($widget_datas)) {
+ echo $widget_datas;
+ }
+ ?>
+ <div class="clearfloat">
+ </div>
+</div>
diff --git a/views/default/widgets/latest_izap_videos_index/edit.php b/views/default/widgets/latest_izap_videos_index/edit.php new file mode 100644 index 000000000..54c41e1a9 --- /dev/null +++ b/views/default/widgets/latest_izap_videos_index/edit.php @@ -0,0 +1,86 @@ + <?php + $num_items = $vars['entity']->num_items; + if (!isset($num_items)) $num_items = 10; + + $widget_group = $vars["entity"]->widget_group; + if (!isset($widget_group)) $widget_group = 0; + + $site_categories = $vars['config']->site->categories; + $widget_categorie = $vars['entity']->widget_categorie; + $widget_context_mode = $vars['entity']->widget_context_mode; + if (!isset($widget_context_mode)) $widget_context_mode = 'search'; + + $widget_title = $vars['entity']->widget_title; + $widget_group = $vars["entity"]->widget_group; + + $guest_only = $vars['entity']->guest_only; + if (!isset($guest_only)) $guest_only = "no"; + + $box_style = $vars['entity']->box_style; + if (!isset($box_style)) $box_style = "collapsable"; + + ?> + <p> + <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> + : + <?php + echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); + ?> + </p> + <p> + <?php echo elgg_echo('group'); ?> + : + <?php + $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); + $group_list = array(); + $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); + if ($groups) { + foreach ($groups as $group) { + $group_list[$group->getGUID()] = $group->name; + } + } + echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); + ?> + </p> + <?php if ($site_categories != NULL) { ?> + <p> + <?php echo elgg_echo('categories'); ?> + : + <?php + $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories)); + echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie)); + ?> + </p> + <?php } ?> + <p> + <?php echo elgg_echo('custom_index_widgets:context_mode'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:num_items'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:box_style'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[box_style]', + 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), + 'value'=>$box_style)); + ?> +</p> +<p> + <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', + 'options_values'=>array('yes'=>'yes', 'no'=>'no'), + 'value'=>$guest_only)); + ?> +</p> diff --git a/views/default/widgets/latest_members_index/content.php b/views/default/widgets/latest_members_index/content.php new file mode 100644 index 000000000..c4f95a77d --- /dev/null +++ b/views/default/widgets/latest_members_index/content.php @@ -0,0 +1,20 @@ +<?php
+
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+ $display_avatar = $vars['entity']->display_avatar;
+ if (!isset($display_avatar)) $display_avatar = 'yes';
+
+ $widget_datas = elgg_list_entities_from_metadata(array(
+ 'metadata_names' => 'icontime',
+ 'types' => 'user',
+ 'limit' => $num_items,
+ 'full_view' => false,
+ 'pagination' => false,
+ 'size' => 'small',
+ ));
+
+echo $widget_datas;
+?>
+
+
diff --git a/views/default/widgets/latest_members_index/edit.php b/views/default/widgets/latest_members_index/edit.php new file mode 100644 index 000000000..856d5ed0b --- /dev/null +++ b/views/default/widgets/latest_members_index/edit.php @@ -0,0 +1,79 @@ +<?php
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+
+ $display_avatar = $vars['entity']->display_avatar;
+ if (!isset($display_avatar)) $display_avatar = 'yes';
+
+ $widget_title = $vars['entity']->widget_title;
+
+ $guest_only = $vars['entity']->guest_only;
+ if (!isset($guest_only)) $guest_only = "no";
+
+ $box_style = $vars['entity']->box_style;
+ if (!isset($box_style)) $box_style = "collapsable";
+
+
+?>
+<p>
+ <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>:
+ <?php
+ echo elgg_view('input/text', array(
+ 'name' => 'params[widget_title]',
+ 'value' => $widget_title
+ ));
+ ?>
+</p>
+<p>
+<?php echo elgg_echo('custom_index_widgets:num_items'); ?>
+
+<?php
+ echo elgg_view('input/dropdown', array(
+ 'name' => 'params[num_items]',
+ 'options_values' => array(
+ '7' => '7',
+ '14' => '14',
+ '21' => '21',
+ '28' => '28',
+ '35' => '35',
+ '42' => '42',
+ '49' => '49',
+ '56' => '56',
+ '100' => '100',
+ ),
+ 'value' => $num_items
+ ));
+?>
+</p>
+<p>
+<?php echo elgg_echo('custom_index_widgets:display_avatar'); ?>
+
+<?php
+ echo elgg_view('input/dropdown', array(
+ 'name' => 'params[display_avatar]',
+ 'options_values' => array( 'yes' => 'yes',
+ 'no' => 'no',
+
+ ),
+ 'value' => $display_avatar
+ ));
+?>
+</p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
+ 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
+ 'value'=>$box_style));
+ ?>
+</p>
+<p>
+ <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
+ 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
+ 'value'=>$guest_only));
+ ?>
+</p>
diff --git a/views/default/widgets/latest_news_index/content.php b/views/default/widgets/latest_news_index/content.php new file mode 100644 index 000000000..8a10093b1 --- /dev/null +++ b/views/default/widgets/latest_news_index/content.php @@ -0,0 +1,47 @@ +<?php
+
+ $object_type ='news';
+
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items))
+ $num_items = 10;
+
+ $widget_group = $vars["entity"]->widget_group;
+ if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
+
+ $site_categories = $vars['config']->site->categories;
+ $widget_categorie = $vars['entity']->widget_categorie;
+ $widget_context_mode = $vars['entity']->widget_context_mode;
+ if (!isset($widget_context_mode))
+ $widget_context_mode = 'search';
+ elgg_set_context($widget_context_mode);
+
+ if ($site_categories == NULL || $widget_categorie == NULL) {
+ $widget_datas = elgg_list_entities(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false));
+} else {
+
+ $widget_datas = elgg_list_entities_from_metadata(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false,
+ 'metadata_name' => 'universal_categories',
+ 'metadata_value' => $widget_categorie,
+ ));
+}
+
+echo $widget_datas;
+?>
+
+
+
diff --git a/views/default/widgets/latest_news_index/edit.php b/views/default/widgets/latest_news_index/edit.php new file mode 100644 index 000000000..65298076a --- /dev/null +++ b/views/default/widgets/latest_news_index/edit.php @@ -0,0 +1,85 @@ + <?php + $num_items = $vars['entity']->num_items; + if (!isset($num_items)) $num_items = 10; + + $widget_group = $vars["entity"]->widget_group; + if (!isset($widget_group)) $widget_group = 0; + + $site_categories = $vars['config']->site->categories; + $widget_categorie = $vars['entity']->widget_categorie; + $widget_context_mode = $vars['entity']->widget_context_mode; + if (!isset($widget_context_mode)) $widget_context_mode = 'search'; + + $widget_title = $vars['entity']->widget_title; + $widget_group = $vars["entity"]->widget_group; + + $guest_only = $vars['entity']->guest_only; + if (!isset($guest_only)) $guest_only = "no"; + + $box_style = $vars['entity']->box_style; + if (!isset($box_style)) $box_style = "collapsable"; + ?> + <p> + <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> + : + <?php + echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); + ?> + </p> + <p> + <?php echo elgg_echo('group'); ?> + : + <?php + $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); + $group_list = array(); + $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); + if ($groups) { + foreach ($groups as $group) { + $group_list[$group->getGUID()] = $group->name; + } + } + echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); + ?> + </p> + <?php if ($site_categories != NULL) { ?> + <p> + <?php echo elgg_echo('categories'); ?> + : + <?php + $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories)); + echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie)); + ?> + </p> + <?php } ?> + <p> + <?php echo elgg_echo('custom_index_widgets:context_mode'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:num_items'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:box_style'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[box_style]', + 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), + 'value'=>$box_style)); + ?> +</p> +<p> + <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', + 'options_values'=>array('yes'=>'yes', 'no'=>'no'), + 'value'=>$guest_only)); + ?> +</p> diff --git a/views/default/widgets/latest_pages_index/content.php b/views/default/widgets/latest_pages_index/content.php new file mode 100644 index 000000000..cc8a46d55 --- /dev/null +++ b/views/default/widgets/latest_pages_index/content.php @@ -0,0 +1,45 @@ +<?php
+
+ $object_type ='page_top';
+
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items))
+ $num_items = 10;
+
+ $widget_group = $vars["entity"]->widget_group;
+ if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
+
+ $site_categories = $vars['config']->site->categories;
+ $widget_categorie = $vars['entity']->widget_categorie;
+ $widget_context_mode = $vars['entity']->widget_context_mode;
+ if (!isset($widget_context_mode))
+ $widget_context_mode = 'search';
+ elgg_set_context($widget_context_mode);
+
+ if ($site_categories == NULL || $widget_categorie == NULL) {
+ $widget_datas = elgg_list_entities(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false));
+} else {
+
+ $widget_datas = elgg_list_entities_from_metadata(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false,
+ 'metadata_name' => 'universal_categories',
+ 'metadata_value' => $widget_categorie,
+ ));
+}
+
+echo $widget_datas;
+?>
+
diff --git a/views/default/widgets/latest_pages_index/edit.php b/views/default/widgets/latest_pages_index/edit.php new file mode 100644 index 000000000..a14371b02 --- /dev/null +++ b/views/default/widgets/latest_pages_index/edit.php @@ -0,0 +1,86 @@ + <?php + $num_items = $vars['entity']->num_items; + if (!isset($num_items)) $num_items = 10; + + $widget_group = $vars["entity"]->widget_group; + if (!isset($widget_group)) $widget_group = 0; + + $site_categories = $vars['config']->site->categories; + $widget_categorie = $vars['entity']->widget_categorie; + $widget_context_mode = $vars['entity']->widget_context_mode; + if (!isset($widget_context_mode)) $widget_context_mode = 'search'; + + $widget_title = $vars['entity']->widget_title; + $widget_group = $vars["entity"]->widget_group; + + $guest_only = $vars['entity']->guest_only; + if (!isset($guest_only)) $guest_only = "no"; + + $box_style = $vars['entity']->box_style; + if (!isset($box_style)) $box_style = "collapsable"; + ?> + <p> + <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> + : + <?php + echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); + ?> + </p> + <p> + <?php echo elgg_echo('group'); ?> + : + <?php + //$groups = elgg_get_entities(array("type"=>'group','limit'=>100)); + $groups = elgg_get_entities(array('type'=>'group')); + $group_list = array(); + $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); + if ($groups) { + foreach ($groups as $group) { + $group_list[$group->getGUID()] = $group->name; + } + } + echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); + ?> + </p> + <?php if ($site_categories != NULL) { ?> + <p> + <?php echo elgg_echo('categories'); ?> + : + <?php + $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories)); + echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie)); + ?> + </p> + <?php } ?> + <p> + <?php echo elgg_echo('custom_index_widgets:context_mode'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:num_items'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:box_style'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[box_style]', + 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), + 'value'=>$box_style)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', + 'options_values'=>array('yes'=>'yes', 'no'=>'no'), + 'value'=>$guest_only)); + ?> + </p> diff --git a/views/default/widgets/latest_photos_index/content.php b/views/default/widgets/latest_photos_index/content.php new file mode 100644 index 000000000..bb83cac40 --- /dev/null +++ b/views/default/widgets/latest_photos_index/content.php @@ -0,0 +1,25 @@ +<div class="contentWrapper"> +<?php + + $num_items = $vars['entity']->num_items; + if (!isset($num_items)) $num_items = 10; + + $widget_group = $vars["entity"]->widget_group; + if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE; + + if ($widget_group != 0){ + $album = elgg_get_entities("object", 'album', $widget_group, "", 1, 0, false); + $album_guid = $album[0]->getGUID(); + $entities = elgg_get_entities("object", "image", $album_guid, '', 999); + elgg_set_context('front'); + $widgetdatas = elgg_view_entity_list($entities); + }else{ + $widgetdatas = tp_get_latest_photos($num_items, 0); + } + + echo '<div class="icon_latest">'; + echo $widgetdatas; + echo '</div>'; + +?> +</div>
\ No newline at end of file diff --git a/views/default/widgets/latest_photos_index/edit.php b/views/default/widgets/latest_photos_index/edit.php new file mode 100644 index 000000000..0ef5e53a1 --- /dev/null +++ b/views/default/widgets/latest_photos_index/edit.php @@ -0,0 +1,64 @@ + <?php + $num_items = $vars['entity']->num_items; + if (!isset($num_items)) $num_items = 10; + + $widget_group = $vars["entity"]->widget_group; + if (!isset($widget_group)) $widget_group = 0; + + + $widget_title = $vars['entity']->widget_title; + $widget_group = $vars["entity"]->widget_group; + + $guest_only = $vars['entity']->guest_only; + if (!isset($guest_only)) $guest_only = "no"; + + $box_style = $vars['entity']->box_style; + if (!isset($box_style)) $box_style = "collapsable"; + ?> + <p> + <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> + : + <?php + echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); + ?> + </p> + <p> + <?php echo elgg_echo('group'); ?> + : + <?php + $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); + $group_list = array(); + $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); + if ($groups) { + foreach ($groups as $group) { + $group_list[$group->getGUID()] = $group->name; + } + } + echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:num_items'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:box_style'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[box_style]', + 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), + 'value'=>$box_style)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', + 'options_values'=>array('yes'=>'yes', 'no'=>'no'), + 'value'=>$guest_only)); + ?> + </p> diff --git a/views/default/widgets/latest_tasks_index/content.php b/views/default/widgets/latest_tasks_index/content.php new file mode 100644 index 000000000..1f06a0db1 --- /dev/null +++ b/views/default/widgets/latest_tasks_index/content.php @@ -0,0 +1,45 @@ +<?php
+
+ $object_type ='task_top';
+
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+
+ $widget_group = $vars["entity"]->widget_group;
+ if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
+
+ $site_categories = $vars['config']->site->categories;
+ $widget_categorie = $vars['entity']->widget_categorie;
+ $widget_context_mode = $vars['entity']->widget_context_mode;
+ if (!isset($widget_context_mode)) $widget_context_mode = 'search';
+ elgg_set_context($widget_context_mode);
+
+ if ($site_categories == NULL || $widget_categorie == NULL) {
+ $widget_datas = elgg_list_entities(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false));
+} else {
+
+ $widget_datas = elgg_list_entities_from_metadata(array(
+ 'type'=>'object',
+ 'subtype'=>$object_type,
+ 'container_guids' => $widget_group,
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false,
+ 'metadata_name' => 'universal_categories',
+ 'metadata_value' => $widget_categorie,
+ ));
+}
+
+echo $widget_datas;
+?>
+
+
+
diff --git a/views/default/widgets/latest_tasks_index/edit.php b/views/default/widgets/latest_tasks_index/edit.php new file mode 100644 index 000000000..c587bc184 --- /dev/null +++ b/views/default/widgets/latest_tasks_index/edit.php @@ -0,0 +1,85 @@ + <?php + $num_items = $vars['entity']->num_items; + if (!isset($num_items)) $num_items = 10; + + $widget_group = $vars["entity"]->widget_group; + if (!isset($widget_group)) $widget_group = 0; + + $site_categories = $vars['config']->site->categories; + $widget_categorie = $vars['entity']->widget_categorie; + $widget_context_mode = $vars['entity']->widget_context_mode; + if (!isset($widget_context_mode)) $widget_context_mode = 'search'; + + $widget_title = $vars['entity']->widget_title; + $widget_group = $vars["entity"]->widget_group; + + $guest_only = $vars['entity']->guest_only; + if (!isset($guest_only)) $guest_only = "no"; + + $box_style = $vars['entity']->box_style; + if (!isset($box_style)) $box_style = "collapsable"; + ?> + <p> + <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> + : + <?php + echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); + ?> + </p> + <p> + <?php echo elgg_echo('group'); ?> + : + <?php + $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); + $group_list = array(); + $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); + if ($groups) { + foreach ($groups as $group) { + $group_list[$group->getGUID()] = $group->name; + } + } + echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); + ?> + </p> + <?php if ($site_categories != NULL) { ?> + <p> + <?php echo elgg_echo('categories'); ?> + : + <?php + $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories)); + echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie)); + ?> + </p> + <?php } ?> + <p> + <?php echo elgg_echo('custom_index_widgets:context_mode'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:num_items'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:box_style'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[box_style]', + 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), + 'value'=>$box_style)); + ?> + </p> + <p> + <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', + 'options_values'=>array('yes'=>'yes', 'no'=>'no'), + 'value'=>$guest_only)); + ?> + </p> diff --git a/views/default/widgets/latest_wire_index/content.php b/views/default/widgets/latest_wire_index/content.php new file mode 100644 index 000000000..98d3b43e1 --- /dev/null +++ b/views/default/widgets/latest_wire_index/content.php @@ -0,0 +1,17 @@ +<?php
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+ elgg_set_context('search');
+
+ $widget_datas = elgg_list_entities(array(
+ 'type'=>'object',
+ 'subtype'=>'thewire',
+ 'limit'=>$num_items,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false));
+
+ echo $widget_datas;
+?>
+
+
diff --git a/views/default/widgets/latest_wire_index/edit.php b/views/default/widgets/latest_wire_index/edit.php new file mode 100644 index 000000000..d08066648 --- /dev/null +++ b/views/default/widgets/latest_wire_index/edit.php @@ -0,0 +1,62 @@ +<?php
+ $num_items = $vars['entity']->num_items;
+ if (!isset($num_items)) $num_items = 10;
+
+ $widget_title = $vars['entity']->widget_title;
+
+ $guest_only = $vars['entity']->guest_only;
+ if (!isset($guest_only)) $guest_only = "no";
+
+ $box_style = $vars['entity']->box_style;
+ if (!isset($box_style)) $box_style = "collapsable";
+
+?>
+<p>
+ <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>:
+ <?php
+ echo elgg_view('input/text', array(
+ 'name' => 'params[widget_title]',
+ 'value' => $widget_title
+ ));
+ ?>
+ </p>
+<p>
+<?php echo elgg_echo('custom_index_widgets:num_items'); ?>
+<?php
+ echo elgg_view('input/dropdown', array(
+ 'name' => 'params[num_items]',
+ 'options_values' => array( '1' => '1',
+ '3' => '3',
+ '5' => '5',
+ '8' => '8',
+ '10' => '10',
+ '12' => '12',
+ '15' => '15',
+ '20' => '20',
+ '30' => '30',
+ '40' => '40',
+ '50' => '50',
+ '100' => '100',
+ ),
+ 'value' => $num_items
+ ));
+?>
+</p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
+ 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
+ 'value'=>$box_style));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
+ 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
+ 'value'=>$guest_only));
+ ?>
+ </p>
diff --git a/views/default/widgets/login_index/content.php b/views/default/widgets/login_index/content.php new file mode 100644 index 000000000..1e82df544 --- /dev/null +++ b/views/default/widgets/login_index/content.php @@ -0,0 +1,15 @@ +<?php
+
+if (elgg_is_logged_in()) {
+ $top_box = "<h2>" . elgg_echo("welcome") . " ";
+ $top_box .= elgg_get_logged_in_user_entity()->name;
+ $top_box .= "</h2>";
+} else {
+ $top_box = elgg_view("core/account/login_box");
+}
+
+echo $top_box;
+?>
+
+
+
diff --git a/views/default/widgets/login_index/edit.php b/views/default/widgets/login_index/edit.php new file mode 100644 index 000000000..149008323 --- /dev/null +++ b/views/default/widgets/login_index/edit.php @@ -0,0 +1,27 @@ +<?php
+ $widget_title = $vars['entity']->widget_title;
+ + $show_welcome = $vars['entity']->show_welcome;
+ if (!isset($show_welcome)) $show_welcome = "yes";
+
+ $guest_only = $vars['entity']->guest_only;
+ if (!isset($guest_only)) $guest_only = "no"; +?>
+<p>
+ <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>:
+ <?php
+ echo elgg_view('input/text', array(
+ 'name' => 'params[widget_title]',
+ 'value' => $widget_title
+ ));
+ ?>
+</p>
+<p>
+ <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
+ 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
+ 'value'=>$guest_only));
+ ?>
+</p>
\ No newline at end of file diff --git a/views/default/widgets/rich_media_index/content.php b/views/default/widgets/rich_media_index/content.php new file mode 100644 index 000000000..dddc32bd7 --- /dev/null +++ b/views/default/widgets/rich_media_index/content.php @@ -0,0 +1,27 @@ +<?php
+
+ $widget_video_width = $vars['entity']->widget_video_width;
+ $widget_video_height = $vars['entity']->widget_video_height;
+ $widget_video_url = $vars['entity']->widget_video_url;
+ $widget_video_caption = $vars['entity']->widget_video_caption;
+
+ if (!isset($widget_video_width)){
+ $widget_video_width = '250';
+ }
+ if (!isset($widget_video_height)){
+ $widget_video_height = '250';
+ }
+
+?>
+
+<div class="contentWrapper" align="center">
+ <a id="media<?php echo $vars['entity']->getGUID();?>" class="media" href="<?php echo $widget_video_url;?>"><?php echo $widget_video_title;?></a> <div class="clearfloat">
+ </div>
+</div>
+<?php if (isset($widget_video_url)) { ?>
+<script type="text/javascript">
+ jQuery(document).ready(function($){
+ $('#media<?php echo $vars['entity']->getGUID();?>').media({width:<?php echo $widget_video_width;?>, height:<?php echo $widget_video_height;?>, autoplay: true});
+ });
+</script>
+<?php } ?>
\ No newline at end of file diff --git a/views/default/widgets/rich_media_index/edit.php b/views/default/widgets/rich_media_index/edit.php new file mode 100644 index 000000000..a3956159c --- /dev/null +++ b/views/default/widgets/rich_media_index/edit.php @@ -0,0 +1,78 @@ +<?php
+ $widget_title = $vars['entity']->widget_title;
+ $widget_video_width = $vars['entity']->widget_video_width;
+ $widget_video_height = $vars['entity']->widget_video_height;
+ $widget_video_url = $vars['entity']->widget_video_url;
+ $widget_video_title = $vars['entity']->widget_video_title;
+
+ $guest_only = $vars['entity']->guest_only;
+ if (!isset($guest_only)) $guest_only = "no";
+
+ $box_style = $vars['entity']->box_style;
+ if (!isset($box_style)) $box_style = "collapsable";
+
+?>
+<p>
+ <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>:
+ <?php
+ echo elgg_view('input/text', array(
+ 'name' => 'params[widget_title]',
+ 'value' => $widget_title
+ ));
+ ?>
+</p>
+<p>
+<?php echo elgg_echo('custom_index_widgets:widget_video_caption'); ?>
+<?php
+ echo elgg_view('input/text', array(
+ 'name' => 'params[widget_video_caption]',
+ 'value' => $widget_video_caption
+ ));
+ ?>
+</p>
+<p>
+<?php echo elgg_echo('custom_index_widgets:widget_video_url'); ?>
+<?php
+ echo elgg_view('input/text', array(
+ 'name' => 'params[widget_video_url]',
+ 'value' => $widget_video_url
+ ));
+ ?>
+</p>
+<p>
+<?php echo elgg_echo('custom_index_widgets:widget_video_width'); ?>
+<?php
+ echo elgg_view('input/text', array(
+ 'name' => 'params[widget_video_width]',
+ 'value' => $widget_video_width
+ ));
+ ?>
+</p>
+<p>
+<?php echo elgg_echo('custom_index_widgets:widget_video_height'); ?>
+<?php
+ echo elgg_view('input/text', array(
+ 'name' => 'params[widget_video_height]',
+ 'value' => $widget_video_height
+ ));
+ ?>
+</p>
+<p>
+ <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
+ 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
+ 'value'=>$box_style));
+ ?>
+ </p>
+ <p>
+ <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
+ :
+ <?php
+ echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
+ 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
+ 'value'=>$guest_only));
+ ?>
+ </p>
+
diff --git a/views/default/widgets/social_share_index/content.php b/views/default/widgets/social_share_index/content.php new file mode 100644 index 000000000..fefd1b795 --- /dev/null +++ b/views/default/widgets/social_share_index/content.php @@ -0,0 +1,12 @@ +
+<div class="contentWrapper">
+ <!-- AddToAny BEGIN -->
+ <a class="a2a_dd" href="http://www.addtoany.com/share_save"><img src="http://static.addtoany.com/buttons/share_save_256_24.png" width="256" height="24" border="0" alt="Share"/></a>
+ <script type="text/javascript">
+ var a2a_config = a2a_config || {};
+ a2a_config.onclick = 1;
+ </script>
+ <script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>
+ <!-- AddToAny END -->
+ <div class="clearfloat"></div>
+</div>
\ No newline at end of file diff --git a/views/default/widgets/social_share_index/edit.php b/views/default/widgets/social_share_index/edit.php new file mode 100644 index 000000000..87557e2ba --- /dev/null +++ b/views/default/widgets/social_share_index/edit.php @@ -0,0 +1,36 @@ + <?php + + + $widget_title = $vars['entity']->widget_title; + $guest_only = $vars['entity']->guest_only; + if (!isset($guest_only)) $guest_only = "no"; + + $box_style = $vars['entity']->box_style; + if (!isset($box_style)) $box_style = "collapsable"; + ?> + <p> + <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> + : + <?php + echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); + ?> + </p> + +<p> + <?php echo elgg_echo('custom_index_widgets:box_style'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[box_style]', + 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), + 'value'=>$box_style)); + ?> +</p> +<p> + <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> + : + <?php + echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', + 'options_values'=>array('yes'=>'yes', 'no'=>'no'), + 'value'=>$guest_only)); + ?> +</p>
\ No newline at end of file |