Example #1
0
<?php

/**
 * Elgg widget wrapper
 * 
 * @package Elgg
 * @subpackage Core
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Curverider Ltd
 * @copyright Curverider Ltd 2008
 * @link http://elgg.org/
 */
static $widgettypes;
$callback = get_input('callback');
if (!isset($widgettypes)) {
    $widgettypes = sw_get_widget_types();
}
if ($vars['entity'] instanceof ElggObject && $vars['entity']->getSubtype() == 'widget') {
    $handler = $vars['entity']->handler;
    $title = $widgettypes[$vars['entity']->handler]->name;
} else {
    $handler = "error";
    $title = elgg_echo("error");
}
if ($callback != "true") {
    ?>

	<div id="widget<?php 
    echo $vars['entity']->getGUID();
    ?>
">
Example #2
0
 * sticky_widgets customization page.  Returns left, middle, right columns, as well
 * as the gallery of widgets not yet used in a nice, easy to digest JSON format.
 */
/**
 *
 *
 * @package Elgg
 * @subpackage StickyWidget
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Steve Suppe <*****@*****.**>
 */
admin_gatekeeper();
$type = get_input('swType');
// sticky Widget type (see types.php)
$context = get_input('context');
$widgettypes = sw_get_widget_types($context);
// These 'getters' have hardcoded contexts because I maintain that for uniqueness
$area1widgets = get_sticky_widgets(2, $type, $context, 1);
$area2widgets = get_sticky_widgets(2, $type, $context, 2);
$area3widgets = get_sticky_widgets(2, $type, $context, 3);
if (empty($area1widgets) && empty($area2widgets) && empty($area3widgets)) {
    if (isset($vars['area3'])) {
        $vars['area1'] = $vars['area3'];
    }
    if (isset($vars['area4'])) {
        $vars['area2'] = $vars['area4'];
    }
}
$seenWidgets = array();
// Keep track of the widgets we've seen, so that we don't show them in the gallery.
$left = drawSetDraggables($area1widgets, $widgettypes, $seenWidgets);