当前位置: 首页>>代码示例>>PHP>>正文


PHP TableBuilder::setActions方法代码示例

本文整理汇总了PHP中Anomaly\Streams\Platform\Ui\Table\TableBuilder::setActions方法的典型用法代码示例。如果您正苦于以下问题:PHP TableBuilder::setActions方法的具体用法?PHP TableBuilder::setActions怎么用?PHP TableBuilder::setActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Anomaly\Streams\Platform\Ui\Table\TableBuilder的用法示例。


在下文中一共展示了TableBuilder::setActions方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handle

 /**
  * Handle the command.
  *
  * @param Request   $request
  * @param Container $container
  */
 public function handle(Request $request, ViewHandler $handler)
 {
     $table = $this->builder->getTable();
     $options = $table->getOptions();
     $views = $table->getViews();
     if ($views->active()) {
         return;
     }
     if ($view = $views->findBySlug($request->get($options->get('prefix') . 'view'))) {
         $view->setActive(true);
     }
     if (!$view && ($view = $views->first())) {
         $view->setActive(true);
     }
     // Nothing to do.
     if (!$view) {
         return;
     }
     // Set columns from active view.
     if (($columns = $view->getColumns()) !== null) {
         $this->builder->setColumns($columns);
     }
     // Set buttons from active view.
     if (($buttons = $view->getButtons()) !== null) {
         $this->builder->setButtons($buttons);
     }
     // Set actions from active view.
     if (($actions = $view->getActions()) !== null) {
         $this->builder->setActions($actions);
     }
     $handler->handle($this->builder, $view);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:38,代码来源:SetActiveView.php

示例2: guess

 /**
  * Guess the action text.
  *
  * @param TableBuilder $builder
  */
 public function guess(TableBuilder $builder)
 {
     $actions = $builder->getActions();
     $stream = $builder->getTableStream();
     if (!($module = $this->modules->active())) {
         return;
     }
     $section = $this->controlPanel->getControlPanelActiveSection();
     foreach ($actions as &$action) {
         /*
          * Nothing to do if set already.
          */
         if (isset($action['permission'])) {
             continue;
         }
         /*
          * Try and guess the permission.
          */
         if ($stream) {
             $action['permission'] = $module->getNamespace($stream->getSlug() . '.' . $action['slug']);
         } elseif ($section) {
             $action['permission'] = $module->getNamespace($section->getSlug() . '.' . $action['slug']);
         }
     }
     $builder->setActions($actions);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:31,代码来源:PermissionGuesser.php

示例3: normalize

 /**
  * Normalize action input.
  *
  * @param TableBuilder $builder
  */
 public function normalize(TableBuilder $builder)
 {
     $actions = $builder->getActions();
     $prefix = $builder->getTableOption('prefix');
     foreach ($actions as $slug => &$action) {
         $action = $this->process($prefix, $slug, $action);
     }
     $builder->setActions($actions);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:14,代码来源:ActionNormalizer.php

示例4: guess

 /**
  * Guess the action text.
  *
  * @param TableBuilder $builder
  */
 public function guess(TableBuilder $builder)
 {
     $actions = $builder->getActions();
     if (!($module = $this->modules->active())) {
         return;
     }
     foreach ($actions as &$action) {
         // Only if it's not already set.
         if (!isset($action['text'])) {
             $action['text'] = $module->getNamespace('button.' . $action['slug']);
         }
     }
     $builder->setActions($actions);
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:19,代码来源:TextGuesser.php

示例5: merge

 /**
  * Merge in registered parameters.
  *
  * @param TableBuilder $builder
  */
 public function merge(TableBuilder $builder)
 {
     $actions = $builder->getActions();
     foreach ($actions as &$parameters) {
         $action = $original = array_pull($parameters, 'action');
         if ($action && ($action = $this->actions->get($action))) {
             $parameters = array_replace_recursive($action, array_except($parameters, 'action'));
         }
         $button = array_get($parameters, 'button', $original);
         if ($button && ($button = $this->buttons->get($button))) {
             $parameters = array_replace_recursive($button, array_except($parameters, 'button'));
         }
     }
     $builder->setActions($actions);
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:20,代码来源:ActionLookup.php

示例6: build

 /**
  * Build dropdown items.
  *
  * @param TableBuilder $builder
  */
 public function build(TableBuilder $builder)
 {
     $actions = $builder->getActions();
     foreach ($actions as $key => &$action) {
         if ($dropdown = array_get($action, 'parent')) {
             foreach ($actions as &$parent) {
                 if (array_get($parent, 'slug') == $dropdown) {
                     if (!isset($parent['dropdown'])) {
                         $parent['dropdown'] = [];
                     }
                     $parent['dropdown'][] = $action;
                 }
             }
         }
     }
     $builder->setActions($actions);
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:22,代码来源:ActionDropdown.php

示例7: parse

 /**
  * Parse the table buttons.
  *
  * @param TableBuilder $builder
  */
 public function parse(TableBuilder $builder)
 {
     $builder->setActions($this->parser->parse($builder->getActions()));
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:9,代码来源:ActionParser.php

示例8: evaluate

 /**
  * Evaluate the table actions.
  *
  * @param TableBuilder $builder
  */
 public function evaluate(TableBuilder $builder)
 {
     $builder->setActions($this->evaluator->evaluate($builder->getActions(), compact('builder')));
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:9,代码来源:ActionEvaluator.php

示例9: predict

 /**
  * Predict the presence of of the sortable action.
  *
  * @param TableBuilder $builder
  */
 public function predict(TableBuilder $builder)
 {
     if ($builder->getTableOption('sortable')) {
         $builder->setActions(array_merge(['reorder'], $builder->getActions()));
     }
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:11,代码来源:SortablePredictor.php


注:本文中的Anomaly\Streams\Platform\Ui\Table\TableBuilder::setActions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。