-
- 674 Posts
//from etomite ShowChilds
//usage
//You can list childrens of actual Document Folder by [[ShowChilds]]
//or content of Documen Folder you choose by [[ShowChilds?pid=12]].
//Change 12 to you choosed directory id.
//Now you can add ’order’ to your list by
//[[ShowChilds?order=description]]
//or [[ShowChilds?pid=12&order=pagetitle]]
//Change ’pagetitle’ to choosed field of DocumentObject.
//language text of the button cange if you want
$textbutton = "ir...";
if(!isset($pid) || $pid == ’’) {
$pid = $etomite->documentIdentifier; //current document
}
// list order by specified field
if(!isset($order) || $order == ’’) $order=’menuindex’;
// get childrens, and show some info when no childrens founds
$children = $etomite->getActiveChildren($pid, $order);
if($children == false) return ’<blockquote>No position to show</blockquote>’;
// close list in div (optional, you can change it, whatever)
$childrenCount = count($children);
// lists all childrens as links
for($x=0; $x<$childrenCount; $x++) {
$menudrop .="<option value=’’ >".$children[$x][’description’]."</option>";
$menuaction .= "’[~".$children[$x][’id’]."~]’";
}
$menu .= ’<form name="form1" method="post" action=’.$menuaction.’>’;
$menu .= ’<select name="select">’.$menudrop.’</select>’;
$menu .= ’<input type="submit" name="sub" value=’.$textbutton.’ />’;
$menu .= ’</form>’;
return $menu;
-
- 1,084 Posts
//[[DropDownMenu?pid=1&order=pagetitle]]
if(!isset($pid) || $pid == ’’)
{
$pid = $etomite->documentIdentifier; //current document
}
//current document
$currrrent = $etomite->getDocument($pid,’pagetitle’);
// list order by specified field
if(!isset($order) || $order == ’’) $order=’menuindex’;
// get childrens, and show some info when no childrens founds
$children = $etomite->getActiveChildren($pid, $order);
if($children == false) return ’<blockquote>No position to show</blockquote>’;
// close list in div (optional, you can change it, whatever)
$childrenCount = count($children);
// lists all childrens as links
for($x=0; $x<$childrenCount; $x++) {
$menudrop .= "<option value=";
$menudrop .= "’[~".$children[$x][’id’]."~]’";
$menudrop .= ">".$children[$x][’pagetitle’]."</option>";
}
$menu .= "<form name=\"form1\" method=\"post\" action=\"\">";
$menu .= "<select name=\"select\" onChange=\"location=this.options[this.selectedIndex].value\">";
$menu .= "<OPTION value=\"0\">---<b>".$currrrent[’pagetitle’]."</b>---</OPTION>".$menudrop."</select>";
$menu .= "</form>";
return $menu;