This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
redir/application/classes/controller/admin/welcome.php
2011-07-20 22:57:07 +10:00

34 lines
1.3 KiB
PHP

<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Admin_Welcome extends Controller_TemplateDefault {
public function action_index() {
Block::add(array(
'title'=>'Welcome to lnApp (admin)',
'subtitle'=>'Using lnApp',
'body'=>'Sample lnApp application',
'footer'=>'lnApp makes building websites easy! '.time(),
));
$this->template->control = sprintf('%s -&gt; %s -&gt; %s -&gt; %s',
HTML::anchor(URL::site(),_('Home')),
HTML::anchor($this->request->uri(),'Body',array('id'=>'ajxbody')),
HTML::anchor($this->request->uri(),'Left',array('id'=>'ajxleft')),
HTML::anchor($this->request->uri(),'Right',array('id'=>'ajxright'))
);
$this->template->content = Block::factory();
// @todo Change this to Script::add();
$js = '';
$js .= '<script type="text/javascript">
$(document).ready(function() {
$("#ajxbody").click(function() {alert("hello - body!"); $("#ajBODY").load("/"); return false;});
$("#ajxleft").click(function() {alert("hello - left!"); $("#ajLEFT").load("/welcome/left"); return false;});
$("#ajxright").click(function() {alert("hello - right!"); $("#ajRIGHT").load("/welcome/right"); return false});
$("#ajRIGHT").ajaxSend(function() {$(this).text("Triggered ajaxSend handler.");});
});
</script>';
$this->template->content .= $js;
}
} // End Welcome