* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-define('PL_OK', 0);
-define('PL_NEEDLOGIN', 1);
define('PL_FORBIDDEN', 403);
define('PL_NOT_FOUND', 404);
var $__mods;
var $__hooks;
+ var $ns;
var $path;
var $argv;
function Platal()
{
+ $modules = func_get_args();
$this->path = trim(Get::_get('p', null), '/');
$this->__mods = array();
$this->__hooks = array();
- foreach (glob(dirname(__FILE__).'/../modules/*.php') as $module) {
- $module = basename($module, '.php');
- $m =& PLModule::factory($this, $module);
- $this->__mods[$module] =& $m;
+ array_unshift($modules, 'core');
+ foreach ($modules as $module) {
+ $this->__mods[$module] = $m = PLModule::factory($this, $module);
$this->__hooks += $m->handlers();
}
}
$args = $this->argv;
$args[0] = &$page;
- if ($hook['auth'] > Session::get('auth', AUTH_PUBLIC)) {
+ if ($hook['auth'] > S::v('auth', AUTH_PUBLIC)) {
+ // FIXME: don't use 'session' object anymore
$_SESSION['session']->doAuth($page);
}
new_skinned_page('index.tpl', AUTH_PUBLIC);
if (empty($this->path)) {
- $this->__mods['core']->handler_index($page);
- } else
+ $this->path = 'index';
+ }
+
switch ($this->call_hook($page)) {
case PL_FORBIDDEN:
$this->__mods['core']->handler_403($page);