login | register
Fri 21 of Nov, 2008 (09:23 UTC)

bitweaver - Web Application Framework and CMS

Web Application Framework and CMS

Stephan Borg

User Page

UserPagewolff_borg

My thoughts on bitweaver is to integrate common business applications such as CRM, HR, Payroll, Accounting, etc into bitweaver - providing single-sign-on and common look-and-feel.

When bitweaver is in a more 'integratable' state, I will be happy to investigate this option further and fund development - but for now, its just a pipe-dream.

User Information

Login
wolff_borg
Real Name
Stephan Borg
Country
Australia Australia
Language
English (English, en)
Member since
Sunday 15 of February, 2004
Last Login
Friday 04 of July, 2008 (20:40:04 UTC)
Send Message
Send a personal message to this user

Recent Blog Posts

Refresh cachePrint

In Smarty, how do I check what browser is being used?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
Here is a code sample for your .tpl:

{if $gBitLoc.browser.client eq 'mz' or $gBitLoc.browser.client eq 'ie'}
    This browser is IE or Mozilla based!
{/if}


the end.
Refresh cachePrint

How do I create a LibertyContent Class?

By Stephan Borg
Thursday 29 of December, 2005
Posted to Developer's FAQ
Your best bet to creating a LibertyContent class, is to copy the SamplePackage, BitSample.php file and modify accordingly.

The best approach is to:
  • Modify the verify() function first, making sure each and every field is validated correctly.
  • Modify the store() function, ensuring data is stored in the table correctly.
  • Modify the load() function
  • Modify the getList() function
  • Modify the expunge() function
Refresh cachePrint

Can I use strtotime() and strftime()?

By Stephan Borg
Thursday 29 of December, 2005
Posted to Developer's FAQ
We have implement locale timezone formatting using BitDate() class.

For easy access, always use:
$gBitSystem->mServerTimestamp->strtotime(...);
 
and
 
$gBitSystem->mServerTimestamp->strftime(...);
 
as straight replacements.


Inside Smarty templates, use the:
{$timestamp|bit_short_datetime}


Other formats are:
  • bit_date_format
  • bit_long_datetime
  • bit_short_date
  • bit_short_time
  • bit_long_date
  • bit_long_time
  • bit_short_datetime
Refresh cachePrint

Can I use strtotime() and strftime()?

By Stephan Borg
Thursday 29 of December, 2005
Posted to Developer's FAQ
We have implement locale timezone formatting using BitDate() class.

For easy access, always use:
$gBitSystem->mServerTimestamp->strtotime(...);
 
and
 
$gBitSystem->mServerTimestamp->strftime(...);
 
as straight replacements.


Inside Smarty templates, use the:
{$timestamp|bit_short_datetime}


Other formats are:
  • bit_date_format
  • bit_long_datetime
  • bit_short_date
  • bit_short_time
  • bit_long_date
  • bit_long_time
  • bit_short_datetime
Refresh cachePrint

How do I check in Smarty, if Liberty content is in HTML?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
{if $gContent->mInfo.format_guid == 'bithtml'}
    This is HTML content!
{/if}
Refresh cachePrint

How do I check for a preference setting in Smarty?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
{if $gBitSystemPrefs.tinymce_ask eq 'y'}
    This setting is 'yes'!
{else}
    This setting is 'no'!
{/if}
Refresh cachePrint

