-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello Nico,
Marcelo N. Halpern wrote:
| Thanks Tarjei.
|
| It turns out that I did not have ImageMagick installed. the application
| was looking for '/usr/bin/convert' and it did not exist.
|
| The effect was not really what I expected: once I add an image through
| "image/upload", the image appears on the published article above the text.
|
| As far as the end users go, what is the easiest way of having them use
| images through htmlArea widget in midcom? In fact, I've just added 4 or
| 5 images to a page myself.. the process can become pretty tedious. Going
| back and forth between topic attachments and the article, copying and
| pasting attachment locations seems a bit much for the average user.
That's exactly the reason why we developep "Aegir image
pop-up integration" to HTMLArea. Basically, we use Aegir's
image pop-up to deal with the images. Here's how you can use it too:
- -Have Aegir 1.0.3 installed (all earlier versions must be patched)
- -Have a sitegrouped Aegir host ready (basically a host that uses
Aegir's style and root page inside the same sitegroup as your site is.
It should be prefixed "/aegir", if not change the JS script below
to accommodate the correct prefix.)
- -Insert the following stuff to a snippet-tree:
/sitegroup-config/midcom.helper.datamanager.widget_html/config
- -----
<?php
$nav = new
midcom_helper_nav($GLOBALS["view_contentmgr"]->viewdata["context"]);
$leafid = $nav->get_current_leaf();
$leaf = $nav->get_leaf($leafid);
$leaftrueid = explode('/',$leaf[MIDCOM_NAV_URL]);
$leaftrueid = $leaftrueid[1];
$siteprefix = $GLOBALS['midcom_site']['host']->prefix;
~ $result = <<<EOF
// FIELD {$this->_fieldname} HTMLAREA init script START
var {$this->_fieldname} = null;
function {$this->_fieldname}_init() {
~ if (!document.getElementById("{$this->_fieldname}")) {
~ return;
~ }
~ config = new HTMLArea.Config();
~ config.imgURL = "{$prefix['images']}";
~ config.popupURL = "{$prefix['htmlarea']}popups/";
~ config.bodyStyle = "background-color: #fff;";
~ config.statusBar = true;
~ config.formatblock = {
~ "Heading 2": "h2",
~ "Heading 3": "h3",
~ "Normal": "p",
~ "Formatted": "pre"
~ };
~ config.registerButton("insertimage2", "Add an image or an
attachment", "29eda1118f1e58028a3198e2a9c77271/ed_image.gif", false,
~ function(editor, id) {
~ chooser =
window.open("/aegir/rcs/image/popup/?type=article&id=$leaftrueid&htmlarea=Y&hostid=",
"chooser","height=450,width=400,modal=yes");
~ chooser.ifield = editor;
~ }
~ );
~ config.toolbar = [
~ [ "formatblock", "bold", "italic", "separator", "justifyleft",
"justifycenter", "justifyright", "separator",
~ "insertorderedlist", "insertunorderedlist", "outdent", "indent",
"separator",
~ "createlink", "insertimage2", "inserttable",
"htmlmode","popupeditor"]
~ ];
~ {$this->_customconfig}
~ {$this->_fieldname} = new HTMLArea("{$this->_fieldname}",config);
~ {$this->_fieldname}.registerPlugin("ContextMenu");
~ {$this->_fieldname}.registerPlugin("TableOperations");
~ {$this->_fieldname}.generate();
};
// FIELD {$this->_fieldname} HTMLAREA init script END
EOF;
?>
- -----
Also, feel free to re-configure your HTMLArea as you see fit.
Just keep the config.registerButton part intact.
Let me know if you need more instructions.
Cheers!
~ //Henri
| I think I might be taking the wrong approach - is there a better solution?
|
|
| thanks again
|
| Nico
|
| [EMAIL PROTECTED] wrote:
|
|> Hi,
|>
|>> I certainly have no issues using this method, but at some point down the
|>> line I will surrender some parts of the website to other people that do
|>> not know anything about how midgard works.
|>>
|>> I couldn't help but notice a 'Image' link on the bottom of the 'Edit
|>> Article' in midcom AIS. It doesn't seem to work, as files do not upload
|>> when I save the article.
|>
|>
|>
|>> Is there an 'easy' way of adding images to articles from midcom AIS? I'm
|>> pretty most of my end users will not be able to follow the steps above.
|>
|>
|> The image-upload should work. I'd guess you got problems with tempfile
|> handling.
|> Check your error-logs.
|> Tarjei
|>
|>>
|>> Thanks,
|>>
|>>
|>> Nico
|>>
|>>
|>>
|>> -- Marcelo N. Halpern, your favourite daemon.
|>> UNIX Systems Administrator - Ramapo College
|>> TEL: +1.201.684.6821 FAX: +1.201.684.7961
|>>
|>> ---------------------------------------------------------------------
|>> To unsubscribe, e-mail: [EMAIL PROTECTED]
|>> For additional commands, e-mail: [EMAIL PROTECTED]
|>>
|>>
|>
|>
|
- --
Henri Kaukola [EMAIL PROTECTED]
Consultant Tel: +358-20-198 6037
Nemein Oy http://www.nemein.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBsBiw3xWc2AolrKgRAhPbAKDjVHct/PDUqlBoANlTtmCAr+2kZQCeKrQQ
msMX3gGfwl9u9aY0cyYx5hw=
=ZJIF
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]