Ver Mensaje Individual
  #10  
Antiguo 11-07-2008
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Reputación: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Gracias coso, yo también veo muy elegante el código:

Código PHP:
<?php

// lightbox.class.php

function lightbox($pluginData){
  return new 
LightBox($pluginData);
}

class 
LightBox extends GbPlugin
{
  public function 
OnActivatePlugin(){}
  public function 
OnDeactivatePlugin(){}

  public function 
PrinterCallback($printerName){
    if(
$printerName == GBPLUGINS_PRINTER_THEME_HEADER){
      
JScript::SetVariables(array( 
        
'gblbTextOf' => $this->_rp('of'),
        
'gblbTextImage' => $this->_rp('Image'),
        
'gblbTextClose' => $this->_rp('Close [X]'),  
        
'gblbTextHelpClose' => $this->_rp('Click to close'),
        
'gblbTextHelpInteract' => $this->_rp('Hove to interact'),
        
'gblbTextCloseInfo' => $this->_rp('Click outside image to close')
      ));
      
$jsDir $this->GetDirJScriptsUrl();
      
$this->IncludeJScriptsInTheme(array(
        
$jsDir.'jquery.js',
        
$jsDir.'jquery.lightbox.js',
        
$jsDir.'lightbox.config.js'
      
));
    }
    return 
true;
  }
}

?>
Código:
// lightbox.config.js

// DOM ready!
$(function(){
  // Vars defined at "lightbox.class.php"
  $.Lightbox.construct({  
    'text':{
      'about':{
        'link': '',
        'text': '',
        'title': ''
      },
      'of': gblbTextOf,
      'image': gblbTextImage,
      'close': gblbTextClose,
      'closeInfo': gblbTextCloseInfo,
      'help':{
        'close': gblbTextHelpClose,
        'interact': gblbTextHelpInteract
      }
    }
  }); 
});
__________________
David Esperalta
www.decsoftutils.com
Responder Con Cita