History of Some Notes on Developing With Bitweaver
Version 11 | Current version | |
---|---|---|
Some General Useful StuffBitweaver Stuff
Programming Stuff
How to set up your own custom packageThe easiest way to learn how to set up your own package is to start with the SamplePackage, which you can download or checkout from cvs. It has examples of most things described below. Setting up your database tablesDatabase (DB) Tables are defined in schema_inc.php This file goes in your admin folder. Each package has one of these. Some conventions to follow when building tables:
Setting up Smarty templatesIncluding tpl files in the html HEADThe bitweaver Kernel is set up to automatically include header information from all packages. Any information you want included in the HTML HEAD you put in a file named header_inc.tpl which goes in your package's _templates_ folder.To create conditional header includes simply nest tpl files in the header_inc.php file. You can do this by using the this include code: {CODE()}{ include file="bitpackage:yourpackagename/subheader.tpl"} {CODE} Setting Up Package Permissions
Creating Package Dropdown and SidePanel MenusEach package has template file for its menus. You need to explicitly declair what you want in a menu in your own template file. For an example see the wiki package menu_wiki.tpl which you can find at: /wiki/templates/menu_wiki.tpl Creating Package PreferencesPreferences are automatically created the first time you submit a value for one. This means that a preference can be created for the first time by simply submiting one via a form on the admin_sample.tpl. For more advanced preferences examples look at admin_wiki.tpl or admin_articles.tpl. If you want to set default 'y' values for your package preferences during install, you declare these in the schema_inc.php file in admin. You do not need to set a preference for any that you would give a 'n' value to. The admin preferences panel is displayed via /admin/admin_sample_inc.php usng the template /templates/admin_sample.tpl Any prefereces set can be checked with isFeatureActive() The admin menu is shown via templates/menu_sample_admin.tpl Interface ( HTML ) DevelopmentAdd Animated WarningsThis explination is not perfect, and needs reworking. But it is close.The animated warnings you sometimes see when you tell bitweaver to do something stupid can be easily added to any page. The necessary javascript is usually added to all bitweaver pages. It comes from the file: util/javascript/libs/fat.js To add an alert div you can call kernel/smarty_bit/function.formfeedback.php or just include a div something like this:
Using Wiki Syntax and Parsing for HTMLEnabling Syntax support in your package is easy as is parsing it for HTML display. Nothing special needs to be done to use a particular syntax, you just insert it into your database table as is. When you want to display it in a HTML page, you parse the data using a built in parser. In your load() function you include this line:
the first value is the raw data, and the second value is the syntax type. The site's defualt, as set in admin->liberty is used if none is specified for the individual object. Each object can have a specific syntax specified for it. Take a look at the Sample Package, and also look at the Wiki Editing html page and note the syntax options. You can find all parsers included with Bitweaver in liberty/plugins/; look for files like format.*.php Browser DetectionBitweaver includes built in browser detection. Browser information is available in smarty templates via:
Browser type is reported in:
Other properties that are avialable are:
General Bitweaver InformationTroublshooting Your Bitweaver InstallAdmin Locked OutTry deleting your bowser cache and cookies for the site. Also try deleting from the database using the following:
If those don't work, then try resetting the admin password to 'foobar' using this query:
| Some General Useful StuffBitweaver Stuff
Programming Stuff
How to set up your own custom packageThe easiest way to learn how to set up your own package is to start with the SamplePackage, which you can download or checkout from cvs. It has examples of most things described below. Setting up your database tablesDatabase (DB) Tables are defined in schema_inc.php This file goes in your admin folder. Each package has one of these. Some conventions to follow when building tables:
Setting up Smarty templatesIncluding tpl files in the html HEADThe bitweaver Kernel is set up to automatically include header information from all packages. Any information you want included in the HTML HEAD you put in a file named header_inc.tpl which goes in your package's templates folder.To create conditional header includes simply nest tpl files in the header_inc.php file. You can do this by using the this include code:
Setting Up Package Permissions
Creating Package Dropdown and SidePanel MenusEach package has template file for its menus. You need to explicitly declair what you want in a menu in your own template file. For an example see the wiki package menu_wiki.tpl which you can find at: /wiki/templates/menu_wiki.tpl Creating Package PreferencesPreferences are automatically created the first time you submit a value for one. This means that a preference can be created for the first time by simply submiting one via a form on the admin_sample.tpl. For more advanced preferences examples look at admin_wiki.tpl or admin_articles.tpl. If you want to set default 'y' values for your package preferences during install, you declare these in the schema_inc.php file in admin. You do not need to set a preference for any that you would give a 'n' value to. The admin preferences panel is displayed via /admin/admin_sample_inc.php usng the template /templates/admin_sample.tpl Any prefereces set can be checked with isFeatureActive() The admin menu is shown via templates/menu_sample_admin.tpl Interface ( HTML ) DevelopmentAdd Animated WarningsThis explination is not perfect, and needs reworking. But it is close.The animated warnings you sometimes see when you tell bitweaver to do something stupid can be easily added to any page. The necessary javascript is usually added to all bitweaver pages. It comes from the file: util/javascript/libs/fat.js To add an alert div you can call kernel/smarty_bit/function.formfeedback.php or just include a div something like this:
Using Wiki Syntax and Parsing for HTMLEnabling Syntax support in your package is easy as is parsing it for HTML display. Nothing special needs to be done to use a particular syntax, you just insert it into your database table as is. When you want to display it in a HTML page, you parse the data using a built in parser. In your load() function you include this line:
the first value is the raw data, and the second value is the syntax type. The site's defualt, as set in admin->liberty is used if none is specified for the individual object. Each object can have a specific syntax specified for it. Take a look at the Sample Package, and also look at the Wiki Editing html page and note the syntax options. You can find all parsers included with Bitweaver in liberty/plugins/; look for files like format.*.php Browser DetectionBitweaver includes built in browser detection. Browser information is available in smarty templates via:
Browser type is reported in:
Other properties that are avialable are:
General Bitweaver InformationSome things about securityUse of "tk" value
Troublshooting Your Bitweaver InstallAdmin Locked OutTry deleting your bowser cache and cookies for the site. Also try deleting from the database using the following:
If those don't work, then try resetting the admin password to 'foobar' using this query:
|