public function __construct($query) { $this->query = $query; // Get all structures $this->structures = Schema::getMaterialSchema(); // Add structures which not assign to material $this->structures = array_merge($this->structures, Schema::getControlSchema()); }
/** * Render elements on the tabs if exists * @param $materialId * @param $structureId * @param $content */ public function renderContentElement($materialId, $structureId, &$content) { // Iterate all control schemas and get some element foreach (Schema::getControlSchema() as $schema) { if ($schema->getStructureId() == $structureId) { // Render elements if exists $isElements = isset($schema->elements) && !empty($schema->elements); // If exists elements on the tab then show their if ($isElements) { // Create element instance $elements = new Element(); // Render elements of control tab $contentNestedElement = $elements->renderNestedElements($schema->elements); // Insert element as first child of table $content = preg_replace('/\\<div class=\\"material_table_tab\\"\\>/', '<div class="material_table_tab">' . $contentNestedElement, $content, 1); // Get all not nested element //$contentNotNestedElement = $elements->renderNotNestedElements($schema->elements); } } } }