コード例 #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.';
}