Platform  3.1
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  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * View tab in portfolio
9  *
10  * @author Anakeen 2000
11  * @version $Id: foliotab.php,v 1.9 2008/01/22 16:42:49 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage GED
15  */
16 /**
17  */
18 
19 include_once ("FDL/Lib.Dir.php");
20 include_once ("FDL/freedom_util.php");
21 include_once ('FREEDOM/Lib.portfolio.php');
22 // -----------------------------------
23 function foliotab(&$action)
24 {
25  // -----------------------------------
26  // Get all the params
27  $docid = GetHttpVars("id", 0); // portfolio id
28  $dbaccess = $action->GetParam("FREEDOM_DB");
29 
30  include_once ("FDL/popup_util.php");
31  $nbfolders = 1;
32  $action->parent->AddJsRef($action->GetParam("CORE_PUBURL") . "/FDL/Layout/common.js");
33  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/subwindow.js");
34  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/AnchorPosition.js");
35  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/resizeimg.js");
36 
38  if (!$doc->isAffected()) $action->exitError(sprintf(_("document %s not exists") , $docid));
39  $action->lay->set("docid", $docid);
40  $action->lay->set("dirid", $doc->initid);
41  $action->lay->set("title", $doc->title);
42 
43  $child = getChildDir($dbaccess, $action->user->id, $doc->initid, false, "TABLE");
44 
45  if ($action->Read("navigator") == "EXPLORER") { // different tab class for PNG transparency
46  $tabonglet = "ongletvgie";
47  $tabongletsel = "ongletvsie";
48  } else {
49  $tabonglet = "ongletvg";
50  $tabongletsel = "ongletvs";
51  }
52 
53  $linktab = $doc->getParamValue("pfl_idlinktab");
54  if ($linktab) {
55  $linktab = $doc->_val2array($linktab);
56  foreach ($linktab as $k => $id) {
58  if (controlTdoc($tdoc, "view")) $child[] = $tdoc;
59  }
60  }
61 
62  $action->lay->set("tabonglets", $tabongletsel);
63  $action->lay->set("icon", $doc->getIcon());
64  $ttag = array();
65  while (list($k, $v) = each($child)) {
66  $icolor = getv($v, "gui_color");
67  if ($v["initid"] != $doc->initid) {
68  $ttag[$v["initid"]] = array(
69  "tabid" => $v["initid"],
70  "doctype" => $v["doctype"],
71  "TAG_LABELCLASS" => $v["doctype"] == "S" ? "searchtab" : "",
72  "tag_cellbgclass" => ($v["id"] == $docid) ? $tabongletsel : $tabonglet,
73  "icolor" => $icolor,
74  "icontab" => $doc->getIcon($v["icon"]) ,
75  "tabtitle" => str_replace(" ", "&nbsp;", $v["title"])
76  );
77  }
78  }
79 
80  $action->lay->setBlockData("TAG", $ttag);
81  $action->lay->setBlockData("nbcol", count($ttag) + 1);
82 }
83 ?>
← centre documentaire © anakeen - published under CC License - Dynacase