diff options
| -rw-r--r-- | LibertyContent.php | 25 | ||||
| -rw-r--r-- | templates/edit_services_inc.tpl | 4 |
2 files changed, 26 insertions, 3 deletions
diff --git a/LibertyContent.php b/LibertyContent.php index aaebbfb..8ebc7ee 100644 --- a/LibertyContent.php +++ b/LibertyContent.php @@ -3,7 +3,7 @@ /* Management of Liberty content * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.420 2010/02/02 22:01:40 spiderr Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.421 2010/02/15 15:57:07 wjames5 Exp $ * @author spider <spider@steelsun.com> */ @@ -835,6 +835,29 @@ class LibertyContent extends LibertyBase { } /** + * check if a service is active for this content type + * requires package LCConfig + * provisional method until LCConfig package is integrated into the core + */ + function hasService( $pServiceGuid ){ + global $gBitSystem; + $ret = TRUE; // we return true by default to preserve legacy service opperation which has no content type preferences + + if( $gBitSystem->isPackageActive( 'lcconfig' ) ){ + // LCConfig is a singlton class + $LCConfig = LCConfig::getInstance(); + // LCConfig negates services by content type + // if result is not 'n' then service should apply to this content type + if( $LCConfig->getConfig( 'service_'.$pServiceGuid, $this->mContentTypeGuid ) == 'n' ){ + $ret = FALSE; + } + } + + return $ret; + } + + + /** * Default liberty sql for joining a content object table to liberty. * We are proposing a new way of building queries here where we build up everything in a hash with implicit AND over all * where clauses and then do an array_merge and concatenation in a single function at the end. See convertQueryHash for details. diff --git a/templates/edit_services_inc.tpl b/templates/edit_services_inc.tpl index f5c89fa..d57201c 100644 --- a/templates/edit_services_inc.tpl +++ b/templates/edit_services_inc.tpl @@ -1,6 +1,6 @@ {if !$translateFrom} - {foreach from=$gLibertySystem->mServices item=service} - {if $service.services.$serviceFile} + {foreach from=$gLibertySystem->mServices item=service key=service_guid} + {if $gContent->hasService( $service_guid ) && $service.services.$serviceFile} {include file=$service.services.$serviceFile edit_content_status_tpl=$edit_content_status_tpl} {/if} {/foreach} |
