diff options
| author | modela bitweaver <spiderr@bitweaver.org> | 2021-02-01 22:46:01 -0500 |
|---|---|---|
| committer | modela bitweaver <spiderr@bitweaver.org> | 2021-02-01 22:46:01 -0500 |
| commit | abbb88f997ac62aee576c81871604289daebf165 (patch) | |
| tree | 37748093efad26894c84d2cf67dcf630d0553f82 | |
| parent | f5bc2f5ad45d3479b865e32cac201b11effd9c4a (diff) | |
| download | pigeonholes-abbb88f997ac62aee576c81871604289daebf165.tar.gz pigeonholes-abbb88f997ac62aee576c81871604289daebf165.tar.bz2 pigeonholes-abbb88f997ac62aee576c81871604289daebf165.zip | |
privatize and clean up requireHandlerFile; use public getContentClassName when need to load a class
| -rw-r--r-- | Pigeonholes.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Pigeonholes.php b/Pigeonholes.php index e2a8975..695ee52 100644 --- a/Pigeonholes.php +++ b/Pigeonholes.php @@ -192,16 +192,18 @@ class Pigeonholes extends LibertyMime { if( !empty( $contentTypes[$aux['content_type_guid']] ) ) { $type = &$contentTypes[$aux['content_type_guid']]; if( empty( $type['content_object'] ) ) { - // create *one* object for each object *type* to call virtual methods. - include_once( $gBitSystem->mPackages[$type['handler_package']]['path'].$type['handler_file'] ); - $type['content_object'] = new $type['handler_class'](); - } - if( $type['content_object']->isViewable( $aux['content_id'] )) { - $aux['display_url'] = $type['content_object']->getDisplayUrlFromHash( $aux ); - $aux['display_link'] = $type['content_object']->getDisplayLink( $aux ); - $aux['title'] = $type['content_object']->getTitleFromHash( $aux ); -// needs updating to bw3 $aux['thumbnail_url'] = liberty_fetch_thumbnails( array()); - $ret[] = $aux; + // crate *one* object for each object *type* to call virtual methods. + if( $typeClass = $gLibertySystem->getContentClassName( $type['content_type_guid'] ) ) { + if( $type['content_object'] = new $typeClass() ) { + if( $type['content_object']->isViewable( $aux['content_id'] )) { + $aux['display_url'] = $type['content_object']->getDisplayUrlFromHash( $aux ); + $aux['display_link'] = $type['content_object']->getDisplayLink( $aux ); + $aux['title'] = $type['content_object']->getTitleFromHash( $aux ); + // needs updating to bw3 $aux['thumbnail_url'] = liberty_fetch_thumbnails( array()); + $ret[] = $aux; + } + } + } } } } |
