HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers36/mecurity-stadsafsluiting.nl/wwwroot/mvc/models/m_productBlock.php
<?php
/**
 * m_productBlock.php
 * Created by Komma Mediadesign.
 * Author: mike
 * Date: 3/12/13
 */


class ProductBlock
{
    /*
     * @property string $_title;
     * Title of the Project
     */
    private $_title = '';

    /*
     * @property string $_description;
     * Description of the Project
     */
    private $_description = '';

    /*
    * @property string $_label;
    * Label of the topbutton
    */
    private $_url = '';

    /*
    * @property string $_label;
    * Label of the topbutton
    */
    private $_image = '';

    /*
     * @property
     */
    private $_classes = array();

    /*
     * Constructor
     */
    public function __construct($title){
        $this->_title = $title;
    }

    /*
     * Sets the subtitle of the project
     * @param string
     */
    public function setDescription($input)
    {
        if( ! empty($input))
        {
            $this->_description = $input;
        }
    }

    /*
     * Sets the subtitle of the project
     * @param string
     */
    public function setUrl($url)
    {
        if( ! empty($url))
        {
            $this->_url = $url;
        }
    }

    /*
     * Sets the subtitle of the project
     * @param string
     */
    public function setImage($path)
    {
        if( ! empty($path))
        {
            $this->_image = $path;
        }
    }

    /*
     * Add class
     * @param string
     */
    public function addClass($className)
    {
        if($className != NULL)
        {
            $this->_classes[] = $className;
        }
    }


    public function display($echo = TRUE)
    {
        $output = '';

        $output .= '<div class="pBlock';
        foreach($this->_classes as $className)
        {
            $output .= ' '.$className;
        }
        $output .= '">';
            $output .= '<div class="pBlockImage">
                            <img src="'.$this->_image.'" alt="'.$this->_title.'" />
                            <div class="pBlockOverlay"></div>
                        </div>
                        <div class="pBlockContent">
                            <span class="pBlockTitle"><a href="'.$this->_url.'" class="pBlockLink">'.$this->_title.'</a></span>
                            '.$this->_description.'
                            <div class="pBlockBar"></div>
                            <div class="pBlockArrow"></div>
                            <div class="pBlockArrowActive"></div>
                        </div>';
        $output .= '</div>';

        if($echo)
        {
            echo $output;
        }
        else
        {
            return $output;
        }
    }
}