public function Index() { AssetLoadManager::register('tableList'); $vo_dm = Datamodel::load(); $va_elements = ca_metadata_elements::getRootElementsAsList(null, null, true, true); $this->view->setVar('element_list', $va_elements); $this->view->setVar('attribute_types', Attribute::getAttributeTypes()); $o_result_context = new ResultContext($this->request, $this->ops_table_name, 'basic_search'); $o_result_context->setResultList(array_keys($va_elements)); $o_result_context->setAsLastFind(); $o_result_context->saveContext(); return $this->render('elements_list_html.php'); }
public static function getValueInstance($pn_datatype, $pa_value_array = null, $pb_use_cache = false) { if ($pb_use_cache && Attribute::$s_instance_cache[$pn_datatype]) { return Attribute::$s_instance_cache[$pn_datatype]; } $va_types = Attribute::getAttributeTypes(); if (isset($va_types[$pn_datatype])) { // we look for a class in lib/ca/Attributes/Values with the datatype name + 'AttributeValue' $vs_classname = $va_types[$pn_datatype] . 'AttributeValue'; if (!class_exists($vs_classname)) { if (!file_exists(__CA_LIB_DIR__ . '/ca/Attributes/Values/' . $vs_classname . '.php')) { return null; } include_once __CA_LIB_DIR__ . '/ca/Attributes/Values/' . $vs_classname . '.php'; } return Attribute::$s_instance_cache[$pn_datatype] = new $vs_classname($pa_value_array); } return null; }