lądującą FCK editor
i Teraz pytanie czy jest ona dobrze napisana
zamiast ładować tam gdzie trzeba ciągle taki kod
Kod
$oFCKeditor = new FCKeditor('tresc');
$oFCKeditor->BasePath = './fckeditor/';
$oFCKeditor->Value = $wiersz['zawartosc'];
$oFCKeditor->Width = '100%';
$oFCKeditor->Height = '600';
$oFCKeditor->Create();
$oFCKeditor->BasePath = './fckeditor/';
$oFCKeditor->Value = $wiersz['zawartosc'];
$oFCKeditor->Width = '100%';
$oFCKeditor->Height = '600';
$oFCKeditor->Create();
to ja napisałem tak:
Kod
function load_fck($pole,$value,$width,$height){
global $oFCKeditor;
$oFCKeditor = new FCKeditor($pole);
$oFCKeditor->BasePath = './fckeditor/';
$oFCKeditor->Value = $value;
$oFCKeditor->Width = $width; //100%
$oFCKeditor->Height = $height; //600
$oFCKeditor->Create();
}
global $oFCKeditor;
$oFCKeditor = new FCKeditor($pole);
$oFCKeditor->BasePath = './fckeditor/';
$oFCKeditor->Value = $value;
$oFCKeditor->Width = $width; //100%
$oFCKeditor->Height = $height; //600
$oFCKeditor->Create();
}
I teraz po prostu wywołuje fck w taki sposób
Kod
$def = $wiersz['zawartosc'];
load_fck('tresc',$def,'100%','600');
load_fck('tresc',$def,'100%','600');
Czy jest to lepsze rozwiązanie niż stary kod
