From 595032786f8610681134b0c4c27707d6ab3d3753 Mon Sep 17 00:00:00 2001 From: evgen-d Date: Mon, 16 Jun 2014 09:54:56 +0400 Subject: [PATCH] change namespace --- ActionColumn.php | 80 ------------------------------------------ ArangoDbConnection.php | 2 +- ArangoModel.php | 2 +- ArangoProvider.php | 2 +- composer.json | 4 +-- 5 files changed, 5 insertions(+), 85 deletions(-) delete mode 100644 ActionColumn.php diff --git a/ActionColumn.php b/ActionColumn.php deleted file mode 100644 index 0a10683..0000000 --- a/ActionColumn.php +++ /dev/null @@ -1,80 +0,0 @@ - 'edit', - 'icon' => 'pencil', - 'class' => 'btn-primary', - 'label' => 'Edit', - ], - [ - 'url' => 'delete', - 'icon' => 'trash-o', - 'class' => 'btn-danger', - 'label' => 'Delete', - ], - ]; - /** - * @var string the ID of the controller that should handle the actions specified here. - * If not set, it will use the currently active controller. This property is mainly used by - * [[urlCreator]] to create URLs for different actions. The value of this property will be prefixed - * to each action name to form the route of the action. - */ - public $controller; - /** - * @var callable a callback that creates a button URL using the specified model information. - * The signature of the callback should be the same as that of [[createUrl()]]. - * If this property is not set, button URLs will be created using [[createUrl()]]. - */ - public $urlCreator; - - /** - * Creates a URL for the given action and model. - * This method is called for each button and each row. - * @param string $action the button name (or action ID) - * @param \yii\db\ActiveRecord $model the data model - * @param mixed $key the key associated with the data model - * @param integer $index the current row index - * @return string the created URL - */ - public function createUrl($action, $model, $key, $index) - { - if ($this->urlCreator instanceof Closure) { - return call_user_func($this->urlCreator, $action, $model, $key, $index); - } else { - $params = is_array($key) ? $key : ['id' => (string) $key]; - $params[0] = $this->controller ? $this->controller . '/' . $action : $action; - - return Url::toRoute($params); - } - } - - - protected function renderDataCellContent($model, $key, $index) - { - $data = ''; - foreach ($this->buttons as $button) { - $data .= Html::a( - Icon::show($button['icon']).'  '.$button['label'], - $url = $this->createUrl($button['url'], $model, $key, $index), - [ - 'data-pjax' => 0, - 'class' => 'btn btn-xs '.$button['class'] - ] - ) . ' '; - } - - return $data; - } -} diff --git a/ArangoDbConnection.php b/ArangoDbConnection.php index f7e8061..0922f24 100644 --- a/ArangoDbConnection.php +++ b/ArangoDbConnection.php @@ -1,6 +1,6 @@