<?php

if (isset($_GET['w4d_popup'])) {
    $_SESSION['w4d_popup'] = $_GET['w4d_popup'];
}

mh_define('MH_POPUP', ($_SESSION['w4d_popup'] == 1) ? true : false);

$back_url = mh_href_link(FILENAME_MAILBEEZ, 'module=config_shopvoting');


// lngrefactor


require_once(MH_DIR_CONFIG . 'config_shopvoting/lang/' . $_SESSION['language'] . "/manage_shopvotings.php");


require_once(MH_DIR_CONFIG . 'config_shopvoting/classes/Shopvoting.php');

$voting = new Shopvoting();


function shopvoting_admin_page_link($filename, $params = '', $return_url = false)
{
    $url_params = 'app=load_app&app_path=config_shopvoting/admin_application_plugins/' . $filename . '&module=' . mh_get('module') . '&' . $params;

    if ($return_url) {
        // zencart
        if (!stristr(FILENAME_MAILBEEZ, MH_FILE_EXTENSION)) {
            $url = FILENAME_MAILBEEZ . MH_FILE_EXTENSION . '?' . $url_params;
        } else {
            $url = FILENAME_MAILBEEZ . '?' . $url_params;
        }
    } else {
        $url = mh_href_link(FILENAME_MAILBEEZ, $url_params);
    }

    $url = str_replace('index.php?cmd=mailbeez&', 'mailbeez.php?', $url);
    $url = str_replace('index.php?cmd=mailbeez?', 'mailbeez.php?', $url);
    $url = str_replace('index.php?cmd=mailbeez', 'mailbeez.php', $url);
    return $url;
}