示例#1
0
function create_form(&$data)
{
    foreach ($data as $element) {
        if (is_array($element)) {
            switch ($element[2]) {
                case 0:
                    form_input($element[0], $element[1], $element[3]);
                    break;
                case 1:
                    form_alb_list_box($element[0], $element[1]);
                    break;
                case 2:
                    form_textarea($element[0], $element[1], $element[3]);
                    break;
                case 3:
                    form_pic_info($element[0]);
                    break;
                default:
                    cpg_die(CRITICAL_ERROR, 'Invalid action for form creation', __FILE__, __LINE__);
            }
            // switch
        } else {
            form_label($element);
        }
    }
    // foreach
}
示例#2
0
$xoopsTpl->assign('lang_title', _MD_EDITPICS_TITLE);
$xoopsTpl->assign('lang_desc', _MD_EDITPICS_DESC);
$xoopsTpl->assign('lang_keywords', _MD_KEYS);
$xoopsTpl->assign('user1', $xoopsModuleConfig['user_field1_name']);
$xoopsTpl->assign('user2', $xoopsModuleConfig['user_field2_name']);
$xoopsTpl->assign('user3', $xoopsModuleConfig['user_field3_name']);
$xoopsTpl->assign('user4', $xoopsModuleConfig['user_field4_name']);
while ($CURRENT_PIC = $xoopsDB->fetchArray($result)) {
    if (USER_IS_ADMIN) {
        get_user_albums($CURRENT_PIC['owner_id']);
        //   $admin_mode=1;
    }
    //else $admin_mode=0;
    //$form.=create_form($data);
    form_alb_list_box();
    form_pic_info();
    ob_start();
    $GLOBALS["caption{$CURRENT_PIC['pid']}"] = $myts->makeTareaData4Edit($CURRENT_PIC['caption']);
    xoopsCodeTarea("caption{$CURRENT_PIC['pid']}", 37, 8);
    $xoops_codes = ob_get_contents();
    ob_end_clean();
    ob_start();
    xoopsSmilies("caption" . $CURRENT_PIC['pid']);
    $smilies = ob_get_contents();
    ob_end_clean();
    $value_field1 = $myts->makeTboxData4Edit($CURRENT_PIC['user1']);
    $name_field1 = 'user1' . $CURRENT_PIC['pid'];
    $value_field2 = $myts->makeTboxData4Edit($CURRENT_PIC['user2']);
    $name_field2 = 'user2' . $CURRENT_PIC['pid'];
    $value_field3 = $myts->makeTboxData4Edit($CURRENT_PIC['user3']);
    $name_field3 = 'user3' . $CURRENT_PIC['pid'];