51 $xml =
"\n<SectionMap>";
56 $xml .=
"</SectionMap>";
61 function import($doc,
$tx)
80 private static $map = array();
90 trace(
"Section Type '{$type}' will be managed by ".get_class($manager), 4);
91 SectionContentManagerMap::$map[
$type] = $manager;
102 $mgr = SectionContentManagerMap::$map[
$section->section_type];
105 throw new FakoliException(
"Unknown section manager for section '{$section->section}'");
118 return array_key_exists($section_type, SectionContentManagerMap::$map);
127 $types = array_keys(SectionContentManagerMap::$map);
134 trace(
"Registering Section Content Managers", 4);
157 trace(
"Adding '$identifier' to section '$section_folder'", 3);
170 $conent->use_SSL = $use_SSL;
176 trace(
"Removing '$identifier' from section '$section_folder'", 3);
183 $content->delete(
"WHERE section_id={$section->section_id} AND identifier='$identifier'");
192 return $content->exists(
"WHERE section_id={$section->section_id} AND identifier='$identifier'");
197 $affected = Query::create(
SectionContent,
"WHERE permissions REGEXP '[[:<:]]{$permission}[[:>:]]'")
200 foreach($affected as $a)
203 $perms = explode(
",", $a->permissions);
204 foreach($perms as $q)
206 if ($q != $a) $p[] = $q;
209 $a->permissions = implode(
",", $p);
210 $a->filter =
new InclusionFilter(
"permissions");
219 $mgr->upgrade($version);
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.
FakoliException is the base exception class for all Fakoli errors.
Maintains the map of SectionContentManagers for different Section types.
static getManager($section)
Retrieves the SectionContentManager object for the specified section.
static isSectionTypeRegistered($section_type)
Check whether a SectionContentManager has been registered for the specified type.
static registerManager($type, $manager)
Registers a SectionContentManager for handling a specified section type.
static getRegisteredTypes()
Returns the list of registered section content types.
Section DataItem, defining the data model for sections within a site.
static createFromIdentifier($identifier)
SectionManager provides simple programmatic interface for managing registration of pages to sections.
static upgradeComponent($version)
static registerSerializationHandler()
static registerSectionContentManager()
static isInSection($section_folder, $identifier)
static addToSection($section_folder, $identifier, $role="", $template="", $use_SSL=false, $permissions="")
static removeFromSection($section_folder, $identifier)
static ensureContentManager()
static permissionDeleted($permission)
Handles serialization of the section map for import/export.
SectionSerializationHandler()
static serialize($class, $constraint="")
Serializes the specified DataItems to XML.
registerHandler($component, $title, $handler)
Registers a serialization handler for a component.
static unserialize($class, $doc, $tx, $save=true)
Instantiates DataItems from the supplied XML document and stores them in the database.
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content