本文整理汇总了PHP中Album::tree2commands方法的典型用法代码示例。如果您正苦于以下问题:PHP Album::tree2commands方法的具体用法?PHP Album::tree2commands怎么用?PHP Album::tree2commands使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Album
的用法示例。
在下文中一共展示了Album::tree2commands方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _createContent
public function _createContent(&$toReturn)
{
$tpl = new CopixTpl();
$dossiers_tree = $this->getParam('tree');
$dossiers_commands = Album::tree2commands($dossiers_tree);
$dossiers_tree_move = Album::tree2move($dossiers_tree, $this->getParam('dossier_id'));
$dossiers_commands_move = Album::tree2commands($dossiers_tree_move);
//Kernel::MyDebug( $dossiers_commands_move );
$tpl->assign('album_id', $this->getParam('album_id'));
$tpl->assign('dossier_id', $this->getParam('dossier_id'));
$tpl->assign('dossier', $this->getParam('dossier'));
$tpl->assign('commands', $dossiers_commands);
$tpl->assign('commands_move', $dossiers_commands_move);
$tpl->assign('dossiermenu', $this->getParam('dossiermenu'));
switch ($this->getParam('mode')) {
case 'htmllist':
$toReturn = $tpl->fetch('dossierstree_htmllist.tpl');
break;
case 'combo':
default:
$toReturn = $tpl->fetch('dossierstree_combo.tpl');
break;
}
return true;
}
示例2: _createContent
public function _createContent(&$toReturn)
{
$tpl = new CopixTpl();
$pAlbumId = $this->getParam('album_id');
$pDossierId = $this->getParam('dossier_id');
// $album_dao = _dao("album");
$dossier_dao = _dao("dossier");
$photo_dao = _dao("photo");
if ($pDossierId > 0) {
$dossier = $dossier_dao->get($pDossierId);
} else {
$dossier->dossier_id = 0;
$dossier->dossier_album = $this->getParam('album_id');
$dossier->dossier_parent = -1;
$dossier->dossier_nom = CopixI18N::get('album|album.message.topfolder');
$dossier->dossier_comment = "";
$dossier->album_id = $pAlbumId;
}
if ($dossier->dossier_album != $pAlbumId) {
return false;
}
$pictures = $photo_dao->findAllByAlbumAndFolder($pAlbumId, $pDossierId);
$tpl->assign('album_id', $pAlbumId);
$tpl->assign('dossier_id', $pDossierId);
$tpl->assign('dossier', $dossier);
$tpl->assign('pictures', $pictures);
$tpl->assign('picture_thumbsize', '_s64');
$dossiers_tree = Album::getFoldersTree($pAlbumId);
$dossiers_commands = Album::tree2commands($dossiers_tree);
$tpl->assign('commands_move', $dossiers_commands);
$toReturn = $tpl->fetch('editphotos.tpl');
return true;
}
示例3: tree2commands
public function tree2commands($dossiers_tree)
{
$cmds = array();
//var_dump($dossiers_tree);
if (count($dossiers_tree)) {
// $cmds[] = array( 'type'=>'open' );
foreach ($dossiers_tree as $key => $val) {
$childs = isset($val->childs) ? $val->childs : array();
unset($val->childs);
$cmds[] = array('type' => 'folder', 'data' => $val);
$childs_cmds = Album::tree2commands($childs);
if (count($childs_cmds)) {
$cmds[] = array('type' => 'open');
$cmds = array_merge($cmds, $childs_cmds);
$cmds[] = array('type' => 'close');
}
}
// $cmds[] = array( 'type'=>'close' );
}
//var_dump($cmds);
return $cmds;
}