Hi, all 
> It is possible to use Aegir's image upload popup with the
> "Edit this page" interface in MidCOM. For this, Aegir 1.0.2
> or 1.0.3 beta is required.

Thanks for the Howto, some notes:

a) You need to rm the ~'s.
b) I had to comment out the line 
{$this->_fieldname}.registerPlugin("TableOperations");

like this:
//{$this->_fieldname}.registerPlugin("TableOperations");

c) You have to be logged into Aegir before logging into Midcom. I'm
considering to do a port of the popup to midcom so this may be solved. 

Tarjei

> * You have a MidCOM site running at http://www.mysite.com/
> ~  -> Note: CVS MidCOM required
> 
> * Create a *sitegrouped* Aegir host to http://www.mysite.com/aegir/
> ~  -> This is to enable Aegir and the MidCOM powered website to
> ~     share authentication information
> 
> * Create a custom HTMLAREA configuration file to snippet
> ~  /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];
> 
> ~        $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 = false;
> ~    config.formatblock = {
> ~        "Heading 2": "h2",
> ~        "Heading 3": "h3",
> ~        "Normal": "p",
> ~        "Formatted": "pre"
> ~    };
> 
> ~    config.registerButton("insertimage2", "Insert image or 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=450
> ,modal=yes");
> ~        chooser.ifield = editor;
> 
> ~      }
> ~    );
> 
> ~    config.toolbar = [
> 
> [ "formatblock", "undo", "redo", "bold", "italic", "underline",
> "superscript", "
> separator",
> ~      "justifyleft", "justifycenter", "justifyright", "separator",
> ~      "insertorderedlist", "insertunorderedlist", "outdent", "indent",
> "separato
> r",
> ~      "inserthorizontalrule", "createlink", "insertimage2",
> "inserttable", "popu
> peditor"]
> ~    ];
> 
> ~    {$this->_customconfig}
> ~    {$this->_fieldname} = new HTMLArea("{$this->_fieldname}",config);
> ~    {$this->_fieldname}.registerPlugin("TableOperations");
> ~    {$this->_fieldname}.generate();
> };
> 
> // FIELD {$this->_fieldname} HTMLAREA init script END
> 
> EOF;
> ?>
> 
> 
> /Bergie
> 
> 
> - --
> Henri Bergius                           [EMAIL PROTECTED]
> Consultant Partner                      Tel: +358-20-198 6032
> Nemein Oy                               http://www.nemein.com/
> 
> --BEGIN PGP SIGNATURE--
> Version: GnuPG v1.2.4 (Darwin)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFAVaP3NkT8k497k9IRAto6AJ93fLW/287d5i6oJhwSVGI0TD43KACbBEXm
> j84hjVcg300wSD6IhkFzETA=
> =kE4i
> --END PGP SIGNATURE--
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to