diff --git a/assets/plugins/managermanager/default.mm_rules.inc.php b/assets/plugins/managermanager/default.mm_rules.inc.php index d8edc7a..a60e104 100644 --- a/assets/plugins/managermanager/default.mm_rules.inc.php +++ b/assets/plugins/managermanager/default.mm_rules.inc.php @@ -1,4 +1,5 @@ \ No newline at end of file diff --git a/assets/plugins/managermanager/example.mm_rules.inc.php b/assets/plugins/managermanager/example.mm_rules.inc.php index b9da60a..e37951c 100644 --- a/assets/plugins/managermanager/example.mm_rules.inc.php +++ b/assets/plugins/managermanager/example.mm_rules.inc.php @@ -1,4 +1,5 @@ db->makeArray($modx->db->select('name,type,id', $modx->db->config['table_prefix'].'site_tmplvars', '', 'name ASC')); +$all_tvs = $modx->db->makeArray($modx->db->select('name,type,id,elements', $modx->getFullTableName('site_tmplvars'), '', 'name ASC')); foreach ($all_tvs as $thisTv){ // What is the field name? $n = $thisTv['name']; @@ -129,7 +129,6 @@ case 'rawtextarea': case 'textareamini': case 'richtext': - case 'custom_tv': $t = 'textarea'; break; @@ -148,6 +147,31 @@ $fieldname_suffix = '[]'; break; + case 'custom_tv': + if(strpos($thisTv['elements'],'tvtype="text"')!==false) + $t = 'input'; + elseif(strpos($thisTv['elements'],'tvtype="textarea"')!==false) + $t = 'textarea'; + elseif(strpos($thisTv['elements'],'tvtype="select"')!==false) + $t = 'select'; + elseif(strpos($thisTv['elements'],'tvtype="checkbox"')!==false) + { + $t = 'input'; + $fieldname_suffix = '[]'; + } + elseif(strpos($thisTv['elements'],'