Sitograph File structure

Root file structure

/
├── .htaccess
├── index.php
├── config.php
├── config-sample.php
├── load.php
├── favicon.ico
├── sitemap.xml
├── robots.txt
├── content/
│   └── … [Files are sent directly to browser]
├── include/
│   └── … [PHP controllers and kernel]
└── templates/
    └── … [UI templates folder]

All requests are routed to index.php by mod_rewrite rules defined in .htaccess.

Website configuration is stored in config.php. In case if config.php not found, config-sample.php is loaded and 'install' module is executed.

Initially, config.php is created by 'install' module wizard. The installation process includes creations of database tables with initial content and simple website structure.

Initialization of framework is done with load.php

Execution of any *.php files except index.php is prohibited in .htaccess for security reasons. Direct access to include/* and templates/* is also blocked.


Content file structure

content/
├── css/
│   ├── default.css
│   ├── bootstrap.min.css
│   ├── jquery.cropper.css
│   ├── jquery.fancybox.css
│   └── sitograph.css
├── fonts/
│   └── … [glyphicons set]
├── images/
│   ├── … [website images]
│   ├── fancybox
│   │   ├── … [fancybox images]
│   └── sitograph
│       └── … [CMS images]
├── js/
│   ├── default.js
│   ├── bootstrap.min.js
│   ├── jquery.cropper.js
│   ├── jquery.fancybox.min.js
│   ├── jquery.min.js
│   ├── sitograph.min.js
│   └── tinymce
│       └── … [tinymce WYSIWYG Editor files]
└── manual.html

Folder content/css is for *.css files, and content/js is for *.js respectively.

default.css is a global website CSS.

Files default.css and default.js, bootstrap.css and bootstrap.js and jquery.js are included globally as a part of 'default' theme.

Module 'fancybox' is activated globally (this leads to inclusion of jquery.fancybox.css and jquery.fancybox.js globally)

CMS includes sitograph.css and sitograph.js for all admin pages.

Modules 'cropper' and 'tinymce' are used by admin UI and loaded in /admin/* pages.

content/manual.html is a CMS manual displayed in 'Admin Dashboard -> Admin manual' section.


Templates file structure

templates/
├── custom/
│   ├── 404.tpl
│   ├── index.tpl
│   ├── main.tpl
│   ├── main-blog.tpl
│   ├── main-gallery.tpl
│   ├── user.tpl
│   ├── sitograph.tpl
│   ├── sitograph-login.tpl
│   ├── .... [templates by page]
│   ├── blog
│   │   ├── article-list.tpl
│   │   ├── article-preview-short.tpl
│   │   ├── article-preview.tpl
│   │   ├── details.tpl
│   │   ├── list.tpl
│   │   └── main.tpl
│   ├── gallery
│   │   └── .... [gallery related templates]
│   ├── sitograph
│   │   └── .... [CMS UI templates]
│   ├── user
│   │   └── .... [user related templates]
│   ├── widget
│   │   ├── header.tpl
│   │   ├── messages.tpl
│   │   ├── menu-top.tpl
│   │   ├── menu-user.tpl
│   │   ├── menu-bottom.tpl
│   │   ├── navigation.tpl
│   │   ├── pagination.tpl
│   │   ├── sideblock.tpl
│   │   ├── sideblock-blog.tpl
│   │   └── footer.tpl
└── default/
    └── .... [copy of custom]

UI templates are separated in accordance with Theme name.

The base application theme is called "custom" and placed in templates/custom.

Initially, "custom" theme is created as copy of "default" upon installation.

Each row in site structure is configured to use single theme + page template which, subsequently, includes other templates as page parts.

Template file can be associated with single page in site structure, like: index.tpl, main.tpl, main-blog.tpl, 404.tpl, etc. or can be included by other template.

For example, main-blog.tpl contains general layout for structure /blog/. Then it includes blog/main.tpl as a main content, which then includes blog/list.tpl or blog/details.tpl depending on user request.


* Note. The application will try to fall back to "default" theme if page template is not found in specified theme folder.

Folder custom/widget contains common page parts that are used in different places of website and CMS.

Folders custom/blog, custom/gallery and custom/user contains templates for appropriate website structures.

CMS UI files are stored in custom/sitograph

Common HTML widgets description:

  • header.tpl - global website HTML header
  • footer.tpl - global website footer
  • pagination.tpl - template to render pagination for listing
  • navigation.tpl - template for breadcrumbs
  • messages.tpl - block to display error and success messages
  • menu-top.tpl - website main navigation menu
  • menu-bottom.tpl - footer menu
  • menu-user.tpl - part of a menu that depends on authorized user session
  • sideblock.tpl - global website side block
  • sideblock-blog.tpl - part of sidemenu with blog articles preview

Include file structure

include/
├── class.msv.php
├── class.module.php
├── custom/
│   ├── bootstrap.php
│   ├── Google
│   │   └── .... [Google API Client Library for PHP]
│   └── smarty
│       └── .... [Smarty Template Engine]
└── module/
    ├── blog
    ├── gallery
    ├── cropper
    ├── fancybox
    ├── feedback
    ├── google-analytics
    ├── install
    ├── msv-api
    ├── msv-core
    ├── msv-seo
    ├── msv-users
    ├── search
    ├── sitograph
    ├── theme-default
    └── tinymce

include/ is the main application folder.

Controllers are separated as different modules and stored in include/module in folders with the name of a module.

Each module consists of minimum two files: config.xml and modulename.php. Optional files are included if present.

Optional config files are: config.locales.xml, config.install.xml

Optional controller files are: modulename.api.php, modulename.install.php, modulename.functions.php

Website Model is gathered in PHP class class.msv.php, creating module class instance (class.module.php) for each module. Module instance then attached to the parent class.

Each *.php file from include/custom will be included at the initialization stage.