[dev] Two suggestions about the IMP summary
Etienne Goyer
etienne.goyer at linuxquebec.com
Tue Sep 23 07:10:35 PDT 2003
Thank you so much Jan for pointing it out. It may seem obvious, but I
have been banging my head on the subject for quite a while. For those
interested, I included my stupid little email-displaying block and a patch
to registry.php that make it work.
On Tue, Sep 23, 2003 at 12:10:46AM +0200, Jan Schneider wrote:
> Zitat von Etienne Goyer <etienne.goyer at linuxquebec.com>:
>
> > On Mon, Sep 22, 2003 at 11:35:55PM +0200, Jan Schneider wrote:
> > > The portal has always been build from Horde_Blocks so you could always
> > add
> > > your own blocks.
> >
> > Reading portal.php, line 67 :
> >
> > $block = $registry->callByPackage($item['app'], 'block',
> > $item['params']);
> > ^^^^^^^^^^^^
> > lead me to believe that block are a by-app thing. Maybe I am just
> > misreading the code. If not, how to create one ? Do they have to be
> > defined in some config file, or I just write the code in
> > <app>/lib/Block/ and it will automagically appear ?
>
> Not (yet) automagically. You have to add an "applet" entry to registry.php.
>
> Jan.
>
> --
> http://www.horde.org - The Horde Project
> http://www.ammma.de - discover your knowledge
> http://www.tip4all.de - Deine private Tippgemeinschaft
>
> --
> Horde developers mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: dev-unsubscribe at lists.horde.org
--
Etienne Goyer Linux Québec Technologies Inc.
http://www.LinuxQuebec.com etienne.goyer at linuxquebec.com
-------------- next part --------------
--- config/registry.php.dist.orig Tue Sep 23 10:06:22 2003
+++ config/registry.php.dist Tue Sep 23 10:06:46 2003
@@ -579,3 +579,8 @@
'type' => 'iframe',
'default' => 'http://slashdot.org/'
);
+
+$this->applets['email'] = array(
+ 'name' => 'Email',
+ 'type' => 'email'
+);
-------------- next part --------------
<?php
/**
* $Id$
*
* @package Horde
*/
class Horde_Block_email extends Horde_Block {
/**
* Constructor.
*/
function Horde_Block_email($params = array())
{
$this->_params = $params;
$this->_app = 'horde';
$this->_type = 'email';
}
/**
* Does this block have any user editable parameters?
*
* @return boolean True is there are editable parameters.
* False if there are not.
*/
function isEditable()
{
return false;
}
/**
* The title to go in this block.
*
* @return string The title text.
*/
function _title()
{
return _("Your email address");
}
/**
* The content to go in this block.
*
* @return string The content
*/
function _content()
{
global $prefs;
return $prefs->getValue('from_addr');
}
}
More information about the dev
mailing list