Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
||
ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
[18.191.218.130] |
|
Сообщ.
#1
,
|
|
|
У данного компанента есть функция (кнопка) вызова служебного окна вставки картинки.
Есть ли возможность вызова собственного окна и какие взаимосвязи или процессы необходимо выполнить? |
Сообщ.
#2
,
|
|
|
по RichEdit известно следующее
- класс описан в модуле comctrls.inc.php - сайт разработчиков с примерами и описанием здесь http://trac.xinha.org/wiki/Examples - файлы комронента после установки лежат здесь C:\Program Files\Embarcadero\RadPHP\3.0\rpcl\resources\xinha в примере http://xinha.raimundmeyer.de/x_examples/restricted.php видим вызов навороченного служебного окна вставки картинки а в исходнике виден такой код if (xinha_config.ExtendedFileManager) { with (xinha_config.ExtendedFileManager) { <?php // define backend configuration for the plugin $IMConfig = array(); // the directories have to be writeable for php (that means 777 under linux) $IMConfig['max_foldersize_mb'] = 10; $IMConfig['files_dir'] = $_SERVER['DOCUMENT_ROOT'].'x_examples/images'; $IMConfig['images_dir'] = $_SERVER['DOCUMENT_ROOT'].'x_examples/images'; $IMConfig['files_url'] = '/x_examples/images/'; $IMConfig['images_url'] = '/x_examples/images/'; $IMConfig['images_enable_styling'] = false; $IMConfig['max_filesize_kb_image'] = 200; // we can use the value 'max' to allow the maximium upload size defined in php_ini $IMConfig['max_filesize_kb_link'] = 'max'; $IMConfig['allowed_link_extensions'] = array("jpg","gif","js","pdf","zip","txt","psd","png","html","swf","xml","xls"); xinha_pass_to_php_backend($IMConfig); ?> } } ExtendedFileManager лежит в папке C:\Program Files\Embarcadero\RadPHP\3.0\rpcl\resources\xinha\plugins\ExtendedFileManager т.е. в плагинах (кстати, там много разных плагинов) ну вот сюда и копай как я понял из этого пользовательского описания http://trac.xinha.org/wiki/NewbieGuide можно создать свой конфигурационный файл и в нём описать внешний вид компонента так они подключают плагины xinha_plugins = xinha_plugins ? xinha_plugins : [ 'CharacterMap', 'ContextMenu', 'ListType', 'Stylist', 'Linker', 'SuperClean', 'TableOperations' ]; скорее всего что нужно скопировать папку плагина ExtendedFileManager в другую. например ExtendedFileManagerPlus и подредактировать его после чего добавить его вызов в конфиг файл |
Сообщ.
#3
,
|
|
|
В модуле comctrls.inc.php при описании CustomRichEdit
function dumpHeaderCode() //... xinha_init = xinha_init ? xinha_init : function() { xinha_editors = null; xinha_config = null; xinha_plugins = null; xinha_plugins = xinha_plugins ? xinha_plugins : []; //... меняю на xinha_plugins = xinha_plugins ? xinha_plugins : ['ImageManager']; плагин вызывается. Подскажите, как добраться до методов xinha, чтобы можно было изменять плагины не меня его в comctrls.inc.php |
Сообщ.
#4
,
|
|
|
HTML (часть head) - который формируется
<script type="text/javascript"> _editor_url = "/rpcl-bin/resources/xinha/"; _editor_lang = "en"; // And the language we need to use in the editor. </script> <script type="text/javascript" src="/rpcl-bin/resources/xinha/htmlarea.js"></script> <script type="text/javascript"> var RichEdit1_previous_load = null; var RichEdit1_html_editor = null; xinha_init = null; // This contains the names of textareas we will make into Xinha editors xinha_init = xinha_init ? xinha_init : function() { xinha_editors = null; xinha_config = null; xinha_plugins = null; xinha_plugins = xinha_plugins ? xinha_plugins : []; if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return; xinha_editors = xinha_editors ? xinha_editors : ['RichEdit1']; xinha_config = xinha_config ? xinha_config : new HTMLArea.Config(); xinha_config.pageStyle = 'body { font-family: Tahoma; font-size: 11px; }'; xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins); RichEdit1_html_editor = xinha_editors['RichEdit1']; // xinha_editors.RichEdit1.config.width = 544; // xinha_editors.RichEdit1.config.height = 270; HTMLArea.startEditors(xinha_editors); if (RichEdit1_previous_load!=null) RichEdit1_previous_load(); } RichEdit1_previous_load=window.onload; window.onload = xinha_init; function updateEditor_RichEdit1() { var html_editor = RichEdit1_html_editor; HTMLArea._addEvent(html_editor._htmlArea, "mouseout", function () { html_editor._textArea.value = html_editor.getHTML(); }); } </script> <script type="text/javascript"> // allow enough time to load the page; see public variable to change the time setTimeout("updateEditor_RichEdit1()", 5000); </script> </head> |
Сообщ.
#5
,
|
|
|
Цитата nstur @ Подскажите, как добраться до методов xinha, чтобы можно было изменять плагины не меня его в comctrls.inc.php наверное написать свой компонент где эти методы будут доступы или в данном случае просто переопредели процедуру dumpHeaderCode() в коде своего модуля |
Сообщ.
#6
,
|
|
|
Пока добился результата другим способом.
Удалил все RichEdit и вместо них установил Memo У меня два Memo: DESCR1 и CONTACT Хочу сразу заметить, что пути прописаны для работы на сайте (локально нужно с cлешами поработать) Да и внутренние ошибки в локальном варианте проявляются. onShowHeader - формы function frm_client_mainShowHeader($sender, $params) { echo ' <script type="text/javascript"> // eg: _editor_url = "/path/to/xinha/"; // You may try a relative URL if you wish] // eg: _editor_url = "'.$_SERVER['DOCUMENT_ROOT'].'/rpcl/resources/xinha/"; _editor_url = "/rpcl/resources/xinha/" _editor_lang = "en"; // ru - будет по русски, но в плагинах нужно создать файлы ru.js иначе плагин на сайте работать не будет </script> <script type="text/javascript" src="/rpcl/resources/xinha/XinhaCore.js"> </script> <script type="text/javascript" src="restricted_config.php"> </script>'; } restricted_config.php <?php header("Content-type: text/javascript"); ?> xinha_editors = null; xinha_init = null; xinha_config = null; xinha_plugins = null; xinha_init = xinha_init ? xinha_init : function() { xinha_plugins = xinha_plugins ? xinha_plugins : [ 'DoubleClick', 'ExtendedFileManager', 'Linker', 'CharacterMap', 'ContextMenu', 'ListType', 'Stylist', 'SuperClean', 'TableOperations' ]; // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :) if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return; xinha_editors = xinha_editors ? xinha_editors : [ 'DESCR1','CONTACT' ]; xinha_config = xinha_config ? xinha_config : new Xinha.Config(); xinha_config.toolbar = [ ["popupeditor"], ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"], ["separator","forecolor","hilitecolor","textindicator"], ["separator","subscript","superscript"], ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"], ["separator","insertorderedlist","insertunorderedlist","outdent","indent"], ["separator","inserthorizontalrule","createlink","insertimage","inserttable"], ["linebreak","separator","undo","redo","selectall","print"], (Xinha.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]), ["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright", "righttoleft"], ["separator","htmlmode","showhelp"] ]; //["popupeditor","separator","formatblock","bold","italic","separator","createlink","insertimage","about"] xinha_config.formatblock = { "— format —" : "", "Heading 2": "h2", "Normal" : "p" }; xinha_config.showLoading = true; xinha_config.statusBar = false; xinha_config.stripBaseHref = true; xinha_config.baseHref = "<?php print 'http://'. $_SERVER['SERVER_NAME'] ?>"; <?php require_once 'rpcl/resources/xinha/contrib/php-xinha.php'; ?> if (xinha_config.Linker) { with(xinha_config.Linker) { <?php xinha_pass_to_php_backend ( array( 'dir' => '/client/images/', //$_SERVER['DOCUMENT_ROOT']. 'include' => '/\.(php|shtml|html|htm|shtm|cgi|txt|doc|pdf|rtf|xls|csv)$/', // Regex or null 'exclude' => null, // Regex or null 'dirinclude' => null, // Regex or null 'direxclude' => null // Regex or null ) ); ?> } } xinha_config.ExtendedFileManager.use_linker = true; if (xinha_config.ExtendedFileManager) { with (xinha_config.ExtendedFileManager) { <?php // define backend configuration for the plugin $IMConfig = array(); // the directories have to be writeable for php (that means 777 under linux) $IMConfig['max_foldersize_mb'] = 10; $IMConfig['files_dir'] = $_SERVER['DOCUMENT_ROOT'].'/client/images'; //$_SERVER['DOCUMENT_ROOT']. $IMConfig['images_dir'] = $_SERVER['DOCUMENT_ROOT'].'/client/images'; //$_SERVER['DOCUMENT_ROOT']. $IMConfig['files_url'] = '/client/images/'; $IMConfig['images_url'] = '/client/images/'; $IMConfig['images_enable_styling'] = false; $IMConfig['max_filesize_kb_image'] = 200; // we can use the value 'max' to allow the maximium upload size defined in php_ini $IMConfig['max_filesize_kb_link'] = 'max'; $IMConfig['allowed_link_extensions'] = array("jpg","gif","js","pdf","zip","txt","psd","png","html","swf","xml","xls"); xinha_pass_to_php_backend($IMConfig); ?> } } xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); Xinha.startEditors(xinha_editors); } Xinha._addEvent(window,"load",xinha_init); Да согласен передрал у других, но адаптировал для RadPHP |
Сообщ.
#7
,
|
|
|
Кто знает? Есть ли возможность вызывать тотже ExtendedFileManager, не используя Memo, а к примеру по нажатию Button?
|
Сообщ.
#8
,
|
|
|
вставь в JS вызов страницы которая открывается из мемо
например http://xinha.raimundmeyer.de/latest/plugins/ExtendedFileManager/backend.php?__plugin=ExtendedFileManager&__function=manager&backend_data[data]=a%3A9%3A%7Bs%3A17%3A%22max_foldersize_mb%22%3Bi%3A10%3Bs%3A9%3A%22files_dir%22%3Bs%3A38%3A%22%2Fwww%2Fhtdocs%2Fw007ec76%2Fx_examples%2Fimages%22%3Bs%3A10%3A%22images_dir%22%3Bs%3A38%3A%22%2Fwww%2Fhtdocs%2Fw007ec76%2Fx_examples%2Fimages%22%3Bs%3A9%3A%22files_url%22%3Bs%3A19%3A%22%2Fx_examples%2Fimages%2F%22%3Bs%3A10%3A%22images_url%22%3Bs%3A19%3A%22%2Fx_examples%2Fimages%2F%22%3Bs%3A21%3A%22images_enable_styling%22%3Bb%3A0%3Bs%3A21%3A%22max_filesize_kb_image%22%3Bi%3A200%3Bs%3A20%3A%22max_filesize_kb_link%22%3Bs%3A3%3A%22max%22%3Bs%3A23%3A%22allowed_link_extensions%22%3Ba%3A12%3A%7Bi%3A0%3Bs%3A3%3A%22jpg%22%3Bi%3A1%3Bs%3A3%3A%22gif%22%3Bi%3A2%3Bs%3A2%3A%22js%22%3Bi%3A3%3Bs%3A3%3A%22pdf%22%3Bi%3A4%3Bs%3A3%3A%22zip%22%3Bi%3A5%3Bs%3A3%3A%22txt%22%3Bi%3A6%3Bs%3A3%3A%22psd%22%3Bi%3A7%3Bs%3A3%3A%22png%22%3Bi%3A8%3Bs%3A4%3A%22html%22%3Bi%3A9%3Bs%3A3%3A%22swf%22%3Bi%3A10%3Bs%3A3%3A%22xml%22%3Bi%3A11%3Bs%3A3%3A%22xls%22%3B%7D%7D&backend_data[session_name]=PHPSESSID&backend_data[key_location]=Xinha%3ABackendKey&backend_data[hash]=ea27d2771fb86785571571f5a535e7878b459023&PHPSESSID=34b55ea5d214c8e4b805cadcd5b193da |
Сообщ.
#9
,
|
|
|
Простым вызовом здесь не обойдешься. Пока не знаю как, но вся эта библиотека крутится около textArea (Memo).
Пока не инициализируешь Xinha, нормально работать не будет. xinha_editors=null; xinha_init=null; xinha_config=null; xinha_plugins=null; xinha_init = xinha_init ? xinha_init : function() { ......... xinha_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins); Xinha.startEditors(xinha_editors); } Xinha._addEvent(window,"load",xinha_init); А как это обойти?.. Пока разбирался с формированием строки адреса, получилось: require_once 'rpcl/resources/xinha/contrib/php-xinha.php'; // define backend configuration for the plugin $IMConfig = array(); // the directories have to be writeable for php (that means 777 under linux) $IMConfig['max_foldersize_mb'] = 2; //$_GET['max_foldersize_mb']; //2; $IMConfig['files_dir'] = $_SERVER['DOCUMENT_ROOT'].'images/';//'/'.$_GET['path']; //'client/images'; //$_SERVER['DOCUMENT_ROOT']. $IMConfig['images_dir'] = $_SERVER['DOCUMENT_ROOT'].'images/';//'/'.$_GET['path']; //'client/images'; //$_SERVER['DOCUMENT_ROOT']. $IMConfig['files_url'] = '/images/';//'/'.$_GET['path']; //client/images/'; $IMConfig['images_url'] = '/images/';//'/'.$_GET['path']; //client/images/'; $IMConfig['images_enable_styling'] = false; $IMConfig['max_filesize_kb_image'] = 200; // we can use the value 'max' to allow the maximium upload size defined in php_ini $IMConfig['max_filesize_kb_link'] = 'max'; $IMConfig['allowed_link_extensions'] = array("jpg","gif","pdf","zip","txt","psd","png","html","swf","xml","xls"); //,"js" $IMConfig['thumbnail_dir'] = ''; $BE = xinha_pass_to_php_backend($IMConfig,'Xinha:BackendKey', true); //$tempstr = print_r($BE, true); //$implodestr = implode('&', $BE['backend_data']); $url = ''; $BE1 = $BE['backend_data']; reset($BE1); foreach($BE1 as $k => $v) { $url .= '&'.$k.'='.urlencode($v); } header("Location: /rpcl-bin/resources/xinha/plugins/ExtendedFileManager/backend.php?__plugin=ExtendedFileManager&__function=manager&mode=link".$url); rpcl-bin и rpcl - это пока локально используешь, приходится подгонять Да и echo ('<script type="text/javascript"> _editor_url = "/rpcl-bin/resources/xinha/" _editor_lang = "ru"; // And the language we need to use in the editor. </script> '); Добавлено Может, как специалисты, подскажете, какой Файл менеджер или Эксплорер можно/лучше использовать? |
Сообщ.
#10
,
|
|
|
Цитата nstur @ Простым вызовом здесь не обойдешься. это понятно что бы тебе что то подсказывать нужно вникать в задачу. а задача непонятна зачем ты всё это делаеш... нужно понятнее задачу описывать вот смотри ты пишеш: Цитата vicis @ Может, как специалисты, подскажете, какой Файл менеджер или Эксплорер можно/лучше использовать? для чего использовать ? чтот ты имел ввиду ? ту задачу что решаеш или ftp клиент а может и не ftp, а какой то другой ?.... |
Сообщ.
#11
,
|
|
|
Задача такова... Сообщение #7
У меня есть поля, для которых нужен простой выбор картинки. По принципу нажал на кнопку, выбрал картинку, получил ее Filename. Для улучшения сервиса программы, неплохо для пользователя, еще и выгрузить(загрузить) картинку на сайт, перед тем как ее выбрать. Постановка проблемы заключаеся в том, что на сайте хочется видить одинаковый интерфейс. Поэтому я и задался проблемой использовать все тотже Xinha ExtendedFileManager. Но если задачу решить, пока, не получается, хотелось бы использовать уже готовый вариант другого File Manager. |
Сообщ.
#12
,
|
|
|
Цитата nstur @ У меня есть поля, для которых нужен простой выбор картинки. По принципу нажал на кнопку, выбрал картинку, получил ее Filename. ну вот опять... где картинки то находятся ? всегда пиши подробно! 1. если нужно закинуть картинку на сайт в нужную папку, то чем компонент Upload не подходит ? Посмотри его в примерах Вот есть ещё немного по нему информации (UPLOAD) - закачать файл на сервер в нужную папку относительно корня сайта function Button1Click($sender, $params) { $this->Memo1->AddLine ( 'FileTmpName: ' . $this->Upload1->FileTmpName); $this->Memo1->AddLine ( 'FileName: ' . $this->Upload1->FileName); $this->Memo1->AddLine ( 'FileSize: ' . $this->Upload1->FileSize); $this->Memo1->AddLine ( 'FileType: ' . $this->Upload1->FileType); $this->Memo1->AddLine ( 'FileSubType : ' . $this->Upload1->FileSubType); $this->Memo1->AddLine ( 'GraphicWidth: ' . $this->Upload1->GraphicWidth); $this->Memo1->AddLine ( 'GraphicHeihgt: ' . $this->Upload1->GraphicHeight); if($this->Upload1->isGIF()) $tmp = ' is gif'; if($this->Upload1->isJPEG()) $tmp = ' is jpeg'; if($this->Upload1->isPNG()) $tmp = ' is png'; $this->Memo1->AddLine ( 'File Ext: ' . $this->Upload1->FileExt . $tmp); // закачиваем и перемещаем из временного директория в указанный директорий $this->Upload1->moveUploadedFile($_SERVER["DOCUMENT_ROOT"].'\file_upload\\'.$this->Upload1->FileName); } 2. Если нужно выбирать изображения уже загруженные на сайт то просто список файлов в директории фнкцией на php, и загоняеш в Image путь Например, такой компонент можно использовать aListDir возможно чуть доточить придётся для фильтрации по маске |