CommunityID/modules/default/controllers/PrivacyController.php

37 lines
1.0 KiB
PHP
Raw Normal View History

2019-07-17 20:08:50 +00:00
<?php
/*
* @copyright Copyright (C) 2005-2010 Keyboard Monkeys Ltd. http://www.kb-m.com
2019-07-17 20:08:50 +00:00
* @license http://creativecommons.org/licenses/BSD/ BSD License
* @author Keyboard Monkey Ltd
* @since CommunityID 0.9
* @package CommunityID
* @packager Keyboard Monkeys
*/
2019-07-17 20:16:19 +00:00
class PrivacyController extends CommunityID_Controller_Action
2019-07-17 20:08:50 +00:00
{
protected $_numCols = 1;
public function indexAction()
{
$scriptsDir = $this->view->getScriptPath('privacy');
2019-07-17 20:08:50 +00:00
$locale = Zend_Registry::get('Zend_Locale');
// render() changes _ to -
$locale = str_replace('_', '-', $locale);
$localeElements = explode('-', $locale);
2019-07-17 20:08:50 +00:00
if (file_exists("$scriptsDir/index-$locale.phtml")) {
$view = "index-$locale";
2019-07-17 20:08:50 +00:00
} else if (count($localeElements == 2)
&& file_exists("$scriptsDir/index-".$localeElements[0].".phtml")) {
$view = 'index-'.$localeElements[0];
2019-07-17 20:08:50 +00:00
} else {
$view = 'index-en';
2019-07-17 20:08:50 +00:00
}
$this->render($view);
2019-07-17 20:08:50 +00:00
}
}