Esempio n. 1
0
			<?php 
    include Kohana::find_file('views', 'errors/partial');
    ?>
			<div class="content">
				<?php 
    echo Form::open($action, array('class' => 'form-inline'));
    ?>
					<fieldset class="bulk-actions form-actions rounded">
						<div class="row">
							<div class="form-group col-xs-7 col-sm-3 col-md-3">
								<div class="control-group <?php 
    echo isset($errors['operation']) ? 'has-error' : '';
    ?>
">
									<?php 
    echo Form::select('operation', PM::bulk_actions(TRUE), '', array('class' => 'form-control col-md-5'));
    ?>
								</div>
							</div>
							<div class="form-group col-xs-5 col-sm-2 col-md-2">
								<?php 
    echo Form::submit('message-bulk-actions', __('Apply'), array('class' => 'btn btn-primary col-md-5'));
    ?>
							</div>
							<div class="form-group col-xs-6 col-sm-7 col-md-7 form-actions-right">
								<?php 
    echo HTML::anchor(Route::get('user/message')->uri(array('action' => 'compose')), '<i class="fa fa-plus fa-white"></i> ' . __('Compose'), array('class' => 'btn btn-success'));
    ?>
							</div>
						</div>
					</fieldset>
Esempio n. 2
0
 /**
  * Bulk updates
  *
  * @param  array  $post
  *
  * @uses   PM::bulk_actions
  * @uses   Arr::callback
  */
 private function _bulk_update($post)
 {
     $operations = PM::bulk_actions(FALSE);
     $operation = $operations[$post['operation']];
     $messages = array_filter($post['messages']);
     // Filter out unchecked pages
     if ($operation['callback']) {
         list($func, $params) = Arr::callback($operation['callback']);
         if (isset($operation['arguments'])) {
             $args = array_merge(array($messages), $operation['arguments']);
         } else {
             $args = array($messages);
         }
         // set model name
         $args['type'] = 'message';
         // execute the bulk operation
         call_user_func_array($func, $args);
     }
 }