Project

General

Profile

Feature #24249 ยป 16621_v1.diff

Administrator Admin, 2010-11-30 18:35

View differences:

t3lib/contextmenu/renderer/class.t3lib_contextmenu_renderer_Abstract.php (revision )
t3lib_contextmenu_AbstractContextMenu $contextMenu, $recursive = FALSE
);
}
?>
t3lib/contextmenu/class.t3lib_contextmenu_abstractcontextmenu.php (revision )
protected $dataProvider = NULL;
/**
* @param t3lib_tree_AbstractDataProvider $dataProvider
* @param t3lib_contextmenu_AbstractDataProvider $dataProvider
* @return void
*/
public function setDataProvider(t3lib_tree_AbstractDataProvider $dataProvider) {
public function setDataProvider(t3lib_contextmenu_AbstractDataProvider $dataProvider) {
$this->dataProvider = $dataProvider;
}
/**
* @return t3lib_tree_AbstractDataProvider
* @return t3lib_contextmenu_AbstractDataProvider
*/
public function getDataProvider() {
return $this->dataProvider;
......
*/
abstract public function getActionsForNode(t3lib_tree_Node $node);
}
?>
t3lib/contextmenu/class.t3lib_contextmenu_action.php (revision )
protected $callbackAction = '';
/**
* Type
*
* @var string
*/
protected $type = '';
/**
* Child Action Collection
*
* @var t3lib_contextmenu_ActionCollection
*/
protected $childActions = NULL;
/**
* Returns the label
*
* @return string
......
}
/**
* Returns the icon
*
* @return string
*/
public function getIcon() {
return $this->icon;
}
/**
* Sets the icon
*
* @param string $icon
* @return void
*/
public function setIcon($icon) {
$this->icon = $icon;
}
/**
* Returns the class
*
* @return string
......
public function setCallbackAction($callbackAction) {
$this->callbackAction = $callbackAction;
}
/**
* Returns the type
*
* @return string
*/
public function getType() {
return $this->type;
}
}
/**
* Sets the type
*
* @param string $type
* @return void
*/
public function setType($type) {
$this->type = $type;
}
/**
* Returns the child actions
*
* @return t3lib_contextmenu_ActionCollection
*/
public function getChildActions() {
return $this->childActions;
}
/**
* Sets the child actions
*
* @param t3lib_contextmenu_ActionCollection $actions
* @return void
*/
public function setChildActions(t3lib_contextmenu_ActionCollection $actions) {
$this->childActions = $actions;
}
/**
* Returns true if the action has child actions
*
* @return boolean
*/
public function hasChildActions() {
if ($this->childActions !== NULL) {
return TRUE;
}
return FALSE;
}
/**
* Returns the action as an array
*
* @return array
*/
public function toArray() {
$arrayRepresentation = array(
'label' => $this->getLabel(),
'id' => $this->getId(),
'icon' => $this->getIcon(),
'class' => $this->getClass(),
'callbackAction' => $this->getCallbackAction(),
'type' => $this->getType(),
);
$arrayRepresentation['childActions'] = '';
if ($this->hasChildActions()) {
$arrayRepresentation['childActions'] = $this->childActions->toArray();
}
return $arrayRepresentation;
}
}
?>
t3lib/contextmenu/extdirect/class.t3lib_contextmenu_extdirect_contextmenu.php (revision )
* of the node should be given, because we need this information
* to create the ndoe.
*
* @param array $nodeInfo
* @param stdClass $nodeInfo
* @return array
*/
public function getActionsForNodeArray(array $nodeInfo) {
public function getActionsForNodeArray($nodeData) {
if ($this->dataProvider === NULL) {
$dataProvider = t3lib_div::makeInstance(
't3lib_contextmenu_AbstractDataProvider'
);
$dataProvider = t3lib_div::makeInstance('t3lib_contextmenu_AbstractDataProvider');
$this->setDataProvider($dataProvider);
}
$node = t3lib_div::makeInstance($nodeInfo['type'], $nodeInfo);
/** @var $node t3lib_tree_Node */
$node = t3lib_div::makeInstance('t3lib_tree_Node', (array) $nodeData);
$actions = $this->dataProvider->getActionsForNode($node);
return $actions;
}
/**
* Unused for this implementation
*
* @see getActionsForNodeArray()
* @param t3lib_tree_Node $node
* @return array
*/
public function getActionsForNode(t3lib_tree_Node $node) {
}
}
}
?>
t3lib/tree/class.t3lib_tree_node.php (revision )
return FALSE;
}
/**
* Sets the identifier
*
......
if (isset($data['parentNode']) && $data['parentNode'] !== '') {
$this->setParentNode(t3lib_div::makeInstance(
$data['parentNode']['serializeClassName'],
$data['parentNode']
));
$data['parentNode']['serializeClassName'],
$data['parentNode']
));
}
if (isset($data['childNodes']) && $data['childNodes'] !== '') {
$this->setChildNodes(t3lib_div::makeInstance(
$data['childNodes']['serializeClassName'],
$data['childNodes']
));
$data['childNodes']['serializeClassName'],
$data['childNodes']
));
}
}
t3lib/contextmenu/class.t3lib_contextmenu_actioncollection.php (revision )
* @subpackage t3lib
*/
class t3lib_contextmenu_ActionCollection extends ArrayObject {
/**
* Returns the collection in an array representation for e.g. serialization
*
* @return array
*/
public function toArray() {
$iterator = $this->getIterator();
$arrayRepresentation = array();
while ($iterator->valid()) {
$arrayRepresentation[] = $iterator->current()->toArray();
$iterator->next();
}
}
return $arrayRepresentation;
}
}
?>
t3lib/tree/extdirect/class.t3lib_tree_extdirect_abstractextjstree.php (revision )
* Fetches the next tree level
*
* @abstract
* @param t3lib_tree_Node $node
* @param int $nodeId
* @param stdClass $nodeData
* @return array
*/
abstract public function getNextTreeLevel(t3lib_tree_Node $node);
abstract public function getNextTreeLevel($nodeId, $nodeData);
}
?>
t3lib/contextmenu/class.t3lib_contextmenu_abstractdataprovider.php (revision )
*/
abstract class t3lib_contextmenu_AbstractDataProvider {
/**
* Context Menu Type (e.g. records.pages, records.tt_content)
* Context Menu Type (e.g. table.pages, table.tt_content)
*
* @var string
*/
......
}
/**
* Returns the root node
* Returns the actions of the node
*
* @param t3lib_tree_Node $node
* @return t3lib_contextmenu_ActionCollection
*/
abstract public function getActionsForNode(t3lib_tree_Node $node);
......
* @return array
*/
protected function getConfiguration() {
$contextMenuAction = $GLOBALS['BE_USER']->getTSConfig(
$contextMenuActions = $GLOBALS['BE_USER']->getTSConfig(
'options.contextMenu.' . $this->contextMenuType . '.items'
);
return $contextMenuAction;
return $contextMenuActions['properties'];
}
}
?>
    (1-1/1)