How do I add an Administration menu to a package?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
Well...
First you need a package/admin/admin_package_inc.php file, which will look something like this:
{code}<?php
$formTinyMCEFeatures = array(
"tinymce_ask" => array(
'label' => 'WYSIWYG confirmation',
'note' => 'Ask before using the WYSIWYG editor tinymce when clicking on a textarea. If you disable this feature, we strongly suggest you enable HTML content format as the only content format and also disable quicktags.',
'page' => '',
),
);
$smarty->assign( 'formTinyMCEFea…
Refresh cachePrint

How do I check if the current user has a permission?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
if ($gBitUser->hasPermission('bit_p_admin_cms')) {
    This user has permission!
}


NOTE: if you want to exit and display an error message if they don't have permission, then:
$gBitSystem->verifyPermission( 'bit_p_view' );

This displays a standard "You do not have permission!" error message.
Refresh cachePrint

How do I get and set preferences?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
To get a preference:
$gBitSystem->getPreference("maxArticles", 10);

Where, "maxArticles" is your preference name, which 10 is your default setting, should it not be set.

To set a preference:
$gBitSystem->storePreference("maxArticles", 10);

Where, "maxArticles" is your preference name, which 10 is your setting you wish to store.
Refresh cachePrint

How do I check if a Package is enabled?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
if ($gBitSystem->isPackageActive( 'articles' )) {
    Articles are active!
}


NOTE: if you wish to exit and display an error message, if package is not enabled, use:
$gBitSystem->verifyPackage( 'articles' );
Refresh cachePrint

How do I check if a Feature is enabled?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
if( $gBitSystem->isFeatureActive( 'feature_listPages' ) ) {
    Feature List Pages is active!
}


NOTE: if you wish exit and display an error message on failure, use:
$gBitSystem->verifyFeature( 'feature_listPages' );
Refresh cachePrint

How do I display a standard error page?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
Very simple:
$gBitSystem->fatalError( "Any error message you want" )
Refresh cachePrint

How do I include other package libraries and classes?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
You'd want to check that the package is installed, as some admins may not install everything.
if ($gTikiSystem->isPackageActive( 'categories' )) {
        include_once( CATEGORIES_PKG_PATH.'categ_lib.php');
        ... do something with categories...
}
Refresh cachePrint

How do I use the DB functionality?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
Ok,
  • The $this object is usually a class from BitSystem parent.
  • First of all, you should quote your field names in backticks '`'. This is used to ensure portability between different database vendors.
  • Next, you want to prefix your table names with BIT_DB_PREFIX to allow multiple installs of Bitweaver under one database.
  • We use parameterised queries, by using '?' for our values. This also helps remove quoting problems between vendors.
  • Lastly, our sort mode is a function, in the
Refresh cachePrint

Do I use the $smarty global variable to display pages?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
Uh, no - we use:
$gBitSystem->display( 'tikipackage:articles/list_articles.tpl', tra("articles") );

Where:
  • 'tikipackage:articles/list_articles.tpl' is a url to find package templates store under package/templates/ directory
  • tra("articles") is used to change the browser title - should be standard practise to do this and indicate where in the CMS you are (and what you're looking at).
Refresh cachePrint

How do I check a user permission in Smarty?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
{if $gBitUser->hasPermission( 'bit_p_read_article' )}
  <li><a class="item" href="{$gBitLoc.ARTICLES_PKG_URL}index.php">{biticon ipackage=liberty iname=home iexplain="articles home"} {tr}Articles Home{/tr}</a></li>
  <li><a class="item" href="{$gBitLoc.ARTICLES_PKG_URL}list.php">{bitcon ipackage=liberty iname=list iexplain="list articles"} {tr}List articles{/tr}</a></li>
{/if}
Refresh cachePrint

I have a user ID, how do I get information about the user?

By Stephan Borg
Sunday 03 of July, 2005
Posted to Developer's FAQ
Well, in Smarty templates, using the {displayname} tag works a treat. For example, I have a user ID and I want their real name:
The user name is {displayname user_id=$gBitUser->getUserId()}


See Smarty Functions for more short-cut functions.
Refresh cachePrint

Is there an easy way to insert data to a DB table?

By Stephan Borg
Friday 15 of July, 2005
Posted to Developer's FAQ
If you had a simple table, say:
'my_faq' => "
	faq_id I4 AUTO PRIMARY,
	question C(255) NOTNULL,
	answer C(255) NOTNULL,
",


And you wanted to insert a record, you would prepare the data in the following array:
$my_data = array(
	'question' => "What is this project?",
	'answer' => "Its Bitweaver Application Framework!",
);


Then to insert it into the database:
$gBitDb->associateInsert( 'my_faq', $my_data );
Refresh cachePrint

Is there an easy way to update data to a DB table?

By Stephan Borg
Friday 15 of July, 2005
Posted to Developer's FAQ
If you had a simple table, say:{code}'my_faq' => "
faq_id I4 AUTO PRIMARY,
question C(255) NOTNULL,
answer C(255) NOTNULL,
",{/code}

And you wanted to update a record, you would prepare the data to update in the following array:{code}$my_data = array(
'question' => "What is this project again?",
'answer' => "Its the Bitweaver CMS and Application Framework!",
);{/code}

Next, you would define what record you plan to update. You do this by building a search array.{code}$my_id = ar…
Refresh cachePrint

How do I reference an icon?

By Stephan Borg
Saturday 06 of August, 2005
Posted to Developer's FAQ
All icons are stored under <package>/icons directory.

For detailed information on biticon see function_biticon

{biticon ipackage='sheets' iname='icn_budgetgraph' iexplain='Graph'}
Refresh cachePrint

SDLC - ContactsPackage

By Stephan Borg
Friday 08 of July, 2005
Posted to Wolffy's Blog
So, I started a new page today called LDAPContactsPackage and thought it a good opportunity to eat my own dog food, and implement a very basic SDLC.

I've completed the Feasibility Study - I need a contacts package! That was easy! :)

So now onto requirements...

I've put down 1 week for a list of requirements - after that, I will try and lock down for version 1.1 (I will try...).

Will try and apply the Six Hats of Critical Thinking during th…
Refresh cachePrint

Whats the difference between a Package and a Feature?

By Stephan Borg
Friday 01 of July, 2005
Posted to Developer's FAQ
A package is the name given to the sub-directories found under Bitweaver's root directory. These are usually applications and can be removed or disabled at will.

A feature, is usually a setting within these packages - and its setting, is usually stored as a preference.

For example, Wiki is a package, while Wiki Sandbox is a feature.
Refresh cachePrint

Critical Preflight Checks

By Stephan Borg
Tuesday 08 of February, 2005
Posted to Wolffy's Blog
After discussions with Spiderr, we agreed that critical checks will be performed in TikiSystem::checkEnvironment(). Have consolidated methods used to check these settings to ))preflight_inc.php(( and checkEnvironment() will begin to use these functions.

  • Reverted changes made to TikiSystem previously (thanks spiderr)
  • Added simple preflight checks to ))preflight_inc.php(( such as:
    • minimum PHP version
    • minimum PHP extension version
    • file writeable checks
    • directory writeable ch
Refresh cachePrint

Design Questions

By Stephan Borg
Sunday 18 of April, 2004
Posted to BWDesigner's Blog

Been wondering

  • whats the use of parameter session_lifetime?
  • whats the use of parameters http_domain / http_prefix? Should all references to $_SERVER["SERVER_NAME"] and TIKI_ROOT_URL point to these instead?
  • when you login to TP, it takes you to /users/my.php - but clicking on My Homepage takes you to /users/index.php?fHomepage=admin - which one is correct? Are they supposed to be the same?
  • should everything in setup_inc.php below ''tiki_lo
Refresh cachePrint

Some structure changes...

By Stephan Borg
Thursday 26 of February, 2004
Posted to Important Stuff
Made some structure and rename changes today.

kernel/local.php is now kernel/config_inc.php
kernel/defaults_inc.php is now kernel/config_defaults_inc.php

Kernel flowchart goes something like this:
  1. /tiki_setup_inc.php is called - this defines TIKI_ROOT_PATH and points to (requires) kernel/setup_inc.php
  2. kernel/setup_inc.php is called - the first two things it does is includes (in case its a virgin install) kernel/config_inc.php and requires kernel/config_defaults_inc.php. This file is