Esempio n. 1
0
    $replaceFields['default'] = $replaceFields['default'] === false ? 'false' : $replaceFields['default'];
    $replaceFields['default'] = $replaceFields['default'] === true ? 'true' : $replaceFields['default'];
    $row = str_replace($findFields, $replaceFields, $rowTpl);
    $rows .= $row;
    /* add to properties comment */
    $settingsComment .= ' * @property &' . $setting['key'] . ' ' . $setting['xtype'];
    $settingsComment .= ' -- ' . $fields['desc'] . '; Default: ';
    $settingsComment .= empty($fields['default']) ? '(empty).' : $fields['default'];
    $settingsComment .= ".\n";
}
$output = str_replace('[[+rows]]', $rows, $tableTpl);
if ($rewriteCodeFile && !empty($codeFile)) {
    $content = file_get_contents($codeFile);
    $count = 0;
    if (!empty($content) && !empty($settingsComment)) {
        $settingsComment = wrapComment($settingsComment);
        $content = str_replace('[[+properties]]', "Properties:\n" . $settingsComment, $content, $count);
        /* write settings to transport file; this should only happen if they're
         * not there already */
        if ($count == 1) {
            $fp = fopen($codeFile, 'w');
            fwrite($fp, $content);
            fclose($fp);
            $settingsInjected = true;
            //echo $content;
        } else {
            $settingsInjected = false;
        }
    }
}
$output .= "\n\n/* Properties\n\n";
        $replaceFields['default'] = '<fixedpre>' . $haystack . '</fixedpre>';
    }
    $row = str_replace($findFields, $replaceFields, $rowTpl);
    $rows .= $row;
    /* add to properties comment */
    $propertiesComment .= ' * @property &' . $property['name'] . ' ' . $property['type'];
    $propertiesComment .= ' -- ' . $fields['desc'] . '; Default: ';
    $propertiesComment .= empty($fields['default']) ? '(empty).' : $fields['default'];
    $propertiesComment .= ".\n";
}
$output = str_replace('[[+rows]]', $rows, $tableTpl);
if ($rewriteCodeFile && !empty($codeFile)) {
    $content = file_get_contents($codeFile);
    $count = 0;
    if (!empty($content) && !empty($propertiesComment)) {
        $propertiesComment = wrapComment($propertiesComment);
        $content = str_replace('[[+properties]]', "Properties:\n" . $propertiesComment, $content, $count);
        if ($count == 1) {
            $fp = fopen($codeFile, 'w');
            fwrite($fp, $content);
            fclose($fp);
            $propertiesInjected = true;
            //echo $content;
        } else {
            $propertiesInjected = false;
        }
    }
}
$output .= "\n\n/* Properties\n\n";
$output .= $propertiesComment;
$output .= "\n */\n";