|
Cookbook /
Talk page for Cookbook.MarkletsComments for v.0.9.2Here's my Categories function:
function MyMarkletCategories($pn) {
global $MarkletCategories;
$cats = array();
if (sizeof((array)$MarkletCategories)
&& $MarkletCategories[0] !='')
{
foreach((array)$MarkletCategories as $c) $cats[] = $c;
}
else {
# list the normal pages in the group
$group=preg_replace('/[\\/.].*$/','',$pn);
$pages = ListPages("/^$group.*/");
foreach ($pages as $p) {
if (!preg_match("/(GroupHeader|GroupFooter|Template$|SideBar|RecentChanges)/", $p)) {
list(, $c) = MarkletSplitPagename($p);
if ($c != '') $cats[] = $c;
}
}
}
sort($cats);
return $cats;
}
-- Kathryn Andersen August 04, 2006, at 09:40 PM Comments for v.0.9.1
string. I changed a variable name everywhere but the key.BenWilson August 04, 2006, at 12:40 AM
I'm using Markups to allow the admin to toggle them at will. BenWilson August 04, 2006, at 12:40 AM
duplicate effort. BenWilson August 04, 2006, at 12:40 AM
method to be overridden by a master category array. This will allow the site-admin to code their own behavior, or statically add their own categories (thus limiting browser-based additions. BenWilson August 04, 2006, at 12:40 AM Comments for v.0.9
|