Пример #1
0
function MG_adminBox($mode)
{
    global $_MG_CONF, $LANG_MG08;
    $retval = '';
    if ($mode == 'install') {
        $retval .= '<h3>' . $LANG_MG08['success'] . '</h3><br />' . $LANG_MG08['review'] . '<br /><br />';
    }
    $retval .= $LANG_MG08['support'] . '<br /><br />';
    return $retval;
}
// main menu for media gallery administration
$display = '';
if (isset($_GET['mode'])) {
    $mode = COM_applyFilter($_GET['mode']);
} else {
    $mode = '';
}
USES_lib_admin();
$T = new Template($_MG_CONF['template_path'] . '/admin');
$T->set_file(array('admin' => 'administration.thtml'));
$T->set_var(array('site_url' => $_MG_CONF['site_url'], 'site_admin_url' => $_CONF['site_admin_url'], 'mg_navigation' => MG_navigation(), 'lang_admin' => $LANG_MG00['admin'], 'version' => $_MG_CONF['pi_version'], 'admin_body' => plugin_showstats_mediagallery(0), 'title' => $LANG_MG00['admin']));
$T->parse('output', 'admin');
$display = COM_siteHeader();
$msg = COM_getMessage();
if ($msg > 0) {
    $display .= COM_showMessageText($LANG_MG09[$msg], 'mediagallery');
}
$display .= $T->finish($T->get_var('output'));
$display .= COM_siteFooter();
echo $display;
exit;
Пример #2
0
    $actionURL = $_CONF['site_url'] . '/admin/plugins/mediagallery/index.php?mode=savemedia';
    $display = MG_mediaEdit($album_id, $media_id, $actionURL, 1);
    $display = COM_createHTMLDocument($display);
    COM_output($display);
    exit;
} else {
    if ($mode == 'savemedia') {
        $post_mode = COM_applyFilter($_POST['mode']);
        if (!empty($LANG_MG01['save']) && $post_mode == $LANG_MG01['save']) {
            $album_id = COM_applyFilter($_POST['album_id'], true);
            $media_id = COM_applyFilter($_POST['mid']);
            if (!empty($media_id) && !empty($album_id)) {
                require_once $_CONF['path'] . 'plugins/mediagallery/include/mediamanage.php';
                MG_saveMediaEdit($album_id, $media_id, $home_url);
            }
        }
        echo COM_refresh($home_url);
        exit;
    }
}
$display = COM_startBlock($LANG_MG00['admin'], '', COM_getBlockTemplate('_admin_block', 'header'));
$display .= MG_showAdminMenu($sub_menu);
if ($msg > 0) {
    $display .= COM_showMessageText($LANG_MG09[$msg]);
}
$display .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
if (empty($sub_menu)) {
    $display .= plugin_showstats_mediagallery(0);
}
$display = COM_createHTMLDocument($display);
COM_output($display);