示例#1
0
function attach_info_to_results($results, $type, $license)
{
    $id_array = ['type' => $type, 'license' => $license];
    $attach_id_fun = function ($result) use($id_array) {
        $params = array_merge($result, $id_array);
        $params['hash'] = Integrity::view_params_hash($params['license'], $params['type'], $params['site'], $params['title'], $params['url'], $params['author'], $params['author_url'], $params['preview_url'], $params['full_url']);
        return $params;
    };
    return array_map($attach_id_fun, $results);
}
示例#2
0
require_once $srcroot . 'licenses.php';
$check_str = $_REQUEST['check'];
if ($check_str != "") {
    //TODO: Check we have all the params and tell user if not
    $site = urldecode($_REQUEST['site']);
    $type = urldecode($_REQUEST['type']);
    $license = urldecode($_REQUEST['license']);
    $license_locale = '';
    $license_version = '4.0';
    $title = urldecode($_REQUEST['title']);
    $url = urldecode($_REQUEST['url']);
    $author = urldecode($_REQUEST['author']);
    $author_url = urldecode($_REQUEST['author_url']);
    $preview_url = urldecode($_REQUEST['preview_url']);
    $full_url = urldecode($_REQUEST['full_url']);
    $check = Integrity::view_params_hash($license, $type, $site, $title, $url, $author, $author_url, $preview_url, $full_url);
    if ($check_str != $check) {
        die("Params invalid.");
    }
    $smarty->assign('site', $site);
    $smarty->assign('dcmitype', media_dcmitype_for_letter($type));
    $smarty->assign('license_string', license_string($license, $license_version, $license_locale));
    $smarty->assign('license_url', license_url_for_num($license, $license_version));
    $smarty->assign('license_icon', license_icon_for_num($license, $license_version));
    $smarty->assign('title', $title);
    $smarty->assign('url', $url);
    $smarty->assign('author', $author);
    $smarty->assign('author_url', $author_url);
    $smarty->assign('image', $full_url);
}
$smarty->assign('headerfile', 'welcome-header.tpl');