17 include_once (
"FDL/Class.Dir.php");
27 $docid = GetHttpVars(
"id");
28 $famid = GetHttpVars(
"famid");
32 if (intval(
$docid) == 0) $action->
exitError(sprintf(_(
"unknow logical reference '%s'") , GetHttpVars(
"id")));
37 if (!
$doc->isAffected()) $action->
exitError(sprintf(_(
"cannot see unknow reference %s") ,
$docid));
38 if (
$doc->defDoctype !=
'D') $action->
exitError(sprintf(_(
"not a static folder %s") ,
$doc->title));
41 $action->parent->addJsRef(
'lib/jquery/jquery.js');
42 $action->parent->AddJsRef($action->GetParam(
"CORE_PUBURL") .
"/FDC/Layout/inserthtml.js");
43 $action->parent->AddJsRef($action->GetParam(
"CORE_STANDURL") .
"app=FDL&action=EDITJS");
44 $action->parent->AddJsRef($action->GetParam(
"CORE_PUBURL") .
"/FDL/Layout/editinsertdocument.js");
45 $action->parent->AddJsRef($action->GetParam(
"CORE_JSURL") .
"/resizeimg.js");
47 $l =
$doc->getContent();
48 foreach ($l as $k => $v) {
49 $l[$k][
"icon"] =
$doc->getIcon($v[
"icon"]);
52 $action->lay->set(
"restrict",
false);
56 if (method_exists(
$doc,
"isAuthorized")) {
57 if (
$doc->isAuthorized($classid)) {
59 if (
$doc->hasNoRestriction()) $tclassdoc =
GetClassesDoc($action->dbaccess, $action->user->id, $classid,
"TABLE");
61 $tclassdoc =
$doc->getAuthorizedFamilies();
62 $action->lay->set(
"restrict",
true);
65 $tclassdoc =
$doc->getAuthorizedFamilies();
66 $first = current($tclassdoc);
68 $action->lay->set(
"restrict",
true);
71 $tclassdoc =
GetClassesDoc($action->dbaccess, $action->user->id, $classid,
"TABLE");
73 $action->lay->SetBlockData(
"SELECTCLASS", $tclassdoc);
75 $action->lay->SetBlockData(
"SELECTCLASS", $tclassdoc);
76 $action->lay->set(
"famid",
false);
79 $action->lay->set(
"famid", $fdoc->id);
80 $action->lay->set(
"famicon", $fdoc->getIcon());
81 $action->lay->set(
"famtitle", sprintf(_(
"Search %s") , $fdoc->title));
83 $action->lay->set(
"docid",
$doc->id);
84 $fdoc =
$doc->getFamilyDocument();
85 $action->lay->eset(
"classtitle", $fdoc->title);
86 $action->lay->set(
"iconsrc",
$doc->getIcon());
87 $action->lay->eset(
"TITLE", sprintf(_(
"Content managing of %s") ,
$doc->title));
88 $action->lay->eset(
"version",
$doc->version);
89 $action->lay->set(
"hasstate", (
$doc->getState() !=
""));
90 $action->lay->eset(
"state",
$doc->getState());
91 $action->lay->set(
"statecolor",
$doc->getStateColor());
92 $action->lay->set(
"count", count($l));
94 $action->lay->eSetBlockData(
"CONTENT", $l);
95 $action->lay->set(
"nmembers", sprintf(_(
"%d documents") , count($l)));
editinsertdocument(Action &$action)
exitError($texterr, $exit=true, $code="")
GetClassesDoc($dbaccess, $userid, $classid=0, $qtype="LIST", $extraFilters=array())
new_Doc($dbaccess, $id= '', $latest=false)
getIdFromName($dbaccess, $name)
if($file) if($subject==""&&$file) if($subject=="") $err