29 $url = $this->handler.
"?".($this->source->getPrimaryKey()).
"=".($this->source->get($this->source->getPrimaryKey()));
32 $this->panel =
new Panel($this->
id.
"_panel",
$url);
38 <script type=
"text/javascript" src=
"/components/connectable/js/connectable_navigator.js"></script>
39 <script type=
"text/javascript">
40 var {$this->
id}_ConnectableNavigator;
41 window.addEvent(
'load',
function()
52 trace(
"Drawing target: $target for source ".get_class($this->source), 3);
59 $icon =
$obj->getConnectableDisabledIcon();
61 <li><img src=
"<?echo $icon?>" alt=
"<?echo $name?>" title=
"<?echo $name?>" class=
"disabled"/>
71 <li><img src=
"<?echo $icon?>" alt=
"<?echo $name?>" title=
"<?echo $name?>" data-count=
"<?echo $count?>"/>
73 <span
class=
'title'><?echo
$name?></span><br/>
79 echo $item->getConnectableLink($this->source).
"<br/>";
84 echo
"There are no related $name<br/>";
87 $from = get_class($this->source).
":".$this->source->get($this->source->getPrimaryKey());
91 if (method_exists(
$obj, getConnectableCreateHandler))
93 $createHandler =
$obj->getConnectableCreateHandler();
94 $createHandler =
" onclick='{$createHandler}(\"{$createURL}\"); return false;'";
99 <a
class=
'button small' href=
'#' onclick=
'ConnectableNavigator.selectConnectables("<?echo $from?>", "<?echo $target?>", "<?echo $name?>"); return false'>Select...</a>&
nbsp;&
nbsp;&
nbsp;&
nbsp;<a
class=
'button small' href=
'<?echo $createURL?>'<?echo $createHandler?>>Create...</a>
109 if (!$this->source->get($this->source->getPrimaryKey())) $this->
enabled =
false;
111 <div
id=
"<?echo $this->id?>" class=
"connectable_navigator">
112 <span
class=
"title"><?echo $this->
title?></span>
127 $this->panel->draw();
static getConnectedItems($sourceItem, $targetClass, $constraint="")
Returns the connected items for the specified source that are of the specified class.
static getTargetClasses($sourceItem)
Return an array of connectable target classes for the specified item.
__construct($id, $title, $source, $handler)
static using()
Import the datamodels, views and manifest for the specified component(s).
Panel provides a reloadable panel tied to an action handler.