-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
526 additions
and
250 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,42 @@ | ||
{ | ||
"name": "kartik-v/yii2-tree-manager", | ||
"description": "An enhanced tree management module with tree node selection and manipulation using nested sets.", | ||
"keywords": [ | ||
"bootstrap", | ||
"tree", | ||
"treeview", | ||
"krajee", | ||
"hierarchy", | ||
"nested", | ||
"set", | ||
"nestedset", | ||
"ajax", | ||
"jquery" | ||
], | ||
"homepage": "https://github.com/kartik-v/yii2-tree-manager", | ||
"type": "yii2-extension", | ||
"license": "BSD-3-Clause", | ||
"authors": [ | ||
{ | ||
"name": "Kartik Visweswaran", | ||
"email": "[email protected]", | ||
"homepage": "http://www.krajee.com/" | ||
} | ||
], | ||
"require": { | ||
"kartik-v/yii2-widget-activeform": ">=1.5.7", | ||
"creocoder/yii2-nested-sets": ">=0.9", | ||
"kartik-v/yii2-dialog": ">=1.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"kartik\\tree\\": "src" | ||
} | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.1.x-dev" | ||
} | ||
"name": "kartik-v/yii2-tree-manager", | ||
"description": "An enhanced tree management module with tree node selection and manipulation using nested sets.", | ||
"keywords": [ | ||
"bootstrap", | ||
"tree", | ||
"treeview", | ||
"krajee", | ||
"hierarchy", | ||
"nested", | ||
"set", | ||
"nestedset", | ||
"ajax", | ||
"jquery" | ||
], | ||
"homepage": "https://github.com/kartik-v/yii2-tree-manager", | ||
"type": "yii2-extension", | ||
"license": "BSD-3-Clause", | ||
"authors": [ | ||
{ | ||
"name": "Kartik Visweswaran", | ||
"email": "[email protected]", | ||
"homepage": "http://www.krajee.com/" | ||
} | ||
], | ||
"require": { | ||
"kartik-v/yii2-krajee-base": ">=3.0.4", | ||
"kartik-v/yii2-widget-activeform": ">=1.6.2", | ||
"creocoder/yii2-nested-sets": ">=0.9", | ||
"kartik-v/yii2-dialog": ">=1.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"kartik\\tree\\": "src" | ||
} | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.1.x-dev" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,81 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2019 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2022 | ||
* @package yii2-tree | ||
* @version 1.1.3 | ||
*/ | ||
|
||
namespace kartik\tree; | ||
|
||
use Yii; | ||
use yii\helpers\Url; | ||
use yii\helpers\ArrayHelper; | ||
use yii\web\Application as WebApplication; | ||
|
||
/** | ||
* The tree management module for Yii Framework 2.0. | ||
* Module is the tree management module for Yii Framework 2.0 that enables the [[TreeView]] widget functionality. | ||
* | ||
* To use, configure the module named `treemanager` in the modules section of your Yii configuration file. | ||
* | ||
* For example, | ||
* | ||
* ```php | ||
* 'modules' => [ | ||
* 'treemanager' => [ | ||
* 'class' => '\kartik\tree\Module', | ||
* // other module settings, refer detailed documentation | ||
* ] | ||
* ] | ||
* ``` | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @since 1.0 | ||
*/ | ||
class Module extends \kartik\base\Module | ||
{ | ||
/** | ||
* The module name for Krajee treeview | ||
* @var string module name for the Krajee Tree management module | ||
*/ | ||
const MODULE = 'treemanager'; | ||
/** | ||
* Manage node action | ||
* @var string manage node action | ||
*/ | ||
const NODE_MANAGE = 'manage'; | ||
/** | ||
* Remove node action | ||
* @var string remove node action | ||
*/ | ||
const NODE_REMOVE = 'remove'; | ||
/** | ||
* Move node action | ||
* @var string move node action | ||
*/ | ||
const NODE_MOVE = 'move'; | ||
/** | ||
* Save node action | ||
* @var string save node action | ||
*/ | ||
const NODE_SAVE = 'save'; | ||
/** | ||
* Tree details form view - Section Part 1 | ||
* @var int section part 1 of the tree details form view | ||
*/ | ||
const VIEW_PART_1 = 1; | ||
/** | ||
* Tree details form view - Section Part 2 | ||
* @var int section part 2 of the tree details form view | ||
*/ | ||
const VIEW_PART_2 = 2; | ||
/** | ||
* Tree details form view - Section Part 3 | ||
* @var int section part 3 of the tree details form view | ||
*/ | ||
const VIEW_PART_3 = 3; | ||
/** | ||
* Tree details form view - Section Part 4 | ||
* @var int section part 4 of the tree details form view | ||
*/ | ||
const VIEW_PART_4 = 4; | ||
/** | ||
* Tree details form view - Section Part 5 | ||
* @var int section part 5 of the tree details form view | ||
*/ | ||
const VIEW_PART_5 = 5; | ||
|
||
/** | ||
* @var array the configuration of nested set attributes structure | ||
* @var array the configuration of nested set attributes structure. | ||
*/ | ||
public $treeStructure = []; | ||
|
||
|
@@ -124,8 +138,7 @@ public function init() | |
'iconTypeAttribute' => 'icon_type' | ||
]; | ||
$nodeActions = ArrayHelper::getValue($this->treeViewSettings, 'nodeActions', []); | ||
// prepends Error in Console Applications | ||
if (\Yii::$app instanceof \yii\web\Application) { | ||
if (Yii::$app instanceof WebApplication) { | ||
$nodeActions += [ | ||
self::NODE_MANAGE => Url::to(['/treemanager/node/manage']), | ||
self::NODE_SAVE => Url::to(['/treemanager/node/save']), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2019 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2022 | ||
* @package yii2-tree-manager | ||
* @version 1.1.3 | ||
*/ | ||
|
@@ -19,7 +19,8 @@ | |
use yii\console\Application; | ||
|
||
/** | ||
* Tree data security and data hashing helper class | ||
* Tree data security and data hashing helper class. This class and its methods are used by the [[TreeView]] | ||
* widget to manage data transfer between the client and the server in a secure way. | ||
* | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @since 1.0 | ||
|
Oops, something went wrong.