default path when create a new subviews

This commit is contained in:
aina-esokia
2018-07-16 16:29:27 +04:00
parent 57bc44e0d6
commit 36423a9b39
2 changed files with 15 additions and 0 deletions

View File

@@ -1473,6 +1473,16 @@ class databox extends base implements ThumbnailedElement
];
}
/**
* Return the default subdef path
*
* @return string
*/
public function getSubdefStorage(){
return p4string::addEndSlash($this->app['conf']->get(['main', 'storage', 'subdefs'])).$this->get_dbname()."/subdefs/";
}
protected function retrieve_structure()
{
try {

View File

@@ -202,6 +202,11 @@ class databox_subdefsStructure implements IteratorAggregate, Countable
$mediaTypeElement->appendChild($dom_struct->createTextNode($mediatype));
$subdef->appendChild($mediaTypeElement);
$defaultPath = $this->databox->getSubdefStorage();
$pathElement = $dom_struct->createElement('path');
$pathElement->appendChild($dom_struct->createTextNode($defaultPath));
$subdef->appendChild($pathElement);
$dom_xp = $this->databox->get_xpath_structure();
$query = '//record/subdefs/subdefgroup[@name="' . $groupname . '"]';
$groups = $dom_xp->query($query);