コード例 #1
0
ファイル: editformelement.php プロジェクト: ksb1712/pragyan
/**
 * @package pragyan
 * @copyright (c) 2008 Pragyan Team
 * @license http://www.gnu.org/licenses/ GNU Public License
 * For more details, see README
 */
function generateEditFormElementDescBody($moduleCompId, $elementId, $action = 'editform')
{
    $myElement = new FormElement();
    $elementQuery = 'SELECT * FROM `form_elementdesc` WHERE ' . '`page_modulecomponentid` = \'' . $moduleCompId . '\' AND ' . '`form_elementid` = \'' . $elementId . "'";
    if ($elementResult = mysql_query($elementQuery)) {
        if ($elementRow = mysql_fetch_assoc($elementResult)) {
            $myElement->fromMysqlTableRow($elementRow);
            return $myElement->toHtmlForm('elementDataForm', $action);
        }
    }
    return 'An error occurred while trying to process your request. ' . 'Could not load data for the given form element.';
}
コード例 #2
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;
}