Skip to content

Commit

Permalink
new menue plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ueberschaer committed Sep 5, 2016
1 parent 80c19da commit 0e7803d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
4 changes: 4 additions & 0 deletions templates/collection/edit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@
</div>

{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}
Expand Down
51 changes: 51 additions & 0 deletions templates/plugins/function.mufilesSpecialCollectionMenue.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* MUFiles.
*
* @copyright Michael Ueberschaer (MU)
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
* @package MUFiles
* @author Michael Ueberschaer <[email protected]>.
* @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;
}

0 comments on commit 0e7803d

Please sign in to comment.