mirror of
https://github.com/getgrav/grav.git
synced 2026-02-04 05:40:09 +01:00
Refactor Blueprints object creation
This commit is contained in:
@@ -40,7 +40,6 @@ class Blueprint extends BaseBlueprints implements ExportInterface
|
||||
|
||||
if ($data) {
|
||||
$this->embed('', $data);
|
||||
$this->init('static');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +56,6 @@ class Blueprint extends BaseBlueprints implements ExportInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get meta value by using dot notation for nested arrays/objects.
|
||||
*
|
||||
|
||||
@@ -21,7 +21,7 @@ class Blueprints
|
||||
/**
|
||||
* @param string|array $search Search path.
|
||||
*/
|
||||
public function __construct($search)
|
||||
public function __construct($search = 'blueprints://')
|
||||
{
|
||||
$this->search = $search;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ class Group extends Data
|
||||
$content = [];
|
||||
}
|
||||
|
||||
$blueprints = new Blueprints('blueprints://');
|
||||
$blueprints = new Blueprints;
|
||||
$blueprint = $blueprints->get('user/group');
|
||||
if (!isset($content['groupname'])) {
|
||||
$content['groupname'] = $groupname;
|
||||
@@ -71,7 +71,7 @@ class Group extends Data
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$blueprints = new Blueprints('blueprints://');
|
||||
$blueprints = new Blueprints;
|
||||
$blueprint = $blueprints->get('user/group');
|
||||
|
||||
$fields = $blueprint->fields();
|
||||
@@ -114,7 +114,7 @@ class Group extends Data
|
||||
*/
|
||||
public static function remove($groupname)
|
||||
{
|
||||
$blueprints = new Blueprints('blueprints://');
|
||||
$blueprints = new Blueprints;
|
||||
$blueprint = $blueprints->get('user/group');
|
||||
|
||||
$groups = self::getGrav()['config']->get("groups");
|
||||
|
||||
@@ -36,7 +36,7 @@ class User extends Data
|
||||
// force lowercase of username
|
||||
$username = strtolower($username);
|
||||
|
||||
$blueprints = new Blueprints('blueprints://');
|
||||
$blueprints = new Blueprints;
|
||||
$blueprint = $blueprints->get('user/account');
|
||||
$file_path = $locator->findResource('account://' . $username . YAML_EXT);
|
||||
$file = CompiledYamlFile::instance($file_path);
|
||||
|
||||
Reference in New Issue
Block a user