CIMSU OTS Technical Blog

Tuesday, March 6, 2007

Lots of Small Changes

In the past week, there have been several small changes made throughout the FrameWorks system. Let me 'splain. No, there is too much. Let me sum up:

Parser 1.2.2: Parser got a little upgrade, to have a little more in common with Smarty and to simplify the code in pages that use it. The "addVariable" method was shortened to "set" (with an alias left for backwards compatibility) and the "setTemplate" method was made private (this may cause scripts to crash) and template selection was limited to the output function, as in Smarty. So now, code should look something like:

$parser = new Parser;
$parser->set('name', 'value');
echo $parser->output('default.htm');

It also now gets the default template directory from LocalSettings.php, which means you must first include LocalSettings.php, which means you must first define the security constant.

Calendar 1.2.1: Calendar just got updates to follow the new Parser code formats.

RSSFeed 1.1: RSSFeed got similar updates to Calendar 1.1. It now uses Parser to generate code, instead of encoding raw XML. The "addItem" method was also shortened to "add" (with an alias for backwards compatibility).

User 2.0.1 and Userdata 1.0.1: To streamline the process of accessing user information, the Rights array and associated functions were moved to the Userdata object. The User method "hasRight" is now a reference to the mUserdata object's "getRight" method.

The only major update planned for any of these at this time is the addition of ParserExtensions to the Parser object. These would use callback functions to allow custom extensions, as in the MediaWiki parser. I am currently undecided about the format for such tags or how data will be passed to the callback.

Labels:

0 Comments:

Post a Comment

<< Home