- <?php
- /**
- * Plugin array structure
- *
- * Goals:
- * To define routes so we can facilitate 'Clean URLS' and future development
- * To define permissions
- * To allow plugins to override/add to other core, provider (3rd Pary) and custom plugins, without touching their core code
- * Note: Template overrides are separate from Plugin overrides and will be applied in
- * the Template system using the directory structure
- */
- /**
- * Plugin page array structure
- *
- * Defines:
- * plugin page name -
- * Example Values:
- * array('Blog Posts' => array($route, $permissions)) // page to list blog posts
- * array('View Blog Post' => array($route, $permissions)) // page to display on full blog post
- *
- * plugin page route -
- * Example Value:
- * array('/blog/2013/06/19' => 'page_view_post')
- *
- * The resulting URL would be:
- * http://your_site.com/index.php?a=/blog/2013/06/19 - without clean URLS
- * http://your_site.com/blog/2013/06/19 - with clean URLS
- *
- * The function that is called would be:
- * function page_view_post() {}
- *
- * plugin page permissions -
- * Example Value:
- * array('Edit Post' => true) // means this permission is active and will display on the Permissions admin page
- */
- $plugins[$plugin_name] = array();
- $plugins[$plugin_name][$pages] = array();
- $plugins[$plugin_name][$pages][$page_name] = array();
- $plugins[$plugin_name][$pages][$page_name][$route] = array();
- $plugins[$plugin_name][$pages][$page_name][$route][$route_path] = 'callbackFunction';
- $plugins[$plugin_name][$pages][$page_name][$permissions] = array();
- $plugins[$plugin_name][$pages][$page_name][$permissions][$perm_name] = true;
- /**
- * Plugin blocks array structure
- *
- * Defines:
- * plugin block name -
- * Examples:
- * array('Blog Categories' => array($route, $permissions)) // block to list recent blog posts
- *
- * plugin block route -
- * Example Value:
- * 'block_blog_categories'
- *
- * The function that is called would be:
- * function block_blog_categories() {}
- *
- * plugin block permissions -
- * Example:
- * array('View Block' => true) - means this permission is active and will display on the Permissions admin page
- */
- $plugins[$plugin_name][$blocks] = array();
- $plugins[$plugin_name][$blocks][$block_name] = array();
- $plugins[$plugin_name][$blocks][$block_name][$route] = 'callbackFunction';
- $plugins[$plugin_name][$blocks][$block_name][$permissions] = array();
- $plugins[$plugin_name][$blocks][$block_name][$permissions][$perm_name] = true;
- /**
- * Plugin overrides array structure
- *
- * First the plugin data structures will be parsed and compiled, then overrides will be applied. Any conflicts between
- * overrides (inside the current plugin and with other plugins) will be caught and an error/exception will be thrown.
- */
- $plugins[$plugin_name][$overrides] = array();
- $plugins[$plugin_name][$overrides][$plugin_name] = array();
- $plugins[$plugin_name][$overrides][$plugin_name][$pages] = array();
- $plugins[$plugin_name][$overrides][$plugin_name][$pages][$page_name] = array();
- $plugins[$plugin_name][$overrides][$plugin_name][$pages][$page_name][$route] = array();
- $plugins[$plugin_name][$overrides][$plugin_name][$pages][$page_name][$route][$route_path] = 'callbackFunction';
- $plugins[$plugin_name][$overrides][$plugin_name][$pages][$page_name][$permissions] = array();
- $plugins[$plugin_name][$overrides][$plugin_name][$pages][$page_name][$permissions][$perm_name] = true;
- $plugins[$plugin_name][$overrides][$plugin_name][$blocks] = array();
- $plugins[$plugin_name][$overrides][$plugin_name][$blocks][$block_name] = array();
- $plugins[$plugin_name][$overrides][$plugin_name][$blocks][$block_name][$route] = 'callbackFunction';
- $plugins[$plugin_name][$overrides][$plugin_name][$blocks][$block_name][$permissions] = array();
- $plugins[$plugin_name][$overrides][$plugin_name][$blocks][$block_name][$permissions][$perm_name] = true;
Initial array overview