Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/administrator/components/com_rsticketspro/helpers/adapters/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/administrator/components/com_rsticketspro/helpers/adapters/accordion.php

<?php
/**
 * @package    RSTickets! Pro
 *
 * @copyright  (c) 2010 - 2016 RSJoomla!
 * @link       https://www.rsjoomla.com
 * @license    GNU General Public License
http://www.gnu.org/licenses/gpl-3.0.en.html
 */

defined('_JEXEC') or die('Restricted access');

class RSAccordion
{
	protected $id		= null;
	protected $titles 	= array();
	protected $contents = array();

	public function __construct($id)
	{
		$this->id = preg_replace('#[^A-Z0-9_\. -]#i', '',
$id);
	}

	public function addTitle($label, $id)
	{
		$this->titles[] = (object) array('label' => $label,
'id' => $id);
	}

	public function addContent($content)
	{
		$this->contents[] = $content;
	}

	public function render()
	{
		$active = reset($this->titles);

		echo JHtml::_('bootstrap.startAccordion', $this->id,
array('active' => $active->id));

		foreach ($this->titles as $i => $title)
		{
			echo JHtml::_('bootstrap.addSlide', $this->id,
JText::_($title->label), $title->id);
			echo $this->contents[$i];
			echo JHtml::_('bootstrap.endSlide');
		}

		echo JHtml::_('bootstrap.endAccordion');
	}
}