Próbowałem wg instrukcji na codeigniter.com ale się nie udało.
Zresztą jakiś dziwny ten opis niby fckeditor jest kopiowany do "plugins"
ale później wywołują fckeditora poprzez $this->load->library('fckeditor');
Piszą wspólny opis dla wersji PHP4 i PHP5. Najpierw 4 potem co trzeba zmienić
gdy jest PHP5, tylko nie piszą w jakich plikach.
Szczerze to się pogubiłem. Może znacie jakiś inny edytor, coś prostego w integracji z CI ?
Dzięki
piker9
Opiszę dokładnie
PC-BSD, PHP5 Apache 2.2, fckeditor 2.5 beta
Podtytuł = Update for CI 1.5
<a href="http://codeigniter.com/wiki/FCKeditor/" target="_blank">http://codeigniter.com/wiki/FCKeditor/</a>
Skopiowałem katalog fckeditor do /system/libraries/
skopiowałem plik fckeditor.php do /system/application/libraries
Zmieniłem wielkość pierwszych liter dla plików
Fckeditor.php, Fckeditor_php4.php , Fckeditor_php5.php
Zmieniłem wpisy w plikach
Fckeditor_php4.php
początek pliku wygląda tak:
CODE
// zmieniono nazwe z FCKeditor
class Fckeditor
{
var $InstanceName ;
var $BasePath ;
var $Width ;
var $Height ;
var $ToolbarSet ;
var $Value ;
var $Config ;
// PHP 4 Constructor zmieniono nazwe z FCKeditor
function Fckeditor( $instanceName )
{
//dodano
$this->__construct( $instanceName ) ;
//dodano
// $this->InstanceName = $instanceName ;
// $this->BasePath = '/fckeditor/' ;
// $this->Width = '100%' ;
// $this->Height = '200' ;
// $this->ToolbarSet = 'Default' ;
// $this->Value = '' ;
// $this->Config = array() ;
}
Fckeditor_php5.php wygląda tak:
Kod
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Fckeditor
{
var $InstanceName;
var $BasePath;
var $Width;
var $Height;
var $ToolbarSet;
var $Value;
var $Config;
// PHP 5 Constructor (by Marcus Bointon <coolbru@users.sourceforge.net>)
function __construct( $instanceName )
{
$this->InstanceName = $instanceName;
$this->BasePath = '/fckeditor/';
$this->Width = '100%';
$this->Height = '200';
$this->ToolbarSet = 'Default';
$this->Value = '';
$this->Config = array();
}
class Fckeditor
{
var $InstanceName;
var $BasePath;
var $Width;
var $Height;
var $ToolbarSet;
var $Value;
var $Config;
// PHP 5 Constructor (by Marcus Bointon <coolbru@users.sourceforge.net>)
function __construct( $instanceName )
{
$this->InstanceName = $instanceName;
$this->BasePath = '/fckeditor/';
$this->Width = '100%';
$this->Height = '200';
$this->ToolbarSet = 'Default';
$this->Value = '';
$this->Config = array();
}
Nie do końca wiem czy dobrze zrobiłem
Oto zawartość pliku Fckeditor.php
CODE
if ( !function_exists('version_compare') || version_compare( phpversion(), '5', '<' ) )
include_once( base_url().'/usr/local/www/data/CI/system/libraries/fckeditor/Fckeditor_php4.php' ) ;
else
include_once( base_url().'/usr/local/www/data/CI/system/libraries/fckeditor/Fckeditor_php5.php' ) ;
w pliku ..../CI/system/application/controllers/test.php
CODE
<?
class Test extends Controller
{
// base_url().
function index()
{
$this->load->library('fckeditor', 'FCKEDITOR1');
$this->fckeditor->BasePath =base_url . '/usr/local/www/data/CI/system/libraries/fckeditor/';
$this->fckeditor->ToolbarSet = 'Basic';
$data['fck1'] = $this->fckeditor->CreateHtml();
$this->load->view('test_view', $data);
}
}
?>
plik ..../CI/system/application/views/test_view.php
w application/config/autoload.php mam
Kod
$autoload['helper'] = array('url');
BŁĘÐY
CODE
A PHP Error was encountered
Severity: Warning
Message: include_once(fckeditor/Fckeditor_php5.php) [function.include-once]: failed to open stream: No such file or directory
Filename: libraries/Fckeditor.php
Line Number: 31
A PHP Error was encountered
Severity: Warning
Message: include_once() [function.include]: Failed opening 'fckeditor/Fckeditor_php5.php' for inclusion (include_path='.:/usr/local/share/pear')
Filename: libraries/Fckeditor.php
Line Number: 31
Fatal error: Class 'Fckeditor' not found in /usr/local/www/data-dist/CI/system/libraries/Loader.php on line 810
Nie mógł znaleźć pliku Fckeditor.php więc mu wpisałem pełną ścieżkę
bląd się nieco zmienił
Kod
Not Found
The requested URL /usr/local/www/data/CI/system/libraries/fckeditor/editor/fckeditor.html was not found on this server.
Apache/2.0.61 (FreeBSD) PHP/5.2.3 with Suhosin-Patch Server at localhost Port 80
The requested URL /usr/local/www/data/CI/system/libraries/fckeditor/editor/fckeditor.html was not found on this server.
Apache/2.0.61 (FreeBSD) PHP/5.2.3 with Suhosin-Patch Server at localhost Port 80
Ten plik jednak istnieje w tym katalogu
Na forum piszą że to ścieżki
<a href="http://codeigniter.com/forums/viewthread/46876/" target="_blank">http://codeigniter.com/forums/viewthread/46876/</a>
Po usunięciu base_url() jest ta sama sytuacja
A wy co myślicie, co jest nie tak ?
Pozdrawiam
piker
PORADZIŁEM SOBIE - nie powiem jak bo wstyd i tak wszyscy znają rozwiązanie.