| @@ 669-688 (lines=20) @@ | ||
| 666 | ||
| 667 | // setup chunks template files - array : name, description, type - 0:file or 1:content, file or content |
|
| 668 | $mc = &$moduleChunks; |
|
| 669 | if (is_dir($chunkPath) && is_readable($chunkPath)) { |
|
| 670 | $d = dir($chunkPath); |
|
| 671 | while (false !== ($tplfile = $d->read())) { |
|
| 672 | if (substr($tplfile, -4) != '.tpl') { |
|
| 673 | continue; |
|
| 674 | } |
|
| 675 | $params = parse_docblock($chunkPath, $tplfile); |
|
| 676 | if (is_array($params) && count($params) > 0) { |
|
| 677 | $mc[] = array( |
|
| 678 | $params['name'], |
|
| 679 | $params['description'], |
|
| 680 | "$chunkPath/{$params['filename']}", |
|
| 681 | $params['modx_category'], |
|
| 682 | array_key_exists('overwrite', $params) ? $params['overwrite'] : 'true', |
|
| 683 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false |
|
| 684 | ); |
|
| 685 | } |
|
| 686 | } |
|
| 687 | $d->close(); |
|
| 688 | } |
|
| 689 | ||
| 690 | // setup snippets template files - array : name, description, type - 0:file or 1:content, file or content,properties |
|
| 691 | $ms = &$moduleSnippets; |
|
| @@ 86-105 (lines=20) @@ | ||
| 83 | ||
| 84 | // setup chunks template files - array : name, description, type - 0:file or 1:content, file or content |
|
| 85 | $mc = &$moduleChunks; |
|
| 86 | if (is_dir($chunkPath) && is_readable($chunkPath)) { |
|
| 87 | $d = dir($chunkPath); |
|
| 88 | while (false !== ($tplfile = $d->read())) { |
|
| 89 | if (substr($tplfile, -4) != '.tpl') { |
|
| 90 | continue; |
|
| 91 | } |
|
| 92 | $params = parse_docblock($chunkPath, $tplfile); |
|
| 93 | if (is_array($params) && count($params) > 0) { |
|
| 94 | $mc[] = array( |
|
| 95 | $params['name'], |
|
| 96 | $params['description'], |
|
| 97 | "$chunkPath/{$params['filename']}", |
|
| 98 | $params['modx_category'], |
|
| 99 | array_key_exists('overwrite', $params) ? $params['overwrite'] : 'true', |
|
| 100 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false |
|
| 101 | ); |
|
| 102 | } |
|
| 103 | } |
|
| 104 | $d->close(); |
|
| 105 | } |
|
| 106 | ||
| 107 | // setup snippets template files - array : name, description, type - 0:file or 1:content, file or content,properties |
|
| 108 | $ms = &$moduleSnippets; |
|