On Thu, 2004-05-06 at 11:10, Shaun Murray wrote:
> Is there an accepted way in which I can add a content variable on
> upgrading a module?
>
> I've split the announce module so that it's got three now instead of
> two so that the list of current announcements on the home page can be
> in a different box to the announcement.
>
> Before it was
>
> CNT_announce
> CNT_announce_past
>
> I added
>
> CNT_announce_current
>
>
> But, unless I uninstall/reinstall the module, loosing all content, the
> variables in conf/layout.php I've added don't get into the mod_layout
> table. I can see where in Boost it adds the content variables to the
> layout table but was wondering if there was an easy way of including
> that mechanisim in the module's update.php
Here is one thing you can try. In update.php put this:
if($currentVersion < "_version_upgrading_to_") {
$sql = "DELETE FROM mod_layout_box WHERE mod_title='_your_module_'";
$GLOBALS['core']->query($sql, true);
$_SESSION['OBJ_layout']->installModule("_your_module_");
}
That should do it.
--
Steven
|