In a true CMS system the admin would simply give the user access to edit the page and review his changes after they were made. If the admin had done his homework the user would already have access to create and edit pages for his department. If the user shouldn't have acess to modify the page then the user should contact his department head.user: i want to make a webpage for my department
admin: ok, here are the templates you have to choose from. you can change the content, but you can not modify the layout or the color scheme.
user: ok. but i want to make this line bigger, and red and flashing.
admin: sorry, that is not available in these templates.
Some of you know that I work for a company that has built our own PHP application framework which separates logic and html called http://www.logicreate.com (some of you may not). Here is how the LogiCreate system handles this separation of templates and logic.
This is what we call the "welcome module". It's job is for learning purposes and can be changed to fit ones needs
Code: Select all
<?
class welcome extends FuncMapAuth {
var $presentor = "htmlPresentation"; // presentation handler
function run(&$db,&$u,&$arg,&$t) {
$tї"time"] = date("h:i:s");
// choose your template
$arg->templateName = 'main';
// grab something from the Database
$db->queryOne("select name from users where username='$u->username'")
// pass the name to the template
$tї'name'] = $db->Record;
}
}
?>Code: Select all
<h3>Hi <?=$tї'name']?></h3>
The current time is: <?=$tї"time"]?><br><br>
Thank you <?=$tї'name']?> for visiting our site. We hope you will come back to see us later.--ZorKa