<?php
/**
 * Smarty plugin
 *
 * @category Smarty
 * @license /_licenses/untermStrich/agb_normal.pdf
 * @author Christian Wengg
 * @copyright 2010 untermStrich
 * @package Smarty
 * @subpackage plugins
 * @version $Id$
*/

/**
 * Smarty boolean view function plugin
 *
 * Purpose:  Create the view for a bool value for is_private
 *
 * @param   array   $params Parameters:
 *                  <ul>
 *                      <li>value   boolean     The variable</li>
 *                  </ul>
 * @return  string  The field source
 */
function smarty_function_isprivate(array $params)
{
    $placeholder = (isset($params['placeholder']))?$params['placeholder'] : '';

    if (isset($params['value'])) {
        $title = '';
        if (isset($params['title'])) {
            $title = $params['title'];
        }
        
        if ($params['value']) {
            return '<div class="dialog_make_btn14 is_private_2d" title="'.$title.'">P</div>';
        } else {
            return $placeholder;
        }
    } else {
        return '';
    }
}

