public function add_attribute_type() { $pat = PendingAttributeType::getByHandle($this->post('atHandle')); if (is_object($pat)) { $pat->install(); } $this->redirect('dashboard/system/attributes/types', 'saved', 'attribute_type_added'); }
public static function getList() { $db = Loader::db(); $atHandles = $db->GetCol("select atHandle from AttributeTypes"); $dh = Loader::helper('file'); $available = array(); if (is_dir(DIR_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES)) { $contents = $dh->getDirectoryContents(DIR_MODELS . '/' . DIRNAME_ATTRIBUTES . '/' . DIRNAME_ATTRIBUTE_TYPES); foreach($contents as $atHandle) { if (!in_array($atHandle, $atHandles)) { $available[] = PendingAttributeType::getByHandle($atHandle); } } } return $available; }