-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

- --- On 09.08.04 14:52 (+0200) Pascal Mayer wrote:

I have some questions about developing components for the MidCOM framework.

NAP: Is it possible to define "NAPs" for the Admin Site? The components I've installed display the navigational links for the administration of a component "inside the admin-screens". If not - do you have any plans for this feature?

NAP does distinguish between Admin- and Site-URLs. Either of the two can be NULL, indicating the inavailability of a given leaf in the corresponding mode. This is true only for leaves, not for nodes. A leafe retrival might look like this:


 16:     function get_leaves() {
 17:         $ret = Array();
 18:
 19:         $publications = mgd_list_topic_articles($this->_object->id, "score");
 20:         if ($publications) {
 21:             while ($publications->fetch()) {
 22:                 $article = mgd_get_article($publications->id);
 23:                 $ret[$article->id] = array (
 24:                      MIDCOM_NAV_SITE => Array (
 25:                          MIDCOM_NAV_URL => "pub/{$article->name}.html",
 26:                          MIDCOM_NAV_NAME => $article->title),
 27:                      MIDCOM_NAV_ADMIN => Array (
 28:                          MIDCOM_NAV_URL => "publication/view/{$article->id}.html",
 29:                          MIDCOM_NAV_NAME => $article->title),
 30:                      MIDCOM_NAV_VISIBLE => true,
 31:                      MIDCOM_META_CREATOR => $article->creator,
 32:                      MIDCOM_META_EDITOR => $article->revisor,
 33:                      MIDCOM_META_CREATED => $article->created,
 34:                      MIDCOM_META_EDITED => $article->revised
 35:                 );
 36:             }
 37:         }
 38:         return $ret;
 39:     }

The arrays in lines 24 and 27 respectivly may be set to null (don't set both to null...)


You might take a look into the snippet documentation fields of the snippets /midcom/helper/_basicnav and /midcom/helper/nav for further details.



User privileges: Are there any "default" MidCOM groups with
predefined access rights / access levels?

Not really. MidCOM currently is largly independant from authrization issues, which is on my todo list somwhere after the 1.4 release.


Components should look for a few things though:

* Check for topic ownership, and modify the user interface accordingly (no
  edit button if not owner, you can't write anyway)

* Look after the Aegir legacy "Power User" setting, presenting the
  full-fledged admin interface only for power users and site admins. (The
  parameter is described somewhere on the Midgard website.)


Error Handling: How should errors be set/reported/displayed.

MidCOM has a central HTTP error page creator, $midcom->generate_error. See the documentation in /midcom/application for the details. You can create errors that abort execution there, which is good for 404's or 500's. Non-Fatal warnings or notices are handled on a component level on-site, while in AIS you can use the content admin's processing message string, see /midcom/admin/content/main, variable $msg, which is automatically shown in AIS.



Live long and prosper! Torben Nehmer

- -- Torben Nehmer, Guenzburg, Bavaria, Germany
http://www.nathan-syntronics.de, mailto:[EMAIL PROTECTED]
PGP Public Key: https://www.link-m.de/pgp/t.nehmer.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Made with pgp4pine 1.76


iD8DBQFBF32oJPh4Kn6d5FYRAryoAKCftVCL71J2NI41/gDtecUn+nMz5ACglabH
JfMLJ9u3AubczC9ml3hAIO8=
=Vchg
-----END PGP SIGNATURE-----


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



Reply via email to