本文整理汇总了PHP中FormElement::fromMysqlTableRow方法的典型用法代码示例。如果您正苦于以下问题:PHP FormElement::fromMysqlTableRow方法的具体用法?PHP FormElement::fromMysqlTableRow怎么用?PHP FormElement::fromMysqlTableRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormElement
的用法示例。
在下文中一共展示了FormElement::fromMysqlTableRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateEditFormElementDescBody
/**
* @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: generateFormElementDescBody
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;
}