| 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! |