Make the edit or view action.

@param  array  $data The data passed to a listing view
@return string
164477
protected function makeEditAction($data)
    {
        extract($data);

        // Make markup
        $editable = app('decoy.user')->can('update', $controller);
        return sprintf('<a href="%s" class="action-edit js-tooltip"
            data-placement="left" title="%s">
                <span class="glyphicon glyphicon-%s"></span>
            </a>',
            $this->getAdminEditUri($controller, $many_to_many), // URL
            $editable ? // Label
                __('decoy::base.action.edit') :
                __('decoy::base.action.read') ,
            $editable ? 'pencil' : 'zoom-in' // Icon
        );
    }
799721
public function edit($term, array $data = [])
    {
        if (false === $this->has_table()) return false;

        if (empty($data)) {
            $this->set_error('No data to update');
            return false;
        }

        if ($timestamp = $this->timestamp()) {
            $data += $timestamp;
        }

        $term = $this->normalize_term($term);

        if ( ! $return = $this->db->update($this->table, $data, $term)) {
            $this->set_error($this->db->error());
            return false;
        }

        return $return;
    }
1205611
public function saveRawData( array $data )
    {
        if ( ! parent::save( $data ) )
        {
            return null;
        }

        return isset( $data['id'] ) ? $data['id'] : null;
    }
75141
public function showConfigurationChanger(array $data)
    {
        $name = $data['extension']->name;

        set_meta('title', Foundation::memory()->get("extensions.available.{$name}.name", $name));
        set_meta('description', trans('orchestra/foundation::title.extensions.configure'));

        return view('orchestra/foundation::extensions.configure', $data);
    }
671624
protected function editColumns($data, $row)
    {
        foreach ($this->editColumns as $key => $value) {
            $value['content'] = Helper::compileContent($value['content'], $data, $row);
            Arr::set($data, $value['name'], $value['content']);
        }

        return $data;
    }
959204
public function appendData($data)
    {
        if (!is_array($data)) {
            throw new \InvalidArgumentException('Cannot append view data. Expected array argument.');
        }
        $this->data = array_merge($this->data, $data);
    }
239811
protected function display($data = [])
    {
        // eg onScript
        $function = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['function'];
        $event = lcfirst(substr($function, 2));
        $id = $this->getId();

        // eg @plugin/plugin/script.php
        $name = '@' . $id . '/' . $id . '/' . $event . $this->view->getExtension();

        $this->view->display($name, $data);
    }
28473
public function make($view, array $data = [])
    {
        $location = $this->finder->find($view);

        if ( ! $location) {
            throw new \Exception(sprintf('View `%s` cannot be found!', $view));
        }

        return new View($location, $view, $data);
    }
627040
public function editAction()
    {
        $id = $this->params()->fromRoute('id');
        if (! is_numeric($id)) {
            $this->flashMessenger()->addMessage(
                $this->scTranslate('The category ID was not specified.')
            );
            return $this->redirect()
                ->toRoute('sc-admin/content-manager')
                ->setStatusCode(303);
        }

        try {
            $category = $this->getCategoryService()->getCategory($id);
        } catch (RuntimeException $e) {
            $this->flashMessenger()->addMessage($e->getMessage());
            return $this->redirect()
                ->toRoute('sc-admin/content-manager')
                ->setStatusCode(303);
        }
        $form = $this->getCategoryForm();
        $form->setAttribute(
            'action',
            $this->url()->fromRoute('sc-admin/category/edit', ['id' => $id])
        );
        $form->bind($category);

        if ($this->getRequest()->isPost()) {
            $form->setData($this->getRequest()->getPost());
            if ($form->isValid()) {
                $this->getCategoryService()->saveContent($form->getData());
            }
        }

        return new ViewModel([
            'content' => $category,
            'form' => $form,
        ]);
    }
661889
public function view($data)
    {
        switch($this->level) {
            case 'success': $css = 'alert-success'; break;
            case 'info': $css = 'alert-info'; break;
            case 'warning': $css = 'alert-warning'; break;
            case 'danger': $css = 'alert-danger'; break;
            default: $css = 'alert-info'; break;
        }
        array_push($this->cssClass['alert'], $css);
        if (is_array($data) && array_key_exists('message', $data)) {
            $msg = $data['message'];
        } else {
            $msg = (string)$data;
        }
        if (is_array($data) && array_key_exists('formatter', $data)) {
            $mf = $data['formatter'];
            if (is_callable($mf)) {
                $msg = $mf($msg);
            }
        }
        $this->setValue(new Text($msg))->addClass($this->getClass('alert'))->setAttribute('role', 'alert');
        return $this->render();
    }
1197871
private function formAction(array $item)
    {
        $form = array(
            'name' => 'editURL',
            'caption' => ADM_EDIT,
            'width' => '100%',
            'fields' => array(
                array('type' => 'hidden', 'name' => 'update', 'value' => $item['id']),
                array('type' => 'edit', 'name' => 'url', 'label' => 'URL:', 'width' => '100%',
                    'value' => isset($item['content']) ? $item['content'] : ''),
            ),
            'buttons' => array('apply', 'cancel'),
        );
        /** @var TAdminUI $page */
        $page = Eresus_Kernel::app()->getPage();
        $html = $page->renderForm($form);
        return $html;
    }
929862
public function sitesEdit(array $data)
    {
        if (!array_key_exists('code', $data)) {
            throw new \InvalidArgumentException(
                'Data must contain "code" parameter.'
            );
        }

        /* @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            sprintf('/reference/sites/%s/edit', $data['code']),
            "POST",
            ['site' => json_encode($data)]
        );
    }
157820
public function data($data = []) {
		$bind =& $this->_entity;

		if ($data) {
			$bind ? $bind->set($data) : $this->_data = array_merge($this->_data, $data);
			return $this;
		}
		$data = $bind ? $bind->data() : $this->_data;
		return ($list = $this->_config['whitelist']) ? array_intersect_key($data, $list) : $data;
	}
660410
public function execute($data = null)
    {
        $this->controller->setResponse(new HtmlResponse(
            '',
            $data->response->getStatusCode(),
            $data->response->getHeaders()
        ));

        $result = $this->next->execute($data);

        $this->controller->setRedirect(null);

        return $result;
    }
971496
protected function _update(array $data)
    {
        $data = $this->_setData($data);
        $pmk = $this->getPrimaryKey();
        unset($data[$pmk]);
        $sql = Sql::createSql($this->getAdapter())->update($this->getTableName());
        $event = new Save([
            'action' => Save::UPDATE,
            'data' => $data,
            'abort' => false
        ]);
        $this->getEventManager()->trigger(Save::BEFORE_SAVE, $this, $event);
        if ($event->abort) {
            return false;
        }
        $sql->set($event->data)
            ->where(["{$pmk} = :id" => [':id' => $this->$pmk]])
            ->execute();
        $this->getEventManager()->trigger(Save::AFTER_SAVE, $this, $event);
        return true;
    }
1245087
public function make($view, $data = [])
    {
        if ( ! file_exists($view)) {
            throw new ViewNotFoundException("No file found at '{$view}'");
        }

        ob_start();

        if ( ! empty($data)) {
            extract($data);
        }

        include($view);

        return ob_get_clean();
    }
1262994
public function make($data)
    {
        // include "modified" property for any files
        if ($this->isFile($data)) {
            $this->setProperty('modified', \filemtime((string) $data));
        }

        // register make call
        $this->__call('make', [$data]);

        return $this;
    }