<?php

class AdcControllerAjax{

    /**
     * Formats string to CamelCaps
     *
     * @param string $name string to format
     * @return string formatted string
     */
    static function _formatName($name)
    {
        $name = str_replace(array('-', '_', '.'), ' ', strtolower($name));
        $name = preg_replace('[^a-z0-9 ]', '', $name);
        return str_replace(' ', '', ucwords($name));
    }

	function getActions()
	{
		$res = array();
		foreach (get_class_methods($this) as $m){
			if (substr($m,0, 6) == "action"){
				$res[] = strtolower(substr($m,6));
			}

		}
		return $res;
	}

	function actionSearch()
	{
		$widgetTiles = new AdcVendorsTiles();
		$widgetTiles->search($_GET['q'], intval($_GET['category']), intval($_GET['offset']), intval($_GET['count']));
		exit;		
	}
}