Advertisement
sathyashrayan

Untitled

Feb 16th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php
  2. /**
  3. * @copyright    Copyright (C) 2005 - 2008 Arlifax Pty Ltd. All rights reserved.
  4. * @license      GNU/GPL
  5. */
  6.  
  7. // Check for access
  8. defined( '_JEXEC' ) or die( 'Restricted access' );
  9.  
  10. $mainframe->registerEvent( 'onAfterDisplayTitle', 'plgContentPageTitle' );
  11.  
  12. /**
  13. * Plugin that changes an articles tile from the Article title to the Key Reference.
  14. */
  15. function plgContentPageTitle( &$row, &$params, $page=0 )
  16. {
  17.     $deniedViews = array( 'frontpage', 'category', 'section' );
  18.     foreach( $deniedViews as $deniedView ){
  19.         if( $deniedView == JRequest::getVar( 'view' ) ){
  20.         return;
  21.         }
  22.     }
  23.    
  24.     if( strlen($params->get('keyref')) > 0 )
  25.         {
  26.             $document= & JFactory::getDocument();
  27.             $document->setTitle( $params->get('keyref'));
  28.      }
  29. }
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement