Offline Server  1.6
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
off_folderListFormat.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Format column for folder list
4  *
5  * @author Anakeen 2006
6  * @version $Id: $
7  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
8  * @package OFFLINE
9  * @subpackage
10  */
11 /**
12  */
13 
14 /**
15  * Format column for folder list
16  *
17  */
19 {
20 
21  static public function getIcon(Doc &$doc)
22  {
23  $icon = $doc->getIcon('', 20);
24 
25  return sprintf('<img class="icon" src="%s">', $icon);
26 
27  }
28 
29  static public function getStatus(Doc &$doc)
30  {
31 
32  $icon = $doc->getEmblem(20);
33 
34  return sprintf('<img class="icon" src="%s">', $icon);
35 
36  }
37  static public function getSyncStatus(Doc &$doc)
38  {
39  $domains = $doc->getDomainIds();
40  if (count($domains) > 0) {
41  $sDomain = array();
42  ;
43  foreach ( $domains as $domain ) {
44  $sDomain[] = $doc->getHTMLTitle($domain);
45  }
46  global $action;
47  $img = sprintf('<img class="icon" src="%s"> ', $action->getImageUrl('domainsync.png', true, 20));
48 
49  return $img . implode(", ", $sDomain);
50  }
51  /*
52  if ($doc->isInDomain()) {
53 
54 
55  }*/
56  return '';
57 
58  }
59 
60  static public function getStatusMessage(Doc &$doc)
61  {
62  static $w = null;
63  global $action;
64 
65  if ($w == null) {
66  include_once ("FDL/Class.DocWait.php");
67  $w = new DocWait($doc->dbaccess);
68  }
69  if ($w->select(array(
70  $doc->initid,
71  $doc->userid,0
72  ))) {
73  $img = '';
74  switch ($w->status) {
75  case docWait::invalid :
76  $img = sprintf('<img title="%s" class="icon" src="%s"> ', _("off:invalid"), $action->getImageUrl('status_invalid.png', true, 20));
77  $message=$w->statusmessage;
78  break;
79  case docWait::constraint :
80  $img = sprintf('<img title="%s" class="icon" src="%s"> ', _("off:constraint"), $action->getImageUrl('status_constraint.png', true, 20));
81  $message=$w->statusmessage;
82  break;
83  case docWait::upToDate :
84  $img = sprintf('<img title="%s" class="icon" src="%s"> ', _("off:upToDate"), $action->getImageUrl('status_uptodate.png', true, 20));
85  $message=sprintf("last update %s", FrenchDateToLocaleDate($w->date));
86  break;
87  case docWait::conflict :
88  $img = sprintf('<img title="%s" class="icon" src="%s"> ', _("off:conflict"), $action->getImageUrl('status_conflict.png', true, 20));
89  $message=$w->statusmessage;
90  break;
91  default :
92  $img = $w->status;
93  $message=$w->statusmessage;
94  }
95  return $img . $message;
96 
97  }
98  return '';
99 
100  }
101 
102  static public function getColumnDescription()
103  {
104  return array(
105  "icon" => array(
106  "htitle" => _("icon"),
107  "horder" => "title",
108  "issort" => false,
109  "method" => "offFolderListFormat::getIcon(THIS)"
110  ),
111  "title" => array(
112  "htitle" => _("title"),
113  "horder" => "title",
114  "issort" => false,
115  "method" => "::getHtmlTitle()"
116  ),
117  "date" => array(
118  "htitle" => _("Modification Date Menu"),
119  "horder" => "date",
120  "issort" => false,
121  "method" => "wsFolderListFormat::getMDate(THIS)"
122  ),
123  "domain" => array(
124  "htitle" => _("Domain"),
125  "horder" => "status",
126  "issort" => false,
127  "method" => "offFolderListFormat::getSyncStatus(THIS)"
128  ),
129  "status" => array(
130  "htitle" => _("Status"),
131  "horder" => "status",
132  "issort" => false,
133  "method" => "offFolderListFormat::getStatus(THIS)"
134  ),
135  "reason" => array(
136  "htitle" => _("Reason"),
137  "horder" => "",
138  "issort" => false,
139  "method" => "offFolderListFormat::getStatusMessage(THIS)"
140  )
141  );
142  }
143 }
144 ?>
static getSyncStatus(Doc &$doc)
static getStatusMessage(Doc &$doc)
static getStatus(Doc &$doc)
static getIcon(Doc &$doc)
← centre documentaire © anakeen - published under CC License - Dynacase