Beispiel #1
0
/**
 * 
 * @param TPPaySettings $ps
 * @return string
 */
function tinypass_post_options_summary(TPPaySettings $ps)
{
    $output = "";
    $resource_name = htmlspecialchars(stripslashes($ps->getResourceName()));
    $resource_id = htmlspecialchars(stripslashes($ps->getResourceId()));
    if ($resource_name == '') {
        $resource_name = 'Default to post title';
    }
    $en = $ps->isEnabled() ? __('Yes') : __('No');
    $output .= "<div><strong>Enabled:</strong>&nbsp;" . $en . "</div>";
    $output .= "<div><strong>Name:</strong>&nbsp;" . $resource_name . "</div>";
    $output .= "<div><strong>RID:</strong>&nbsp;" . $resource_id . "</div>";
    $line = "<div><strong>Pricing:</strong></div>";
    for ($i = 1; $i <= 3; $i++) {
        if ($ps->hasPriceConfig($i) == false) {
            continue;
        }
        $caption = $ps->getCaption($i);
        $line .= "<div style='padding-left:50px;'>" . $ps->getAccessFullFormat($i);
        if ($caption != '') {
            $line .= " - '" . htmlspecialchars(stripslashes($caption)) . "'";
        }
        $line .= "</div>";
    }
    $output .= $line;
    return $output;
}