import v1.0.0-RC4 | 2009-05-20
This commit is contained in:
37
modules/default/controllers/LearnmoreController.php
Normal file
37
modules/default/controllers/LearnmoreController.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkey Ltd
|
||||
* @since CommunityID 0.9
|
||||
* @package CommunityID
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class LearnmoreController extends Monkeys_Controller_Action
|
||||
{
|
||||
protected $_numCols = 1;
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$scriptsDir = $this->view->getScriptPath('learnmore');
|
||||
|
||||
$locale = Zend_Registry::get('Zend_Locale');
|
||||
// render() changes _ to -
|
||||
$locale = str_replace('_', '-', $locale);
|
||||
$localeElements = explode('-', $locale);
|
||||
|
||||
if (file_exists("$scriptsDir/index-$locale.phtml")) {
|
||||
$view = "index-$locale";
|
||||
} else if (count($localeElements == 2)
|
||||
&& file_exists("$scriptsDir/index-".$localeElements[0].".phtml")) {
|
||||
$view = 'index-'.$localeElements[0];
|
||||
} else {
|
||||
$view = 'index-en';
|
||||
}
|
||||
|
||||
$this->render($view);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user