}); if ($list) { macro_error('Controller class \'' . $targetOneShort . '\' already exists (' . implode('; ', $list) . ')'); } // --search $searchFields = $searchFields ? array_map('trim', explode(',', $searchFields)) : array(); foreach ($searchFields as $field) { if (!in_array($field, $keys)) { macro_error('Field \'' . $field . '\' marked as searchable and it not ofund'); } } // --sort $sortFields = $sortFields ? array_map('trim', explode(',', $sortFields)) : array(); foreach ($sortFields as $field) { if (!in_array($field, $keys)) { macro_error('Field \'' . $field . '\' marked as sortable and it not ofund'); } } // }}} // {{{ Define all variables $type2fields = array('text' => 'XLite\\View\\FormField\\Textarea\\Simple', 'integer' => 'XLite\\View\\FormField\\Input\\Text\\Integer', 'uinteger' => 'XLite\\View\\FormField\\Input\\Text\\Integer', 'float' => 'XLite\\View\\FormField\\Input\\Text\\Float', 'money' => 'XLite\\View\\FormField\\Input\\Text\\Price', 'boolean' => 'XLite\\View\\FormField\\Input\\Checkbox\\Enabled'); $type2inlineFields = array('integer' => 'XLite\\View\\FormField\\Inline\\Input\\Text\\Integer', 'uinteger' => 'XLite\\View\\FormField\\Inline\\Input\\Text\\Integer', 'float' => 'XLite\\View\\FormField\\Inline\\Input\\Text\\Float', 'money' => 'XLite\\View\\FormField\\Inline\\Input\\Text\\Price'); $entityHumanReadable = macro_convert_camel_to_human_readable($entityRelativeClass); $itemsListClass = macro_assemble_class_name('View\\ItemsList\\Model\\' . $entityRelativeClass, $moduleAuthor, $moduleName); $itemsListViewList = $moduleAuthor ? strtolower($moduleAuthor . '.' . $moduleName) . '.' . $target . '.list' : $target . '.list'; // }}} // {{{ Build list echo 'Build list' . PHP_EOL; // {{{ List controller echo "\t" . 'controller ' . $targetControllerPath . ' ... '; $targetHumanReadableName = macro_convert_camel_to_human_readable($target);
/** * Check module name * * @param string $author Author * @param string $module Name * * @return void * @see ____func_see____ * @since 1.0.18 */ function macro_check_module($author, $module) { if (!$author) { macro_error('\'module_author\' argument is empty!'); } if (!$module) { macro_error('\'module_name\' argument is empty!'); } }