管理者から画像をアップロードしたいカスタムコンポーネントを作成しようとしています。画像をアップロードするために、メディアマネージャーモーダルを使用したいのですが、テキストボックスに画像のURLが返されるはずです。私はpopup-imagemanager.jsに以下の変更を加えました:
this.editor = decodeURIComponent(q.get('e_name')); //after this
//I added
this.return_url = decodeURIComponent(q.get('return_url'));
と
//window.parent.jInsertEditorText(tag, this.editor);
//removed above line and added the following
if ( this.return_url == 1 )
{
window.parent.document.getElementById(this.editor).value=url;
}
else
{
window.parent.jInsertEditorText(tag, this.editor);
}
私のフォームのコードは次のとおりです。
<input class="text_area" type="text" name="imageurl" id="imageurl" size="50" maxlength="250" value="<?php echo $this->image->image;?>" />
<div class="button2-left">
<div class="image">
<a rel="{handler: 'iframe', size: {x: 570, y: 400}}" href="index.php? option=com_media&view=images&tmpl=component&e_name=imageurl&return_url=1"
title="Image" class="modal-button">Select</a>
</div>
</div>
モーダルで画像を選択した後に挿入ボタンをクリックすると、エラーが発生します:
window.parent.document.getElementById(this.editor)はnullです
私はそれを探しましたが、それを解決することができませんでした。plsは私に何をすべきか教えてくれます。Thnx