Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ef3e2b5aeb
Fetching contributors…

Cannot retrieve contributors at this time

88 lines (71 sloc) 2.608 kb
<?php
/*
Commonly you would want to re-define ApiFrontend for your own application.
*/
class Frontend extends ApiFrontend {
function init(){
parent::init();
// Keep this if you are going to use database on all pages
//$this->dbConnect();
$this->dbConnect();
// This will add some resources from atk4-addons, which would be located
// in atk4-addons subdirectory.
$this->api->stickyGET('b');
if($_GET['b']=='devel'){
$dir='atk4-1-addons';
}else{
$dir='atk4-addons';
}
$this->addLocation($dir,array(
'php'=>array(
'mvc',
'misc/lib',
)
))
->setParent($this->pathfinder->base_location);
// A lot of the functionality in Agile Toolkit requires jUI
$this->add('jUI');
$p=explode('_',$this->page);
$this->add('Button')->set('View source')->addStyle('float','right')
->js('click')
->univ()->redirect('source/'.$p[0]);
// Initialize any system-wide javascript libraries here
// If you are willing to write custom JavaScritp code,
// place it into templates/js/atk4_univ_ext.js and
// include it here
$this->js()
->_load('atk4_univ')
// ->_load('ui.atk4_expander')
;
// If you wish to restrict actess to your pages, use BasicAuth class
$this->add('BasicAuth')
->allow('demo','demo')
// use check() and allowPage for white-list based auth checking
//->check()
;
// Initialize objects which you want to see on ALL of your pages in this method
// If you, however, want to place object only on a single page, then
// create page/mytestpage.php with class page_mytestpage and put objects
// into it's init() method.
// Menu:
// If you are using a complex menu, you can re-define
// it and place in a separate class
$m=$this->add('Menu',null,'Menu');
$m->addMenuItem('Welcome','index');
$m->addMenuItem('about');
// If you want to use ajax-ify your menu
// $m->js(true)->_load('ui.atk4_menu')->atk4_menu(array('content'=>'#Content'));
// Finally if you want to use a simple menu, you can either put it into shared.html
// or include it from other file
// $m=$this->add('Menu',null,'Menu',array('view/mymenu'));
// You need to call initLayout which will determine current page and load
// respective page/...php class.
$this->initLayout();
}
function page_pref($p){
$this->dbConnect();
// This is example of how you can use form with MVC support
$p->frame('Preferences')->add('MVCForm')
->setController('Controller_User');
}
}
Jump to Line
Something went wrong with that request. Please try again.