Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
foliotab.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * View tab in portfolio
8  *
9  * @author Anakeen
10  * @version $Id: foliotab.php,v 1.9 2008/01/22 16:42:49 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 
17 include_once ("FDL/Lib.Dir.php");
18 include_once ("FDL/freedom_util.php");
19 include_once ('FREEDOM/Lib.portfolio.php');
20 // -----------------------------------
21 function foliotab(Action & $action)
22 {
23  // -----------------------------------
24  // Get all the params
25  $docid = GetHttpVars("id", 0); // portfolio id
26  include_once ("FDL/popup_util.php");
27  $action->parent->AddJsRef($action->GetParam("CORE_PUBURL") . "/FDL/Layout/common.js");
28  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/subwindow.js");
29  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/AnchorPosition.js");
30  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/resizeimg.js");
31 
32  $doc = new_Doc($action->dbaccess, $docid);
33  if (!$doc->isAffected()) $action->exitError(sprintf(_("document %s not exists") , $docid));
34  $action->lay->set("docid", $doc->id);
35  $action->lay->set("dirid", $doc->initid);
36  $action->lay->eSet("title", $doc->title);
37 
38  $child = getChildDir($action->dbaccess, $action->user->id, $doc->initid, false, "TABLE");
39 
40  if ($action->Read("navigator") == "EXPLORER") { // different tab class for PNG transparency
41  $tabonglet = "ongletvgie";
42  $tabongletsel = "ongletvsie";
43  } else {
44  $tabonglet = "ongletvg";
45  $tabongletsel = "ongletvs";
46  }
47 
48  $linktab = $doc->getFamilyParameterValue("pfl_idlinktab");
49  if ($linktab) {
50  $linktab = $doc->rawValueToArray($linktab);
51  foreach ($linktab as $k => $id) {
52  $tdoc = getTDoc($action->dbaccess, $id);
53  if (controlTdoc($tdoc, "view")) $child[] = $tdoc;
54  }
55  }
56 
57  $action->lay->set("tabonglets", $tabongletsel);
58  $action->lay->set("icon", $doc->getIcon());
59  $ttag = array();
60  foreach ($child as $v) {
61  $icolor = getv($v, "gui_color");
62  if ($v["initid"] != $doc->initid) {
63  $ttag[$v["initid"]] = array(
64  "tabid" => $v["initid"],
65  "doctype" => $v["doctype"],
66  "TAG_LABELCLASS" => $v["doctype"] == "S" ? "searchtab" : "",
67  "tag_cellbgclass" => ($v["id"] == $docid) ? $tabongletsel : $tabonglet,
68  "icolor" => $icolor,
69  "icontab" => $doc->getIcon($v["icon"]) ,
70  "tabtitle" => htmlspecialchars(str_replace(" ", "\xC2\xA0" /* UTF-8 for NO-BREAK SPACE */
71  , $v["title"]) , ENT_QUOTES)
72  );
73  }
74  }
75 
76  $action->lay->setBlockData("TAG", $ttag);
77  $action->lay->setBlockData("nbcol", count($ttag) + 1);
78 }
$tdoc
getTDoc($dbaccess, $id, $sqlfilters=array(), $result=array())
global $action
getv(&$t, $k, $d="")
controlTdoc(&$tdoc, $aclname)
exitError($texterr, $exit=true, $code="")
foliotab(Action &$action)
Definition: foliotab.php:21
$docid
Definition: cleanFamily.php:13
getChildDir($dbaccess, $userid, $dirid, $notfldsearch=false, $restype="LIST")
Definition: Lib.Dir.php:38
Read($k, $d="")
new_Doc($dbaccess, $id= '', $latest=false)
← centre documentaire © anakeen