-
Notifications
You must be signed in to change notification settings - Fork 0
Lightwindow with CI
[code] <?php if (!defined('BASEPATH')) exit('No direct script access allowed');?> <? //This CLASS is enable you to call lightwindow (Lightbox alike) by CI. //Please visit http://www.stickmanlabs.com/lightwindow/ to download and try Lightwindow
//Created by Gin2 //============= //USAGE EXAMPLE //=============
<link href="base_url().'javascript/ajax_lightwindow/css/lightwindow.css'" type="text/css" rel=stylesheet /> <s\cript type="text/javascript" src="<?=base_url()?>javascript/prototype/prototype-1.6.0.2.js"> <s\cript type="text/javascript" src="<?=base_url()?>javascript/scriptaculous/scriptaculous.compressed.js?load=effects">
<a href="#" onClick="FuncName(); return false;">Open Lighwindow <?=$this->lightwindow->ajax('FuncName', 'index.php/file_to_open', 'My LightWindow', 'Good Work', 'My Name');?> ==============================================================================// */
class Lightwindow{ var $funcName = ''; var $url = ''; var $title = ''; var $w = 300; var $h = 300;
function ext($funcName='', $url='', $title='', $caption, $author = '', $w=0, $h=0){
$block = $this->jsBlock();
$output = "function ".$funcName."(){
myLightWindow.activateWindow({
href: '".$url."',
title: '".$title."',
author: '".$author."',
caption: '".$caption."',
type: 'external',
width:$w, height:$h })
};";
return $block['open'].$output.$block['close'];
}
function ajax($funcName='', $url='', $title='', $caption='', $author=''){
$block = $this->jsBlock();
$output = "function ".$funcName."(){
myLightWindow.activateWindow({
href: '".$url."',
title: '".$title."',
author: '".$author."',
caption: '".$caption."',
type: 'page'
})
};";
return $block['open'].$output.$block['close'];
}
function full($funcName='', $url='', $title='', $caption='', $author=''){
$block = $this->jsBlock();
$output = "function ".$funcName."(){
myLightWindow.activateWindow({
href: '".$url."',
title: '".$title."',
author: '".$author."',
caption: '".$caption."',
type: 'external'})
};";
return $block['open'].$output.$block['close'];
}
function alert($url='', $title='', $caption='', $author=''){
$block = $this->jsBlock();
$output = "myLightWindow.activateWindow({
href: '".$url."',
title: '".$title."',
author: 'QuickCMS',
caption: '".$caption."',
type: 'page',
height: 60
});";
return $block['open'].$output.$block['close'];
}
function jsBlock(){
$blocks = array(
'open'=>''."\n\t",
'close'=>''."\n\t"
);
return $blocks;
}
} ?> [/code]