Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
6 - 5 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: A typo and a request about blockinstance
by GIJOE on 2005/8/10 20:01:39

hi skalpa.

Thanks for your reply.
Quote:
We'll see this as soon as possible. And I like the title idea too, I'll see what can be done (maybe even visibility would be nice if possible).


It's a nice idea to controlling visibility by show_func().

But show_func can hide itself only by returning array() even in 2.0.13 or 2.2.1


Block's show_func

- can refer
---- its `instanceid`
---- its original `title` (eg. "events in %s")

- can change
---- its `title` (eg. "events in 26 Aug 2005")
---- its visibility
Re: A typo and a request about blockinstance
by skalpa on 2005/8/10 16:22:25

Thank you.

We'll see this as soon as possible. And I like the title idea too, I'll see what can be done (maybe even visibility would be nice if possible).

skalpa.>
A typo and a request about blockinstance
by GIJOE on 2005/8/10 9:31:02

hi.

It is good idea to divide blockinstance from newblocks.

And it is good idea too, to assign not only `title` and `content` but also `id`(=instanceid),`typeid`(=bid),`weight`.

But typeid(=bid) is never assigned in XOOPS 2.2.1.

This is a typo in end of kernel/blockinstance.php
le="color: #000000"><?php while ( $myrow = $this->db->fetchArray($result) ) { $newblock = false; if (!isset($blocks[$myrow['bid']])) { $blocks[$myrow['bid']] =& $block_handler->create(false); $newblock = true; } $instance =& $this->create(false); $instance_vars = array_keys($instance->getVars()); foreach ($myrow as $key => $value) { if ($newblock && !in_array($key, $instance_vars)) { $blocks[$myrow['bid']]->assignVar($key, $value); } else { $instance->assignVar($key, $value); } } [color=ff0000] $blocks[$myrow['bid']]->assignVar('bid', $myrow['bid']); [/color] $instance->setBlock($blocks[$myrow['bid']]); $ret[] = $instance; unset($instance); } } return $ret; } }

The key -bid- should be registered in both $instance and $blocks[].

And this is the main issue.
Some blocks (eg. minical_ex in piCal) have to know their instanceid. (`bid` in 2.0.x)

In 2.0.x, I used $GLOBALS['block_arr'][$GLOBALS['i']]->getVar('bid') .
But in 2.2, it is useless.

Please implement some way for blocks to know instanceid of themselves.

eg) kernel/blockinstance.php line 109
from:
le="color: #000000"><?php $block = $show_func($options);

to:
le="color: #000000"><?php $block = $show_func($options+array('instanceid'=>$this->getVar('instanceid')));


The block can know its instanceid by $options['instanceid'].

This is MUST feature to modify my modules as fully compatible with XOOPS 2.2.

I'm glad if you also implement some way for show_func to change block's title dynamically.

Regards!

Who's Online

839 user(s) are online (664 user(s) are browsing Support Forums)


Members: 0


Guests: 839


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits