webcontrol.php
changeset 2 860ba7141641
parent 0 c63de9eb7045
child 3 e7447a6044ec
equal deleted inserted replaced
1:cddc2ba706d6 2:860ba7141641
    23 
    23 
    24 require('webserver.php');
    24 require('webserver.php');
    25 define('SMARTY_DIR', './smarty/');
    25 define('SMARTY_DIR', './smarty/');
    26 require('smarty/Smarty.class.php');
    26 require('smarty/Smarty.class.php');
    27 require('playlist.php');
    27 require('playlist.php');
       
    28 require('json.php');
    28 require('ajax.php');
    29 require('ajax.php');
    29 
    30 
    30 status('initializing Smarty');
    31 status('initializing Smarty');
    31 $smarty = new Smarty();
    32 $smarty = new Smarty();
    32 $smarty->template_dir = "./themes/$theme";
    33 $smarty->template_dir = "./themes/$theme";
    61   $httpd = new WebServer($ip, $port);
    62   $httpd = new WebServer($ip, $port);
    62   
    63   
    63   // setup handlers
    64   // setup handlers
    64   status('initializing handlers');
    65   status('initializing handlers');
    65   $httpd->add_handler('index', 'function', 'amarok_playlist');
    66   $httpd->add_handler('index', 'function', 'amarok_playlist');
       
    67   $httpd->add_handler('action.json', 'function', 'ajax_request_handler');
    66   $httpd->add_handler('scripts', 'dir', './scripts');
    68   $httpd->add_handler('scripts', 'dir', './scripts');
    67   $httpd->add_handler("themes/$theme", 'dir', "./themes/$theme");
    69   $httpd->add_handler("themes/$theme", 'dir', "./themes/$theme");
    68   $httpd->allow_dir_list = true;
    70   $httpd->allow_dir_list = true;
    69   $httpd->default_document = 'index';
    71   $httpd->default_document = 'index';
    70   
    72