2
# Movable Type (r) Open Source (C) 2001-2008 Six Apart, Ltd.
3
# This program is distributed under the terms of the
4
# GNU General Public License, version 2.
8
function smarty_function_mtwidgetmanager($args, &$ctx) {
9
$blog_id = $ctx->stash('blog_id');
10
$widgetmanager = $args['name']; // Should we try to load is there's only one?
14
if (! $config = widgetmanager_config($ctx))
17
foreach (explode(",",$config['modulesets'][$widgetmanager]) as $template_id) {
19
$widget_source[] = $ctx->mt->fetch('mt:'.$template_id);
23
$source = implode('',$widget_source);
28
function widgetmanager_config($ctx) {
29
$config = $ctx->stash('widget-manager-config');
32
$blog_id = $ctx->stash('blog_id');
33
$config = $ctx->mt->db->fetch_plugin_config('widget-manager', 'blog:' . $blog_id);
35
$config = $ctx->mt->db->fetch_plugin_config('widget-manager');
38
$ctx->stash('widget-manager-config', $config);