Refactor Blueprints object creation

This commit is contained in:
Matias Griese
2016-02-19 11:56:09 +02:00
parent 989f5bb129
commit 0b53d39cdb
4 changed files with 5 additions and 7 deletions

View File

@@ -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.
*

View File

@@ -21,7 +21,7 @@ class Blueprints
/**
* @param string|array $search Search path.
*/
public function __construct($search)
public function __construct($search = 'blueprints://')
{
$this->search = $search;
}

View File

@@ -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");

View File

@@ -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);