CMS  Version 3.9
ConnectableSummary Class Reference

Public Member Functions

 __construct ($source, $class="connectable_summary")
 
 drawTarget ($target)
 
 draw ()
 

Public Attributes

 $source
 
 $class
 
 $showEmpty = false
 

Detailed Description

Definition at line 9 of file connectable_summary.inc.

Constructor & Destructor Documentation

◆ __construct()

ConnectableSummary::__construct (   $source,
  $class = "connectable_summary" 
)

Definition at line 15 of file connectable_summary.inc.

16  {
17  $this->id = $id;
18  $this->title = $title;
19  $this->source = $source;
20  $this->class = $class;
21  }
$bookmark title

Member Function Documentation

◆ draw()

ConnectableSummary::draw ( )

Definition at line 38 of file connectable_summary.inc.

39  {
41 
42 ?>
43 <ul class="<?echo $this->class?>">
44 <?
45  foreach($targets as $target)
46  {
47  $this->drawTarget($target);
48  }
49 ?>
50 </ul>
51 <?
52  }
static getTargetClasses($sourceItem)
Return an array of connectable target classes for the specified item.

◆ drawTarget()

ConnectableSummary::drawTarget (   $target)

Definition at line 23 of file connectable_summary.inc.

24  {
25  trace("Drawing target: $target for source ".get_class($this->source), 3);
26 
27  $obj = new $target;
28  $name = $obj->prettifyClassName(true);
29  $icon = $obj->getConnectableIcon();
30 
31  $count = ConnectableManager::getConnectedItemCount($this->source, $target, $obj->getConnectableConstraint());
32  if (!$count && !$this->showEmpty) return;
33 ?>
34  <li><img src="<?echo $icon?>" alt="<?echo $name?>" title="<?echo $name?>" data-count="<?echo $count?>"/></li>
35 <?
36  }
$name
Definition: upload.inc:54
$icon
Definition: upload.inc:92
static getConnectedItemCount($sourceItem, $targetClass, $constraint="")
Returns the number of connected items for the specified source that are of the specified class.

Member Data Documentation

◆ $class

ConnectableSummary::$class

Definition at line 12 of file connectable_summary.inc.

◆ $showEmpty

ConnectableSummary::$showEmpty = false

Definition at line 13 of file connectable_summary.inc.

◆ $source

ConnectableSummary::$source

Definition at line 11 of file connectable_summary.inc.


The documentation for this class was generated from the following file: