BoltWire is a FREE content management system written in PHP.

Its innovative architecture combined with best-in-class forms processing makes it ideal for creating complex, interactive, web applications fast...




System File Alert

Extensions > Plugins > System File Alert

Here is a little function you can use to tell whether a page is in the local field, the system folder, or both. Sometimes it can be a bit confusing as to which page is being displayed.

To use it, create an action page called action.system and put the following content on it:

[(system extend.plugins.systempages)]

Then just put a link like this in your action bar or wherever you want:

[[{p}action.system|System Check]]

You could put it on a delete action, perhaps in an "if admin" conditional to know what exactly your are deleting. Or better still

To make it work, just copy this code to your config file or, optionally create a custom plugin:

function BOLTFsystem($args, $zone) {
     global $pageLink, $systemPath, $boltwire, $pageDir, $field;
     $page = BOLTinit($pageLink, $args[1]);
     $fpage = BOLTfolders($page, true);
      $loc = 0;
     if (file_exists("pages/$fpage")) $loc = 1;
     if (file_exists("$boltwire/system/$page")) $loc = $loc + 2;
     switch ($loc) {
          case '0': return 'This page does not exist.';    
          case '1': return 'This page only exists in the field.';    
          case '2': return 'This page is a system file.';    
          case '3': return 'This page is a local copy of a system file.';    

This could also be useful when doing upgrades. Generate a list of system pages, to show which system pages are currently copied over to your field, that might need to be upgraded. Try something like this:

The following system pages have been copied over to your local field:

{(search dir=system template="[if inline '[(system {+p})]' 'local'][[{+p}]][if]")}

Lot's of possibilities...