pwet

Sign in or create your account | Project List | Help | pwet.fr | Planet eZ Publish.fr | Bioutifoul Photos

pwet Commit Details

Date:2011-08-02 22:43:04 (9 months 14 days ago)
Author:Damien Pobel
Commit:157
Message:Added browse to SubTreeMultiplexer eventttype
Files: trunk/www/extension/ezworkflowcollection/settings/browse.ini.append.php (1 diff)
trunk/www/extension/ezworkflowcollection/eventtypes/event/subtreemultiplexer/subtreemultiplexertype.php (1 diff)
trunk/www/extension/ezworkflowcollection/design/admin/templates/workflow/eventtype/edit/event_subtreemultiplexer.tpl (1 diff)

Change Details

trunk/www/extension/ezworkflowcollection/settings/browse.ini.append.php
1<?php /*
2
3[BrowseSubTreeMultiplexer]
4SelectionType=single
5ReturnType=NodeID
6StartNode=content
7
8
9*/ ?>
010
111  + Id HeadURL
212
trunk/www/extension/ezworkflowcollection/eventtypes/event/subtreemultiplexer/subtreemultiplexertype.php
191191        }
192192    }
193193
194    function customWorkflowEventHTTPAction( $http, $action, $workflowEvent )
195    {
196        if ( $action === 'BrowseSubTreeMultiplexer' )
197        {
198            $params = array(
199                'action_name' => 'BrowseSubTreeMultiplexer',
200                'from_page' => 'workflow/edit/' . $workflowEvent->attribute( 'workflow_id' ),
201                'browse_custom_action' => array(
202                    'name' => 'CustomActionButton[' . $workflowEvent->attribute( 'id' ) . '_AfterBrowse]',
203                    'value' => '1'
204                )
205            );
206            $module = null;
207            $redirectURL = eZContentBrowse::browse( $params, $module );
208            eZHTTPTool::redirect( $redirectURL );
209            eZExecution::cleanExit();
210        }
211        elseif ( $action === 'AfterBrowse' && !$http->hasPostVariable( 'BrowseCancelButton' ) )
212        {
213            if ( $http->hasPostVariable( 'SelectedNodeIDArray' ) )
214            {
215                $selection = $http->postVariable( 'SelectedNodeIDArray', array() );
216                if ( isset( $selection[0] ) )
217                {
218                    $workflowEvent->setAttribute( 'data_int1', (int) $selection[0] );
219                }
220            }
221            else
222            {
223                $workflowEvent->setAttribute( 'data_int1', '' );
224            }
225        }
226    }
227
194228}
195229
196230eZWorkflowEventType::registerEventType( SubTreeMultiplexerType::WORKFLOW_TYPE_STRING, 'subtreemultiplexertype' );
197231
198?>
232?>
trunk/www/extension/ezworkflowcollection/design/admin/templates/workflow/eventtype/edit/event_subtreemultiplexer.tpl
88 * @todo use node selector to pick up target subtree node
99 * @todo remove current workflow from target workflow list
1010 *}
11{def $target = cond( $event.target_subtree,
12    fetch( content, node, hash( 'node_id', $event.target_subtree ) ),
13    false() )}
1114<div class="block">
1215
1316{* Subtree *}
14<div class="element">
17<div class="block">
1518    <label>{'Affected subtree'|i18n( 'extension/ezworkflowcollection' )}</label>
16    <input type="text" name="WorkflowEvent_event_subtreemultiplexer_target_subtree_{$event.id}" size="10" value="{$event.target_subtree}"/>
19    <p>
20    {if $target|not()}
21        {'The subtree has not been selected yet, please use the following to choose a node.'|i18n( 'extension/ezworkflowcollection' )}
22    {else}
23        <a href={$target.url_alias|ezurl()}>{$target.name|wash()}</a> [{'Node id:'|i18n( 'extension/ezworkflowcollection' )} {$target.node_id}]
24    {/if}
25    </p>
26    <input type="hidden" name="WorkflowEvent_event_subtreemultiplexer_target_subtree_{$event.id}" size="10" value="{$event.target_subtree}"/>
27    <input type="submit" name="CustomActionButton[{$event.id}_BrowseSubTreeMultiplexer]" class="{cond( $target|not, 'defaultbutton ', '' )}button" value="{'Browse'|i18n( 'extension/ezworkflowcollection' )}" />
1728</div>
1829
1930{* Workflow to run *}
20<div class="element">
31<div class="block">
2132    <label>{'Workflow to run'|i18n( 'design/admin/workflow/eventtype/edit' )}:</label>
2233    {section show=$event.workflow_type.workflow_list}
2334    <select name="WorkflowEvent_event_subtreemultiplexer_target_workflow_{$event.id}">
2435

Archive Download the corresponding diff file

Revision: 157