/application/controllers/IndexController.php
PHP | 97 lines | 37 code | 11 blank | 49 comment | 6 complexity | 294ef3ad6e98397e51f5d82312cf6095 MD5 | raw file
Possible License(s): BSD-3-Clause
- <?php
- /** Zend_Controller_Action */
- require_once 'Zend/Controller/Action.php';
-
- class indexController extends Zend_Controller_Action
- {
-
-
- public function altHomeAction(){
-
- }
-
- public function indexAction()
- {
-
- $host = OpenContext_OCConfig::get_host_config();
- if(substr_count($_SERVER['HTTP_HOST'], "www.")>0){
- $reDirectURI = $host;
- header('Location: '.$reDirectURI);
- exit;
- }
-
- @$agent = $_SERVER['HTTP_USER_AGENT'];
- //$this->view->simpleView = false;
- if($agent){
- if(stristr($agent, "safari") || stristr($agent, "iphone") || stristr($agent, "ipad")|| stristr($agent, "firefox")){
- //$this->view->simpleView = true;
- if(isset($_GET["test"])){
- return $this->render("alt-home");
- }
- }
- }
-
-
- }
-
- public function robotsAction() {
- $this->_helper->viewRenderer->setNoRender();
- $host = OpenContext_OCConfig::get_host_config();
-
- $robots = "
- User-agent:*\r\n
- Crawl-Delay:0.5\r\n
- Disallow:/cgi-bin/\r\n
- Disallow:/tmp/\r\n
- Disallow:/sets/\r\n
- Disallow:/lightbox/\r\n
- Disallow:/search/\r\n
- Disallow:/properties/\r\n
- Disallow:/narratives/\r\n
- Disallow: /*&\r\n
- Sitemap: http://opencontext.org/data/siteMap-1.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-2.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-3.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-4.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-5.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-6.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-7.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-8.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-9.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-10.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-11.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-12.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-13.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-14.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-15.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-16.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-17.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-18.xml \r\n
- Sitemap: http://opencontext.org/data/siteMap-19.xml \r\n
- ";
-
- header("Content-Type: text/plain");
- echo $robots;
-
- }
-
- //this is for the timemap js, for some reason it likes to request __history__.html
- public function historyAction() {
- $this->_helper->viewRenderer->setNoRender();
- header("Content-Type: text/plain");
- echo true;
- }
-
- public function rssProjectsRss2PhpAction() {
- $this->_helper->viewRenderer->setNoRender();
- $host = OpenContext_OCConfig::get_host_config();
- $reDirectURI = $host."/projects/.atom";
- header('Location: '.$reDirectURI);
- exit;
- }
-
-
-
- }
-
-