19 include_once (
"GENERIC/generic_util.php");
28 if (
$action->Read(
"navigator",
"") ==
"EXPLORER") {
30 $action->lay->set(
"positionstyle",
"");
31 $action->lay->set(
"fhelp",
"_blank");
33 $action->lay->set(
"positionstyle",
"fixed");
34 $action->lay->set(
"fhelp",
"fhidden");
37 $dbaccess =
$action->GetParam(
"FREEDOM_DB");
43 if ($catg > 1) $fld =
new_Doc($dbaccess, $catg);
44 else $fld =
new_Doc($dbaccess, $dirid);
48 if ($fld->isAlive()) {
49 $sfamid = $fld->getValue(
"se_famid");
50 if ($sfamid && $sfamid !=
$fdoc->id) {
51 $sfdoc =
new_Doc($dbaccess, $sfamid);
52 if (!$sfdoc->isAlive()) {
59 $action->lay->set(
"pds", $fld->urlWhatEncodeSpec(
""));
60 if ((
$fdoc->control(
"create") ==
"") && (
$fdoc->control(
"icreate") ==
"")) {
62 "title" =>
$fdoc->getTitle() ,
65 }
else $child = array();
68 if (!$onlyonefam) $child+=
$fdoc->GetChildFam(
$fdoc->id,
true);
72 foreach ($child as $k => $vid) {
75 "subfam" => $vid[
"id"]
77 $tnewmenu[] =
"newdoc" . $k;
79 $action->lay->SetBlockData(
"NEWFAM", $tchild);
81 $action->lay->Set(
"dcreate", (count($tchild) > 0) ?
"" :
"none");
82 $action->lay->Set(
"cancreate", (count($tchild) > 0));
89 include_once (
"FDL/popup_util.php");
90 include_once (
"FDL/Lib.Attr.php");
92 $lattr = $sfdoc->getNormalAttributes();
96 if (((
$a->type ==
"enum") || (
$a->type ==
"enumlist")) && ((
$a->phpfile !=
"-") && (
$a->getOption(
"bmenu") !=
"no"))) {
99 "kindname" =>
$a->getLabel() ,
101 "vkind" =>
"kind" .
$a->id
105 $enum =
$a->getenum();
106 foreach ($enum as $kk => $ki) {
107 $klabel =
$a->getenumLabel($ki);
109 $klabel = array_pop(explode(
'/', $klabel, substr_count($kk,
'.') + 0));
112 "level" => (substr_count($kk,
'.') - substr_count($kk,
'\.')) * 20,
113 "kid" => str_replace(
'\.',
'.', $kk) ,
114 "urlkid" => urlencode($kk)
116 $tmkind[] =
$a->id . $kk;
118 $action->lay->SetBlockData(
"kind" .
$a->id, $tvkind);
121 foreach ($tmkind as $km => $vid) {
127 $action->lay->SetBlockData(
"KIND", $tkind);
128 $action->lay->SetBlockData(
"MKIND", $tkind);
130 $action->lay->Set(
"nbcol", 4 + count($tkind));
149 $lmenu =
$fdoc->GetMenuAttributes();
150 foreach ($lmenu as $k => $v) {
151 if ($v->getOption(
"global") ==
"yes") {
152 $confirm = ($v->getOption(
"lconfirm") ==
"yes");
155 "mtitle" => $v->getLabel() ,
156 "confirm" => ($confirm) ?
"true" :
"false",
157 "tconfirm" => ($confirm) ? sprintf(_(
"Sure %s ?") , addslashes($v->getLabel())) :
"",
158 "murl" => addslashes(
$fdoc->urlWhatEncode($v->link))
168 $action->lay->setBlockData(
"FAMMENU", $tmenu);
173 if (
$action->HasPermission(
"GENERIC")) {
175 while (list($k, $vid) = each($tnewmenu)) {
180 while (list($k, $vid) = each($tnewmenu)) {
185 if (($dirid < 1000000000) && ($catg > 1))
popupActive(
"helpmenu", 1,
'memosearch');
188 if (
$action->HasPermission(
"GENERIC_MASTER")) {
204 if ($idappfree =
$action->parent->Exists(
"FREEDOM")) {
211 if ((
$action->user->id == 1) || ($permission->isAffected() && (count($permission->privileges) > 0))) {
217 $action->lay->Set(
"dirid", $dirid);
218 $action->lay->Set(
"catg", $catg);
224 "satitle" => _(
"no sort")
228 "satitle" => _(
"doctitle")
232 "satitle" => _(
"createdate")
236 "satitle" => _(
"revdate")
239 if ($sfdoc->wid > 0) {
240 $tsort[
"state"] = array(
242 "satitle" => _(
"state")
245 $tmsort[] =
"sortdesc";
246 while (list($k, $v) = each($tsort)) {
247 $tmsort[$v[
"said"]] =
"sortdoc" . $v[
"said"];
249 $lattr = $sfdoc->GetSortAttributes();
253 if ($pType[
'type'] ==
'docid') {
254 $doctitleAttr =
$a->getOption(
'doctitle');
255 if ($doctitleAttr !=
'') {
256 $sortAttribute =
false;
257 if ($doctitleAttr ==
'auto') {
258 $sortAttribute = $sfdoc->getAttribute(sprintf(
"%s_title",
$a->id));
260 $sortAttribute = $sfdoc->getAttribute($doctitleAttr);
262 if ($sortAttribute ===
false) {
263 $action->log->error(sprintf(
"Could not find doctitle attribute '%s' for attribute '%s'", $doctitleAttr,
$a->id));
266 $tsort[$sortAttribute->id] = array(
267 "said" => $sortAttribute->id,
268 "satitle" => sprintf(
"%s (title)",
$a->getLabel())
270 $tmsort[$sortAttribute->id] =
"sortdoc" . $sortAttribute->id;
275 $tsort[
$a->id] = array(
277 "satitle" =>
$a->getLabel()
279 $tmsort[
$a->id] =
"sortdoc" .
$a->id;
287 if (($csort ==
'') || ($csort ==
'--')) {
290 }
else if ($csort[0] ==
'-') {
291 $csort = substr($csort, 1);
297 $action->lay->set(
"sortby", _(
"Sort"));
298 foreach ($tsort as $k => $v) {
299 $tsort[$k][
"dsort"] = ($csort == $k) ? $cselect :
" ";
300 if ($csort == $k)
$action->lay->set(
"sortby", $v[
"satitle"] . $cselect);
304 while (list($k, $v) = each($tmsort)) {
307 $action->lay->SetBlockData(
"USORT", $tsort);