|
||||
[previous page]  |  [up one level]  |  [next page] | ||||
|
ZenFSMenuMaker
package : ZenFS
Author : Bruno Desthuilliers Version : 0.0.5 public class ZenFSMenuMakerBuilds a menu from a filesystem hierarchy.Files and directories whose extensions are listed in the conf file will be listed as menuItems. Directories that dont have extensions are listed as categories. Dotted files and directories are ignored. Files and dirs names format goes like this file : file_name-xxx.ext dir : dir_name-xxx The 'xxx' part is the key for the item, and should be something like'000', '001' etc... Note that this key is also used to sort the menu. The menu 'caption' is the part of the name that comes before the first dash, underscores being replaced by spaces. Functionspublic void ZenFSMenuMakerParse the config, and list existing potential templates
Parameters : string $config_path : the path to the (specific) config file Return : (void) public array getMenuBuild and return the menu for the data_path item of the config file
Return : (array) the menu (an associative array [key => ZenMenuItem]) private void _makeMenuJust calls _makeMenuEx with base paramaters. The real job is done by _makeMenuEx()
See also : function _makeMenuEx() Parameters : string $path : : the data directory Return : (void) private void _makeMenuExRecurse thru the data directory and create the menu.
Parameters : string $current_path : of the directory to visit integer $level : recursion level string $parent_key : for the parent directory if we're in a sub directory Return : (void) private void _listExistingTemplatesCreate a list of all php pages at the root level.
If the name of one of the php pages matches a subdirectory name,this page will be used as 'template' for the documents in this subdirectory Return : (void) private void _findTemplateForReturn the php page that should be used as template for the documents
See also : function _listExistingTemplates() Parameters : string $wanted : name of the template we're looking for string $default : default template if we dont have what we 'wanted' Return : (void) private string _makeKeyRetrieve the key from the file or dir name
Parameters : string $fname : current file or dir name string $parent_key : parent key that must be prepended Return : (string) the key for this entry private string _makeCaptionRetrieve the caption from the file or dir name
Parameters : string $fname : file or dir name boolean $is_doc : this a document or a category ? Return : (string) variablesprivate array $_menuThe menu itself (an associative array)private array $_templatesA list of potential 'template' pages (in fact all the .php files in the root directory)private array $_extensionsA list of knowns docTypes - with ZenFS, the file extension is used as docType |
|||
[previous page]  |  [up one level]  |  [next page] |