Core  3.2
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  * @package FDL
5 */
6 /**
7  * Generated Header (not documented yet)
8  *
9  * @author Anakeen
10  * @version $Id: viewattr.php,v 1.10 2008/08/14 09:59:14 eric Exp $
11  * @package FDL
12  * @subpackage
13  */
14 /**
15  */
16 // ---------------------------------------------------------------
17 // $Id: viewattr.php,v 1.10 2008/08/14 09:59:14 eric Exp $
18 // $Source: /home/cvsroot/anakeen/freedom/freedom/Zone/Fdl/viewattr.php,v $
19 // ---------------------------------------------------------------
20 include_once ("FDL/Class.Doc.php");
21 include_once ("FDL/Class.DocAttr.php");
22 
23 include_once ("FDL/freedom_util.php");
24 // Compute value to be inserted in a specific layout
25 // -----------------------------------
26 function viewattr(Action & $action, $htmlval = true, $htmllink = true)
27 {
28  // -----------------------------------
29  // GetAllParameters
30  $docid = GetHttpVars("id");
31  $abstract = (GetHttpVars("abstract", 'N') == "Y"); // view doc abstract attributes
32  // Set the globals elements
33  $dbaccess = $action->dbaccess;
34 
36 
37  $listattr = $doc->GetNormalAttributes();
38  // each value can be instanced with L_<ATTRID> for label text and V_<ATTRID> for value
39  foreach ($listattr as $k => $v) {
40 
41  $value = chop($doc->getRawValue($v->id));
42  //------------------------------
43  // Set the table value elements
44  if ($v->mvisibility != "H") {
45  // don't see non abstract if not
46  if ($abstract && !$v->isInAbstract) {
47  $action->lay->Set("V_" . $v->id, "");
48  $action->lay->Set("L_" . $v->id, "");
49  } else {
50  $action->lay->Set("V_" . strtoupper($v->id) , $htmlval ? $doc->GetHtmlValue($v, $value, "_self", $htmllink) : $value);
51  $action->lay->Set("L_" . strtoupper($v->id) , $v->getLabel());
52  }
53  }
54  }
55 
56  $listattr = $doc->GetFieldAttributes();
57  // each value can be instanced with L_<ATTRID> for label text and V_<ATTRID> for value
58  foreach ($listattr as $k => $v) {
59 
60  $action->lay->Set("L_" . strtoupper($v->id) , $v->getLabel());
61  }
62 }
global $action
viewattr(Action &$action, $htmlval=true, $htmllink=true)
Definition: viewattr.php:26
Set($name, &$parent)
$docid
Definition: cleanFamily.php:13
new_Doc($dbaccess, $id= '', $latest=false)
$dbaccess
Definition: checkVault.php:17
$value
← centre documentaire © anakeen