Hamburger

From EKiniWiki

Jump to: navigation, search

Contents

[edit] What is Hamburger?

Hamburger is a web content management system that uses Zend Framework. It uses the following in Zend Framework:

  1. Zend_Auth
  2. Zend_Controller
  3. Zend_Db
  4. Zend_View
  5. Zend_Registry
  6. Zend_Session
  • You will need PDO to be able to run Hamburger.

[edit] Directory Structure

.htaccess
/application
    /controllers
    /library
         /Ekini
              /Controller
              /Action
                  CheckHasAccess.php
         /Zend (THE ZF LIBRARY!)
    /models
         Categories.php
         Comments.php
         Content.php
         Permissions.php
         Products.php
         Siteconfig.php
         Users.php
    /views
         /filters
         /helpers
              ConvertUrlToLinkHelper.php
              GetCommentCountHelper.php
              GetCommentFormHelper.php
              GetFrontItemsHelper.php
              GetSiteVarHelper.php
         /scripts
              /admin
                  admin_nav.phtml
                  createcontent.phtml
                  createsitevar.phtml
                  editcomment.phtml
                  editcontent.phtml
                  editsitevar.phtml
                  footer.phtml
                  header.phtml
                  index.phtml
                  managecomments.phtml
                  managecontent.phtml
                  managesitevars.phtml
              /auth
                  index.phtml
              /comment
                  index.phtml
              /error
                  error.phtml
                  index.phtml
                  noaccess.phtml
              /index
                  category.phtml
                  content.phtml
                  index.phtml
              footer.phtml
              index.phtml
/html
    .htaccess
    /css
    /images
          /uploads
    /js
    index.php

[edit] Database Schema

To be added. With Default Values, etc.

[edit] Configuring the Bootstrap File

The Bootstrap File is the index.php file found inside the /html directory. Here are the variables that you must edit:

  1. $configArray contains the Database configuration.
  2. Zend_Registry::set('defaultCommentStatus', 'pending'); The second parameter can either be pending or active. This is so that when a comment is posted, it is either set to Pending or automatically approved (set to Active).
  3. Zend_Registry::set('siteUrl', 'http://localhost:8888/hamburger/html'); The URL of your website accessible via the browser. For example: http://www.ekini.net
  4. Zend_Controller_Front::run('/Applications/MAMP/htdocs/hamburger/application/controllers'); The path of your controllers directory. Make sure that you have set this correctly.

[edit] Installation

[edit] Prerequisites

  1. PDO
  2. PHP5.2x or higher with PDO_MYSQL compiled.
  3. MySQL5

[edit] How to Install

This covers the installation of Hamburger. As of now, there is now automatic way to install hamburger. You must do the following:

  1. Checkout a copy of hamburger in assembla.com (email me so that I can add you to the team.)
  2. Create the database and import the database schema - see above.
  3. Edit the Bootstrap File.

[edit] Hamburger Essentials

[edit] What is a site_var?

Site_vars are like modules. Site_vars are stored in the database inside the siteconfig table. You can basically put anything inside the site_var. These can be navigation links, images, html and videos. You can retrieve a site_var anywhere inside you view files using this helper:

<?php echo $this->getSiteVarHelper('navigation_bar')?>

Soon, you will be able to get a site_var from within your content. It will be something like: _SITE_VAR_SITEVARNAME_

[edit] Content Management

You can categorize content just like any other CMS. You can retrieve content by doing something like this:

http://localhost/hamburger/html/index/content/8
    • where 8 is the unique content ID generated when creating a content.

You can display all content under a specific category by doing something like this:

http://localhost/hamburger/html/index/category/2
    • where 2 is the unique category ID generated when creating a category.

TO DO: Create admin for categories.

[edit] User Management

The Access Control for Hamburger is similar to Xoops. You can restrict access per Controller down to per Action. The default access for all controllers and actions is "allow".

The system will look up the permissions table upon login and store the permissions in a session. The CheckHasAccess Plugin is responsible for checking the session. The Plugin always checks for "deny" and if found, the system will redirect the user to the "noaccess" view file.

TO DO: user admin

[edit] Expanding Hamburger

To expand, all you have to do is to create a new Controller and then a new directory for your view files.

Personal tools
Bookmarks