<?php
/**
* @Project NUKEVIET 4.x
* @Author VINADES.,JSC (contact@vinades.vn)
* @Copyright (C) 2014 VINADES.,JSC. All rights reserved
* @License GNU/GPL version 2 or any later version
* @Createdate Apr 10, 2010 10:08:08 AM
*/
if( ! defined( 'NV_MAINFILE' ) ) die( 'Stop!!!' );
/**
* nv_aleditor()
*
* @param mixed $textareaname
* @param string $width
* @param string $height
* @param string $val
* @return
*/
function nv_aleditor( $textareaname, $width = '100%', $height = '450px', $val = '', $customtoolbar = '', $path = '', $currentpath = '' )
{
global $global_config, $module_upload, $module_data, $admin_info, $client_info;
$ckeditor_name = 'myckeditor';
$return = '<textarea style="width: ' . $width . '; height:' . $height . ';" id="' . $module_data . '_' . $textareaname . '" name="' . $textareaname . '">' . $val . '</textarea>';
if( ! defined( 'CKEDITOR' ) )
{
define( 'CKEDITOR', true );
$return .= '<script type="text/javascript" src="' . NV_BASE_SITEURL . NV_EDITORSDIR . '/' . $ckeditor_name . '/ckeditor.js?t=' . $global_config['timestamp'] . '"></script>';
}
$return .= "<script type=\"text/javascript\">
CKEDITOR.replace( '" . $module_data . "_" . $textareaname . "', {" . ( ! empty( $customtoolbar ) ? 'toolbar : "' . $customtoolbar . '",' : '' ) . " width: '" . $width . "',height: '" . $height . "',";
if( defined( 'NV_IS_ADMIN' ) )
{
if( empty( $path ) and empty( $currentpath ) )
{
$path = NV_UPLOADS_DIR;
$currentpath = NV_UPLOADS_DIR;
if( ! empty( $module_upload ) and file_exists( NV_UPLOADS_REAL_DIR . '/' . $module_upload . '/' . date( "Y_m" ) ) )
{
$currentpath = NV_UPLOADS_DIR . '/' . $module_upload . '/' . date( "Y_m" );
$path = NV_UPLOADS_DIR . '/' . $module_upload;
}
elseif( ! empty( $module_upload ) and file_exists( NV_UPLOADS_REAL_DIR . '/' . $module_upload ) )
{
$currentpath = NV_UPLOADS_DIR . '/' . $module_upload;
}
}
if( ! empty( $admin_info['allow_files_type'] ) )
{
$return .= "filebrowserUploadUrl: '" . NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&" . NV_OP_VARIABLE . "=upload&editor=ckeditor&path=" . $currentpath . "',";
}
if( in_array( 'images', $admin_info['allow_files_type'] ) )
{
$return .= "filebrowserImageUploadUrl: '" . NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&" . NV_OP_VARIABLE . "=upload&editor=ckeditor&path=" . $currentpath . "&type=image',";
}
if( in_array( 'flash', $admin_info['allow_files_type'] ) )
{
$return .= "filebrowserFlashUploadUrl: '" . NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&" . NV_OP_VARIABLE . "=upload&editor=ckeditor&path=" . $currentpath . "&type=flash',";
}
$return .= "filebrowserBrowseUrl: '" . NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&popup=1&path=" . $path . "¤tpath=" . $currentpath . "',
filebrowserImageBrowseUrl: '" . NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&popup=1&type=image&path=" . $path . "¤tpath=" . $currentpath . "',
filebrowserFlashBrowseUrl: '" . NV_BASE_SITEURL . NV_ADMINDIR . "/index.php?" . NV_NAME_VARIABLE . "=upload&popup=1&type=flash&path=" . $path . "¤tpath=" . $currentpath . "'
";
}
$return .= "});</script>";
return $return;
}
Tại dòng 26, $ckeditor_name = 'myckeditor';
thay giá trị myckeditor ứng với tên thư mục bạn đặt ở trên.
Trung tâm ứng dụng NukeViet
Ghi rõ nguồn khi sao chép thông tin từ website này.
Sử dụng CMS NukeViet, thiết kế bởi TDFOSS.,LTD