Source for file ajaxCommand.php

Documentation is available at ajaxCommand.php

  1. <?php
  2.  
  3. /**
  4. @package admin
  5. */
  6.  
  7. /**
  8.  * @var string BASEDIR Constant which represents the basedir of the server
  9.  */
  10. define("BASEDIR"substr($_SERVER["SCRIPT_FILENAME"]0strrpos($_SERVER["SCRIPT_FILENAME"],"/admin/")));
  11. /**
  12. @var string TEMPLATEDIR Constant which represents the template directory of Caramel CMS installation
  13. */
  14. define("TEMPLATEDIR""../".substr(dirname($_SERVER["SCRIPT_NAME"])0strrpos(dirname($_SERVER["SCRIPT_NAME"]),"/admin/"))."template");
  15.  
  16. require_once(BASEDIR.'/inc/controller/BackendController.php');
  17.  
  18. # New backend controller
  19. $backendController new BackendController();
  20.  
  21.  
  22. if($_GET{
  23.     
  24.     if($_GET["q"]=="newpage"{
  25.         echo $backendController->ajaxAction("newpage");
  26.     }
  27.     if($_GET["q"]=="editpages"{
  28.         echo $backendController->ajaxAction("editpages");
  29.     }
  30.     if($_GET["q"]=="editusers"{
  31.         echo $backendController->ajaxAction("editusers");
  32.     }
  33.     if($_GET["q"]=="edittemplates"{
  34.         echo $backendController->ajaxAction("edittemplates");
  35.     }
  36.     if($_GET["q"]=="editglobals"{
  37.         echo $backendController->ajaxAction("editglobals");
  38.     }
  39.     
  40. }
  41. ?>