I am trying to integrate a custom website into the drupal 7 system. On this website there is a lot of user interaction with buttons, database queries, ajax loaded elements, … . I need to get the the global user variable on this page.
My first question: What is the best way to integrate the webpage?
My first attempt was to create a content type (node—myPage.tpl.php): I got permission problems using ajax, so I separated the code into two files (node—myPage.tpl.php and myPage.php). In the node—myPage.tpl.php I only included myPage.php. But now I have the next problem using ajax (for myPage.php). I cannot get my global user variable.
My second attempt was to create a custom module. So I created a callback page. But I think I have to make a renderable array. I want to avoid this because myPage.php has over 3000 lines of code. And I don’t think jquery ajax will work as it should.
Is there an easy way to integrate a custom website into the drupal 7 system with access to the drupal api (user variable, functions)? I also prefer to keep the custom page in a php file, not into database.