<?php

/**
 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @package clearFusionCMS
 * @copyright Copyright (c) 2012 - 2013 clearFusionCMS. All rights reserved.
 * @link http://clearfusioncms.com
 */

// If not loaded into the router
if(!$this) die;

$mgrPath = clearFusionCMS::getConfig()->get('managerPath', 'manager');
$this->addRoute('cfManagerCron', new flRouterRoute($mgrPath . '/cron', array('controller' => 'cfCron', 'action' => 'run')));
$this->addRoute('cfManagerAPI', new flRouterRoute($mgrPath . '/api/:apiver/:service/:method', array('controller' => 'cfApi', 'action' => 'run'), array('apiver' => '\d+', 'service' => '[a-z0-9]+', 'method' => '[a-z0-9]+')));
$this->addRoute('cfManagerModule', new flRouterRoute($mgrPath . '/module/:module/:action/*.*', array('controller' => 'backend', 'action' => 'dashboard')));
$this->addRoute('cfManager', new flRouterRoute($mgrPath . '/:action/*.*', array('controller' => 'cfBackend', 'action' => 'dashboard')));
$this->addRoute('cfContent', new flRouterRoute('*.*', array('controller' => 'cfContent', 'action' => 'render'), array('*' => '[a-z0-9 _-]+(\.[a-z0-9]{2,4})?')));
