In listcontent.php:
CUT
Code: Select all
if ($modifyall)
{
#Figure out some variables real quick
$depth = count(split('\.', $one->Hierarchy()));
$item_order = substr($one->Hierarchy(), strrpos($one->Hierarchy(), '.'));
if ($item_order == '')
{
$item_order = $one->Hierarchy();
}
#Remove any rogue dots
$item_order = trim($item_order, ".");
$num_same_level = 0;
#TODO: Handle depth correctly yet
foreach ($content_array as $another)
{
#Are they the same level?
if (count(split('\.', $another->Hierarchy())) == $depth)
{
#Make sure it's not top level
if (count(split('\.', $another->Hierarchy())) > 1)
{
#So only pages with the same parents count
if (substr($another->Hierarchy(), 0, strrpos($another->Hierarchy(), '.')) == substr($one->Hierarchy(), 0, strrpos($another->Hierarchy(), '.')))
{
$num_same_level++;
}
}
else
{
#It's top level, just increase the count
$num_same_level++;
}
}
}
Code: Select all
foreach ($content_array as $one)
{
Code: Select all
echo "<td><a href=\"editcontent.php?content_id=".$one->Id()."\">".$one->Name()."</a></td>\n";
Code: Select all
//Begin Custom Code
echo "<td>";
for($i = 1; $i < $depth; $i++) {
echo "- ";
}
echo "<a href=\"editcontent.php?content_id=".$one->Id()."\">".$one->Name()."</a></td>\n";
//End Custom Code
You can also download the attached listcontent.txt and just replace it with yours... change the extention to php!
I worked for a long time trying to make a collapsable menu like {startCollapseMenu} plugin (starts showing only top-level pages, then click and it expands... same for all levels of hierarchy ), but it seems that you can't collapse between tags, and I would have to rewrite the structure of the page completely. Also I can't seem to find a function to see if a page has a child or not, so I was making every single page expandable... even ones with nothing under it.
Hopefully there will be an expandable menu in a future version.
[attachment deleted by admin]