Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
expandfld.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: expandfld.php,v 1.18 2005/09/27 16:16:50 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 // ---------------------------------------------------------------
17 // $Id: expandfld.php,v 1.18 2005/09/27 16:16:50 eric Exp $
18 // $Source: /home/cvsroot/anakeen/freedom/freedom/Action/Freedom/expandfld.php,v $
19 // ---------------------------------------------------------------
20 include_once ("FREEDOM/folders.php");
21 // -----------------------------------
23 {
24  // -----------------------------------
25  $dbaccess = $action->dbaccess;
26  $dirid = GetHttpVars("dirid", 9); // root directory
27  $inavmode = GetHttpVars("inavmode"); // root directory
29  $navigate = $action->getParam('FREEDOM_VIEWFRAME'); // standard navigation
30  $action->lay->eSet("navmode", $navigate);
31  if ($inavmode == 'inverse') {
32  if ($navigate == 'navigator') $action->lay->Set("navmode", "folder");
33  else if ($navigate == 'folder') $action->lay->Set("navmode", "navigator");
34  }
35 
36  $action->parent->AddJsRef($action->GetParam("CORE_PUBURL") . "/FREEDOM/Layout/expandfld.js");
37  // get export permission
38  $appfld = new Application();
39  $appfld->Set("FDL", $action->parent->parent);
40  $pexport = $appfld->HasPermission("EXPORT");
41  // ------------------------------------------------------
42  // definition of popup menu
43  include_once ("FDL/popup_util.php");
44  popupInit("popfld", array(
45  'vprop',
46  'mkdir',
47  'export',
48  'refresh',
49  'cancel'
50  ));
51  popupInit("poppaste", array(
52  'staticpaste',
53  'pastelatest',
54  'cancel2'
55  ));
56  $ldir = getChildDir($dbaccess, $action->user->id, $dir->id, false, "TABLE");
57  $stree = "";
58  $nbfolders = 0;
59  if (count($ldir) > 0) {
60  $nbfolders = 1;
61  foreach ($ldir as $doc) {
62 
63  popupActive("popfld", $nbfolders, 'cancel');
64  popupActive("popfld", $nbfolders, 'vprop');
65 
66  if ($pexport) popupActive("popfld", $nbfolders, 'export');
67  else popupInvisible("popfld", $nbfolders, 'export');
68 
69  if ($doc["doctype"] == 'D') {
70  popupActive("popfld", $nbfolders, 'mkdir');
71  popupActive("popfld", $nbfolders, 'refresh');
72  } else {
73  popupInvisible("popfld", $nbfolders, 'mkdir');
74  popupInvisible("popfld", $nbfolders, 'refresh');
75  }
76  popupActive("poppaste", $nbfolders, 'staticpaste');
77  popupActive("poppaste", $nbfolders, 'pastelatest');
78  popupActive("poppaste", $nbfolders, 'cancel2');
79  $nbfolders++;
80 
81  if (($doc["owner"] >= 0) && ($doc["doctype"] != 'D') && ($doc["doctype"] != 'S')) {
82  // it 'is not a folder
83  continue;
84  }
85  $hasChild = 'false';
86  // no child for a search
87  if (hasChildFld($action->dbaccess, $doc["initid"], ($doc["doctype"] == 'S'))) $hasChild = 'true';
88 
89  $ftype = $dir->getIcon($doc["icon"]);
90  $title = htmlspecialchars($doc["title"], ENT_QUOTES);
91  $stree.= "ffolder.insFld(fldtop, ffolder.gFld(" . json_encode(str_replace("\n", " ", $title)) . ", \"#\"," . $doc["initid"] . ",\"$ftype\",$hasChild))\n";
92  }
93  }
94  // define icon from style
95  $iconfolder = $action->parent->getImageLink("ftv2folderopen1.gif");
96  $pathicon = explode("/", $iconfolder);
97  if (count($pathicon) == 4) $action->lay->set("iconFolderPath", $pathicon[0] . "/" . $pathicon[1]);
98  else $action->lay->set("iconFolderPath", "FREEDOM");
99 
100  $action->lay->Set("subtree", $stree);
101  // display popup js
102  popupGen($nbfolders);
103 }
global $action
$ldir
Definition: resizeimg.php:145
Set($name, &$parent)
getChildDir($dbaccess, $userid, $dirid, $notfldsearch=false, $restype="LIST")
Definition: Lib.Dir.php:38
hasChildFld($dbaccess, $dirid, $issearch=false)
Definition: Lib.Dir.php:862
new_Doc($dbaccess, $id= '', $latest=false)
$dir
Definition: resizeimg.php:144
getParam($name, $def="")
$dbaccess
Definition: checkVault.php:17
expandfld(Action &$action)
Definition: expandfld.php:22
← centre documentaire © anakeen