Meditate™ Web Content Editor  


 

Latest release

Meditate 1.3
3 Jul 2012
download now!





Integrating with a larger admin system

If your website includes functionality that you manage through another administrative interface, you can embed Meditate into that interface so that users can edit content from a single login. This process requires that you can access and modify the source code of your existing admin system and set up a wrapper page. It also requires PHP version 5.3 or higher.

  1. Confirm that you are running PHP 5.3 or higher on your web server. You can print the value of phpversion() from one of your PHP scripts to check this.
  2. Open Meditate's index.php file. Comment out the first line and uncomment the two namespace lines at the top of the file.
  3. Open Meditate's config/constants.php file and set INTEGRATION_MODE to 1.
  4. Set WRAPPER_PAGE to the directory and page name of a wrapper page in your admin interface. A wrapper is a page containing your system's authentication, navigation and layout code, with an empty space where you'll embed Meditate.
  5. Check the set of constants beginning with SITE_PROTOCOL. These are normally configured automatically by Meditate, but you will probably have to set them manually to work correctly within your wrapper page.
  6. Open config/styles.css and remove any styles that conflict with your own styles.
  7. Open the file in your admin system that contains the login code. At a point after a user is logged in, set a variable $user_id to the user's ID and then paste the following code:
    $_GET["page"] = "integration_login";
    $cwd = getcwd(); // save the current directory so we can return to it later
    chdir("[relative path to editor directory]"); // then set the working directory so the editor thinks it's running from its own location
    include "pages/index.php"; // load the editor login code
    chdir($cwd); // return to the original working directory
  8. Open the wrapper file in your admin system and paste the following code:
    $cwd = getcwd(); // save the current directory so we can return to it later
    chdir("[relative path to editor directory]"); // then set the working directory so the editor thinks it's running from its own location
    include "index.php"; // load the editor index
    chdir($cwd); // return to the original working directory
  9. Assuming your wrapper page is named wrapper.html, browse to wrapper.html?page=login to start the installation script. (You can skip this step if Meditate is already installed as a standalone system.) When the installation is done, it will redirect you to your system's login page; log in again.
  10. Browse to wrapper.html?page=users_manage and set up the editor users. Add your system's user ID to each user record.
  11. Add menu items to your system for whatever Meditate pages you want to use:
    Content > Edit: wrapper.html?page=content_edit
    Content > Review: wrapper.html?page=content_review
    Content > History: wrapper.html?page=content_history
    Content > Browse: wrapper.html?page=content_browse
    Files > Manage: wrapper.html?page=files_manage
    Users > Manage: wrapper.html?page=users_manage
 
Meditate is developed by Arlo Leach.