<?php
/**
 * Copyright 2006 - 2013 TubePress LLC (http://tubepress.org)
 *
 * This file is part of TubePress (http://tubepress.org)
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

/**
 * This file demonstrates a trivial TubePress plugin. Uncomment the last line in the file to actually
 * activate the plugin.
 */

/**
 * Any PHP object can be registered as a TubePress plugin. The object defines its interaction with the core by
 * 
 *  1. Registering itself via TubePress::registerFilter()
 *  2. Implementing specially named methods on the object.
 *
 */
class SampleTubePressPlugin
{
    /**
     * Since we're registering this object with the 'galleryHtml' filter point,
     * it needs to implement the function alter_galleryHtml($html, $galleryId);

     * @param string $rawHtml   The gallery HTML to filter.
     * @param int    $galleryId The unique gallery ID.
     * 
     * @return string The (possibly modified) HTML.
     */
	public function alter_galleryHtml($rawHtml, $galleryId)
	{
		return "Hello, TubePress! $rawHtml";
	}
}

/**
 * Finally, we register an instance of this class as a filter for the 'galleryHtml' filter point,
 * which allows us to modify TubePress's HTML for a thumbnail galery.
 */
//TubePress::registerFilter('galleryHtml', new SampleTubePressPlugin());
