diff --git a/templates/collection/edit.tpl b/templates/collection/edit.tpl index 46d81fb..1a71727 100644 --- a/templates/collection/edit.tpl +++ b/templates/collection/edit.tpl @@ -70,7 +70,11 @@ {include file='helper/include_categories_edit.tpl' obj=$collection groupName='collectionObj' panel=true} + {if $coredata.MUFiles.specialCollectionMenue eq false} {include file='collection/include_selectOne.tpl' group='collection' alias='parent' aliasReverse='children' mandatory=false idPrefix='mufilesCollection_Parent' linkingItem=$collection panel=true displayMode='dropdown' allowEditing=false} + {else} + {mufilesSpecialCollectionMenue collectionId=$collection.id} + {/if} {* {include file='hookobject/include_selectMany.tpl' group='collection' alias='hookcollection' aliasReverse='collectionhook' mandatory=false idPrefix='mufilesCollection_Hookcollection' linkingItem=$collection panel=true displayMode='dropdown' allowEditing=false} *} {if $mode ne 'create'} {include file='helper/include_standardfields_edit.tpl' obj=$collection panel=true} diff --git a/templates/plugins/function.mufilesSpecialCollectionMenue.php b/templates/plugins/function.mufilesSpecialCollectionMenue.php new file mode 100644 index 0000000..1b69619 --- /dev/null +++ b/templates/plugins/function.mufilesSpecialCollectionMenue.php @@ -0,0 +1,51 @@ +. + * @link http://webdesign-in-bremen.com + * @link http://zikula.org + * @version Generated by ModuleStudio 0.7.0 (http://modulestudio.de). + */ + +/** + * The mufilesSpecialCollectionMenue plugin provides a special menue of collections. + * + * Available parameters: + * - collectionid: Optional id of element as part of unique error message element. + * - imageid: + * - assign: If set, the results are assigned to the corresponding variable instead of printed out. + * + * @param array $params All attributes passed to this function from the template. + * @param Zikula_Form_View $view Reference to the view object. + * + * @return string The output of the plugin. + */ +function smarty_function_mufilesSpecialCollectionMenue($params, $view) +{ + if ($params['collectionId']) { + $collectionId = $params['collectionId']; + } else { + $collectionId = 0; + } + + if ($params['imageId']) { + $imageId = $params['imageId']; + } else { + $imageId = 0; + } + + $menue = MUFiles_Util_Menue::getCollectionMenue($collectionId); + + + if (array_key_exists('assign', $params)) { + $view->assign($params['assign'], $menue); + + return; + } + + return $menue; +}