From 3d74f2a99bc21346dcc8acea73f5f1078953140f Mon Sep 17 00:00:00 2001 From: Slava Petrov Date: Wed, 23 Oct 2013 10:09:28 +0400 Subject: [PATCH] [+] Added --module parameter --- devkit/macros/create-crud-list.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/devkit/macros/create-crud-list.php b/devkit/macros/create-crud-list.php index 6f8f2a4..7100395 100755 --- a/devkit/macros/create-crud-list.php +++ b/devkit/macros/create-crud-list.php @@ -45,6 +45,7 @@ $sortFields = macro_get_named_argument('sort'); $createInline = !is_null(macro_get_named_argument('createInline')); $menu = macro_get_named_argument('menu'); +$module = macro_get_named_argument('module'); // {{{ Check arguments @@ -81,7 +82,7 @@ $moduleAuthor = null; $moduleName = null; -if (preg_match('/XLite\\\Module\\\([a-z0-9]+)\\\([a-z0-9]+)\\\Model/iSs', $entityClass, $match)) { +if (preg_match('/([a-z0-9]+)\\\([a-z0-9]+)/iSs', $module, $match) or preg_match('/XLite\\\Module\\\([a-z0-9]+)\\\([a-z0-9]+)\\\Model/iSs', $entityClass, $match)) { $moduleAuthor = $match[1]; $moduleName = $match[2]; } @@ -1995,7 +1996,10 @@ function macro_help() --menu=section Create menu section item. Default - no -Example: .dev/macro/$script --entity=XLite\\Module\\Developer\\Example\\Model\\Message --fields=subject --edit=subject --removable --search=subject --headSearch --pagintation --sort=subject --menu=catalog + --module=target_module + Identifiers of the module and its author. Default - taken from the --entity parameter. + +Example: .dev/macro/$script --entity=XLite\\Module\\Developer\\Example\\Model\\Message --fields=subject --edit=subject --removable --search=subject --headSearch --pagintation --sort=subject --menu=catalog --module=Developer\\MyModule HELP; }