コード例 #1
0
ファイル: editform.php プロジェクト: nobelium/pragyan
function generateFormElementDescBody($moduleCompId, $action = 'editform')
{
    global $sourceFolder, $cmsFolder;
    global $templateFolder;
    global $moduleFolder;
    global $urlRequestRoot;
    $imagePath = "{$urlRequestRoot}/{$cmsFolder}/{$templateFolder}";
    $calpath = "{$urlRequestRoot}/{$cmsFolder}/{$moduleFolder}";
    $elementsQuery = "SELECT * FROM `form_elementdesc` WHERE `page_modulecomponentid` =  '{$moduleCompId}' ORDER BY `form_elementrank` ASC";
    $elementsResult = mysql_query($elementsQuery) or die(mysql_error());
    $elementData = '';
    while ($elementsRow = mysql_fetch_assoc($elementsResult)) {
        $tmpElement = new FormElement();
        $tmpElement->fromMysqlTableRow($elementsRow);
        $elementData .= $tmpElement->toHtmlTableRow($imagePath, $action) . "\n";
    }
    $formElementDescBody = <<<BODY
\t\t<h2>Fields:</h2>
\t\t<form id="formentries" action="./+{$action}" method="POST">
\t\t\t<table cellpadding="1" cellspacing="1" border="1">
\t\t\t\t<tr>
\t\t\t\t\t<th>Actions</th>
\t\t\t\t\t
\t\t\t\t\t<th>Name</th>
\t\t\t\t\t<th>Description</th>
\t\t\t\t\t<th>Type</th>
\t\t\t\t\t<th>Tooltip</th>
\t\t\t\t\t<th>Other Information</th>
\t\t\t\t\t<th title="Only in the case of radio, check or select element type">Extra options*</th>
\t\t\t\t
\t\t\t\t</tr>
\t\t\t\t\t{$elementData}
\t\t\t\t</tr>
\t\t\t</table>

\t\t<input type="submit" name="addformelement_descsubmit" value="Add Element">

\t\t</form>
BODY;
    return $formElementDescBody;
}