Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
viewattr.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  * Generated Header (not documented yet)
9  *
10  * @author Anakeen 2000
11  * @version $Id: viewattr.php,v 1.10 2008/08/14 09:59:14 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage
15  */
16 /**
17  */
18 // ---------------------------------------------------------------
19 // $Id: viewattr.php,v 1.10 2008/08/14 09:59:14 eric Exp $
20 // $Source: /home/cvsroot/anakeen/freedom/freedom/Zone/Fdl/viewattr.php,v $
21 // ---------------------------------------------------------------
22 include_once ("FDL/Class.Doc.php");
23 include_once ("FDL/Class.DocAttr.php");
24 
25 include_once ("FDL/freedom_util.php");
26 // Compute value to be inserted in a specific layout
27 // -----------------------------------
28 function viewattr(&$action, $htmlval = true, $htmllink = true)
29 {
30  // -----------------------------------
31  // GetAllParameters
32  $docid = GetHttpVars("id");
33  $abstract = (GetHttpVars("abstract", 'N') == "Y"); // view doc abstract attributes
34  // Set the globals elements
35  $dbaccess = $action->GetParam("FREEDOM_DB");
36 
38 
39  $listattr = $doc->GetNormalAttributes();
40  // each value can be instanced with L_<ATTRID> for label text and V_<ATTRID> for value
41  while (list($k, $v) = each($listattr)) {
42 
43  $value = chop($doc->GetValue($v->id));
44  //------------------------------
45  // Set the table value elements
46  if ($v->mvisibility != "H") {
47  // don't see non abstract if not
48  if (($abstract) && ($v->abstract != "Y")) {
49  $action->lay->Set("V_" . $v->id, "");
50  $action->lay->Set("L_" . $v->id, "");
51  } else {
52  $action->lay->Set("V_" . strtoupper($v->id) , $htmlval ? $doc->GetHtmlValue($v, $value, "_self", $htmllink) : $value);
53  $action->lay->Set("L_" . strtoupper($v->id) , $v->getLabel());
54  }
55  }
56  }
57 
58  $listattr = $doc->GetFieldAttributes();
59  // each value can be instanced with L_<ATTRID> for label text and V_<ATTRID> for value
60  while (list($k, $v) = each($listattr)) {
61 
62  $action->lay->Set("L_" . strtoupper($v->id) , $v->getLabel());
63  }
64 }
65 ?>
← centre documentaire © anakeen - published under CC License - Dynacase