[pmwiki-users] Hierarchical groups link notation...

Sivakatirswami katir at hindu.org
Wed Jan 31 14:23:31 CST 2007


Dan:

Not a lot of responses on this HG initiative, which surprises me...

Although I can see that if the permission issue is not solved
that could be a stone wall for moving forward. Our small
team collaborative wiki is small enough where I can
manage  to add permissions to new subgroups, but
even  with our small team, if we allow users who have access
to a particular group-hierarchy and then give them privileges
to create new sub-groups, if those new subgroups do
not get  the same permissions, we have a (obvious) problem...

I would have to limit new subgroup creation to admin...
which would be "painful."

At any rate. I'm cheering you on and praying for your
  success as I will put everything you have  done  to work.

I'm wanting to  merge a couple of fields on a farm into
a single wiki and this HG solution is really the only solution
for making such a merger work.

Do the following PhP  functions  provide a solution for the pagelist of
subgroups?
Or are we still stuck with manual additions of subgroups  to some
source data page?

Thanks for all the time you are putting into this!

Sivakatirswami


The Editor wrote:
> I have put together two notations for the hg system I'm tinkering
> with, which look almost the same, but one provides absolute links, and
> the other relative links. Both work exactly as intended.
> 
> However, I was wondering if anyone would care to try and combine these
> two into one markup as they are both very similar.  I'm just not
> exactly sure how to do it...
> 
> Markup('[[*','<var','/\\[\\[([\\*]+)(.*?)\\]\\]/e', 'hgabslinks("$1","$2")');
> function hgabslinks($x,$y) {
> 	global $pagename;
> 	$subgroup = FmtPageName('$Group', $pagename);
> 	$subgroupsabs = explode("-", $subgroup);
> 	$xx = strlen($x);
> 	$i = 0;
> 	while ($i < $xx) {
> 		$link = $link . $subgroupsabs[$i] . "-";
> 		$i = $i + 1;
> 		}
> 	$link = substr ($link, 0, -1);
> 	return "[[$link$y]]";
> 	}
> 
> Markup('[[^','<var','/\\[\\[([\\^]+)(.*?)\\]\\]/e', 'hgrellinks("$1","$2")');
> function hgrellinks($x,$y) {
> 	global $pagename;
> 	$subgroup = FmtPageName('$Group', $pagename);
> 	$subgroupsrel = explode("-", $subgroup);
> 	$xx = strlen($x);
> 	$i = 0;
> 	while ($i < $xx) {
> 		array_pop($subgroupsrel);
> 		$i = $i + 1;
> 		}
> 	$link = implode("-", $subgroupsrel);
> 	return "[[$link$y]]";
> 	}
> 
> Cheers,
> Dan
> 
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
> 




More information about the pmwiki-users mailing list