Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Method.DocImg.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  * Image document
9  *
10  * @author Anakeen 2000
11  * @version $Id: Method.DocImg.php,v 1.8 2008/03/10 10:45:52 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  * @begin-method-ignore
20  * this part will be deleted when construct document class until end-method-ignore
21  */
22 class _IMAGE extends Doc
23 {
24  /*
25  * @end-method-ignore
26  */
27 
28  var $defaultview = "FDL:VIEWIMGCARD";
29 
30  var $cviews = array(
31  "FDL:VIEWIMGCARD:T"
32  );
33  // -----------------------------------
34  function viewimgcard($target = "_self", $ulink = true, $abstract = false)
35  {
36  // -----------------------------------
37  $nbimg = 0; // number of image
38  $this->viewattr($target, $ulink, $abstract);
39  $this->viewprop($target, $ulink, $abstract);
40 
41  $listattr = $this->GetNormalAttributes();
42 
43  $tableimage = array();
44  $vf = newFreeVaultFile($this->dbaccess);
45  // view all (and only) images
46  while (list($i, $attr) = each($listattr)) {
47 
48  $value = chop($this->GetValue($i));
49  //------------------------------
50  // Set the table value elements
51  if (($value != "") && ($attr->visibility != "H")) {
52  // print values
53  switch ($attr->type) {
54  case "file":
55  case "image":
56 
57  $tableimage[$nbimg]["imgsrc"] = $this->GetHtmlValue($attr, $value, $target, $ulink);
58  if (preg_match(PREGEXPFILE, $value, $reg)) {
59  // reg[1] is mime type
60  $tableimage[$nbimg]["type"] = $reg[1];
61  if ($vf->Show($reg[2], $info) == "") $fname = $info->name;
62  else $fname = _("no filename");
63  $tableimage[$nbimg]["name"] = $fname;
64  }
65  break;
66  }
67  }
68  }
69  // Out
70  $this->lay->SetBlockData("TABLEIMG", $tableimage);
71  }
72 
73  function PostModify()
74  {
75  $this->SetValue("IMG_TITLE", $this->vault_filename("IMG_FILE"));
76  }
77  /**
78  * @begin-method-ignore
79  * this part will be deleted when construct document class until end-method-ignore
80  */
81 }
82 /*
83  * @end-method-ignore
84 */
85 ?>
← centre documentaire © anakeen - published under CC License - Dynacase