当前位置: 首页>>代码示例>>PHP>>正文


PHP module_form::generate_form_element方法代码示例

本文整理汇总了PHP中module_form::generate_form_element方法的典型用法代码示例。如果您正苦于以下问题:PHP module_form::generate_form_element方法的具体用法?PHP module_form::generate_form_element怎么用?PHP module_form::generate_form_element使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在module_form的用法示例。


在下文中一共展示了module_form::generate_form_element方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _l

                                    </td>
                                    <?php 
        if ($show_task_dates) {
            ?>

                                    <td>
                                    </td>
                                    <?php 
        }
        ?>

                                    <td colspan="2">
                                        <?php 
        $types = module_job::get_task_types();
        $types['-1'] = _l('Default (%s)', $types[$invoice['default_task_type']]);
        module_form::generate_form_element(array('type' => 'select', 'name' => 'invoice_invoice_item[' . $invoice_item_id . '][manual_task_type]', 'id' => 'manual_task_type_' . $invoice_item_id, 'options' => $types, 'blank' => false, 'value' => $invoice_item_data['manual_task_type_real']));
        ?>

                                    </td>
                                    <td colspan="2">
                                        <input type="hidden" name="invoice_invoice_item[<?php 
        echo $invoice_item_id;
        ?>
][taxable_t]" value="1">
                                        <input type="checkbox" name="invoice_invoice_item[<?php 
        echo $invoice_item_id;
        ?>
][taxable]" id="invoice_taxable_item_<?php 
        echo $invoice_item_id;
        ?>
" value="1" <?php 
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:invoice_admin_edit.php

示例2: print_date

                    <td>
                        <?php 
    if (file_exists('includes/plugin_invoice/pages/invoice_recurring.php')) {
        ?>

                        <input type="text" name="date_renew" class="date_field" value="<?php 
        echo print_date($job['date_renew']);
        ?>
">
                        <br/>
                        <?php 
        $element = array('type' => 'checkbox', 'name' => 'renew_auto', 'value' => isset($job['renew_auto']) && $job['renew_auto'], 'label' => 'Automatically Renew', 'help' => 'This Job will be automatically renewed on this date. A new Job will be created as a copy from this Job.');
        module_form::generate_form_element($element);
        echo '<br/>';
        $element = array('type' => 'checkbox', 'name' => 'renew_invoice', 'value' => isset($job['renew_invoice']) && $job['renew_invoice'], 'label' => 'Automatically Invoice', 'help' => 'When this Job is renewed the tasks will be automatically completed and an invoice will be automatically created and emailed to the customer.');
        module_form::generate_form_element($element);
    } else {
        ?>

                            (recurring jobs available in <a href="http://codecanyon.net/item/ultimate-client-manager-pro-edition/2621629?ref=dtbaker" target="_blank">UCM Pro Edition</a>)
                            <?php 
    }
    ?>

                    </td>

                    <tr>
                        <th>
                            <?php 
    _e('Task Type');
    ?>
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:job_admin_create.php

示例3: print_search_bar

    public static function print_search_bar($owner_table, $options = array())
    {
        // let the themes override this search bar function.
        if (self::can_i('view', 'Extra Fields')) {
            $result = hook_handle_callback('extra_fields_search_bar', $owner_table, $options);
            if (is_array($result)) {
                // has been handed by a theme.
                echo current($result);
            } else {
                $defaults = self::get_defaults($owner_table);
                $searchable_fields = array();
                foreach ($defaults as $default) {
                    if (isset($default['searchable']) && $default['searchable']) {
                        $searchable_fields[$default['key']] = $default;
                    }
                }
                foreach ($searchable_fields as $searchable_field) {
                    ?>

                    <td class="search_title">
                        <?php 
                    echo htmlspecialchars($searchable_field['key']);
                    ?>
:
                    </td>
                    <td class="search_input">
                        <?php 
                    module_form::generate_form_element(array('type' => 'text', 'name' => 'search[extra_fields][' . htmlspecialchars($searchable_field['key']) . ']'));
                    ?>

                    </td>
                    <?php 
                }
            }
        }
    }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:36,代码来源:extra.php

示例4: get_form_element


//.........这里部分代码省略.........
                            $new_attributes = array();
                            foreach ($attributes as $aid => $a) {
                                $new_attributes[$aid + 1] = $a;
                            }
                            $attributes = $new_attributes;
                        }
                        if (isset($attributes[$value])) {
                            echo $attributes[$value];
                        }
                        break;
                    case 'textarea':
                    case 'textbox':
                        echo nl2br(htmlspecialchars($value));
                        break;
                    case 'file':
                        if ($value) {
                            $file_data = @unserialize($value);
                            $file_link = 'includes/plugin_data/upload/' . $file_data['file'];
                            if (is_file($file_link)) {
                                $download_link = self::link_public_file_download($data_record['data_record_id'], $data_record['data_type_id'], $element['data_field_group_id'], $element['data_field_id']);
                                echo '<a href="' . $download_link . '" target="_blank">' . $file_data['name'] . '</a>';
                            } else {
                                echo 'File Not Found';
                            }
                        }
                        break;
                    case 'wysiwyg':
                        echo module_security::purify_html($value);
                        break;
                    case 'encrypted':
                        if (class_exists('module_encrypt', false)) {
                            ob_start();
                            $element['type'] = 'text';
                            module_form::generate_form_element($element);
                            $enc_html = ob_get_clean();
                            echo module_encrypt::parse_html_input('custom_data', $enc_html, false);
                        }
                        break;
                    case 'created_date_time':
                        echo isset($data_record['date_created']) && $data_record['date_created'] != '0000-00-00 00:00:00' ? print_date($data_record['date_created'], true) : _l('N/A');
                        break;
                    case 'created_date':
                        echo isset($data_record['date_created']) && $data_record['date_created'] != '0000-00-00 00:00:00' ? print_date($data_record['date_created'], false) : _l('N/A');
                        break;
                    case 'created_time':
                        echo isset($data_record['date_created']) && $data_record['date_created'] != '0000-00-00 00:00:00' ? date(module_config::c('time_format', 'g:ia'), strtotime($data_record['date_created'])) : _l('N/A');
                        break;
                    case 'updated_date_time':
                        echo isset($data_record['date_updated']) && $data_record['date_updated'] != '0000-00-00 00:00:00' ? print_date($data_record['date_updated'], true) : (isset($data_record['date_created']) && $data_record['date_created'] != '0000-00-00 00:00:00' ? print_date($data_record['date_created'], true) : _l('N/A'));
                        break;
                    case 'updated_date':
                        echo isset($data_record['date_updated']) && $data_record['date_updated'] != '0000-00-00 00:00:00' ? print_date($data_record['date_updated'], false) : (isset($data_record['date_created']) && $data_record['date_created'] != '0000-00-00 00:00:00' ? print_date($data_record['date_created'], false) : _l('N/A'));
                        break;
                    case 'updated_time':
                        echo isset($data_record['date_updated']) && $data_record['date_updated'] != '0000-00-00 00:00:00' ? date(module_config::c('time_format', 'g:ia'), strtotime($data_record['date_updated'])) : (isset($data_record['date_created']) && $data_record['date_created'] != '0000-00-00 00:00:00' ? date(module_config::c('time_format', 'g:ia'), strtotime($data_record['date_created'])) : _l('N/A'));
                        break;
                    case 'created_by':
                        echo isset($data_record['create_user_id']) && (int) $data_record['create_user_id'] > 0 ? module_user::link_open($data_record['create_user_id'], true) : _l('N/A');
                        break;
                    case 'updated_by':
                        echo isset($data_record['update_user_id']) && (int) $data_record['update_user_id'] > 0 ? module_user::link_open($data_record['update_user_id'], true) : (isset($data_record['create_user_id']) && (int) $data_record['create_user_id'] > 0 ? module_user::link_open($data_record['create_user_id'], true) : _l('N/A'));
                        break;
                    case 'url':
                        echo '<a href="' . htmlspecialchars($value) . '" target="_blank">' . htmlspecialchars($value) . '</a>';
                        break;
                    default:
开发者ID:sgh1986915,项目名称:php-crm,代码行数:67,代码来源:data.php

示例5: foreach

             <input type="file" name="csv">
         </td>
     </tr>
     <?php 
 if (isset($import_options['options']) && is_array($import_options['options'])) {
     foreach ($import_options['options'] as $option_id => $option_values) {
         ?>
         <tr>
             <th>
                 <?php 
         echo $option_values['label'];
         ?>
             </th>
             <td>
                 <?php 
         module_form::generate_form_element($option_values['form_element']);
         ?>
             </td>
         </tr>
         <?php 
     }
 }
 ?>
     <?php 
 if (class_exists('module_group', false) && isset($import_options['group']) && $import_options['group']) {
     // hack to support multiple groups (for members)
     if (!is_array($import_options['group'])) {
         $import_options['group'] = array($import_options['group']);
     }
     foreach ($import_options['group'] as $group_option) {
         ?>
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:import.php

示例6: metis_generate_form_actions

function metis_generate_form_actions($callback, $options)
{
    $defaults = array('type' => 'action_bar', 'class' => 'action_bar', 'elements' => array());
    $options = array_merge($defaults, $options);
    //todo - hook in here for themes.
    ob_start();
    ?>
        <div class="action_bar_duplicate <?php 
    echo $options['class'];
    ?>
">
            <?php 
    foreach ($options['elements'] as $element) {
        if (is_array($element) && !is_array(current($element))) {
            $element = array($element);
        }
        $element['fields'] = $element;
        ?>
                <span class="action">
                    <?php 
        if (isset($element['fields'])) {
            ?>
                    <span class="action_element">
                        <?php 
            if (is_array($element['fields'])) {
                foreach ($element['fields'] as $dataid => $field) {
                    if (is_array($field)) {
                        // treat this as a call to the form generate option
                        switch ($field['type']) {
                            case 'save_button':
                                $field['type'] = 'submit';
                                $field['class'] = (isset($field['class']) ? $field['class'] . ' ' : '') . 'submit_button btn btn-success';
                                break;
                            case 'submit':
                                $field['type'] = 'submit';
                                $field['class'] = (isset($field['class']) ? $field['class'] . ' ' : '') . 'submit_button btn btn-default';
                                break;
                            case 'delete_button':
                                $field['type'] = 'submit';
                                $field['class'] = (isset($field['class']) ? $field['class'] . ' ' : '') . 'submit_button btn btn-danger';
                                break;
                            case 'button':
                                $field['type'] = 'button';
                                $field['class'] = (isset($field['class']) ? $field['class'] . ' ' : '') . 'submit_button btn btn-default';
                                break;
                        }
                        module_form::generate_form_element($field);
                        echo ' ';
                    } else {
                        echo $field . ' ';
                    }
                }
            } else {
                echo $element['fields'];
            }
            ?>
                    </span>
                <?php 
        }
        ?>
                </span>
            <?php 
    }
    ?>
        </div>
        <?php 
    return ob_get_clean();
}
开发者ID:sgh1986915,项目名称:php-crm,代码行数:68,代码来源:metis_functions.php

示例7: display_pagination_hook


//.........这里部分代码省略.........
            <span id="bulk_popdown" style="position: absolute; width: 200px; display: none; background: #EFEFEF; margin-left: -210px; margin-top: 30px; border: 1px solid #CCC; text-align: left; padding: 6px; z-index: 3;">
                <strong><?php 
            _e('Bulk actions:');
            ?>
</strong><br/>
                <?php 
            foreach (self::$pagination_options['bulk_actions'] as $bulk_action_id => $bulk_action_data) {
                switch ($bulk_action_data['type']) {
                    case 'delete':
                        ?>

                                    <input type="checkbox" class="bulk_action" name="bulk_action[<?php 
                        echo $bulk_action_id;
                        ?>
]" id="bulkchk<?php 
                        echo $bulk_action_id;
                        ?>
" value="yes">
                                    <label for="bulkchk<?php 
                        echo $bulk_action_id;
                        ?>
"><?php 
                        _e($bulk_action_data['label']);
                        ?>
</label> <br/>
                                <?php 
                        break;
                    case 'form':
                        ?>

                                    <input type="checkbox" class="bulk_action" name="bulk_action[<?php 
                        echo $bulk_action_id;
                        ?>
]" id="bulkchk<?php 
                        echo $bulk_action_id;
                        ?>
" value="yes">
                                    <label for="bulkchk<?php 
                        echo $bulk_action_id;
                        ?>
"><?php 
                        _e($bulk_action_data['label']);
                        ?>
</label>
	                                <?php 
                        if (isset($bulk_action_data['elements'])) {
                            foreach ($bulk_action_data['elements'] as $element) {
                                module_form::generate_form_element($element);
                            }
                        }
                        ?>
<br/>
                                <?php 
                        break;
                    default:
                        ?>

                                    <input type="checkbox" class="bulk_action" name="bulk_action[<?php 
                        echo $bulk_action_id;
                        ?>
]" id="bulkchk<?php 
                        echo $bulk_action_id;
                        ?>
" value="yes">
                                    <label for="bulkchk<?php 
                        echo $bulk_action_id;
                        ?>
"><?php 
                        _e($bulk_action_data['label']);
                        ?>
</label> <br/>
                                <?php 
                        break;
                }
                ?>


                        <?php 
            }
            ?>

                    <input type="hidden" name="bulk_action_go" id="bulk_action_go" value="">
                    <input type="button" name="bulk_action_button" id="bulk_action_button" value="<?php 
            _e('Perform Bulk Actions');
            ?>
">
                    <script type="text/javascript">
                        $(function(){
                            $('#bulk_action_button').click(function(){
                                $('#bulk_action_go').val('yes');
                                // todo: if no form, create one them submit.
                                $('#bulk_action_go').parents('form')[0].submit();
                            });
                        });
                    </script>
            </span>
            </span>
        <?php 
        }
    }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:101,代码来源:group.php

示例8: foreach

                                    </td>
                                </tr>
                                    <?php 
        foreach ($extras as $extra) {
            ?>

                                    <tr>
                                        <th nowrap="nowrap">
                                            <?php 
            echo htmlspecialchars($extra['key']);
            ?>

                                        </th>
                                        <td>
                                            <?php 
            module_form::generate_form_element(array('type' => $extra['type'], 'name' => 'ticket_extra[' . $extra['ticket_data_key_id'] . ']', 'value' => isset($_POST['ticket_extra']) && isset($_POST['ticket_extra'][$extra['ticket_data_key_id']]) ? $_POST['ticket_extra'][$extra['ticket_data_key_id']] : '', 'options' => isset($extra['options']) && $extra['options'] ? unserialize($extra['options']) : array()));
            if (class_exists('module_encrypt', false) && module_config::c('ticket_show_encrypt_fields', 1) && isset($extra['encrypt_key_id']) && $extra['encrypt_key_id'] && ($extra['type'] == 'text' || $extra['type'] == 'textarea')) {
                // hack to show the encrypt key icon if this is an encryptable key.
                echo '<img src="' . full_link('includes/plugin_encrypt/images/lock.png') . '" style="vertical-align:top;" border="0">';
                if (module_config::c('ticket_show_encrypt_fields_help_popup', 1)) {
                    _h('This field is encrypted in the database using industry standard RSA cryptography.');
                }
            }
            ?>

                                        </td>
                                    </tr>
                                    <?php 
        }
    }
}
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:ticket_customer_new.php

示例9: htmlspecialchars

    <input type="hidden" name="<?php 
        echo htmlspecialchars($key);
        ?>
" value="<?php 
        echo htmlspecialchars($val);
        ?>
">
    <?php 
    }
}
?>
    <?php 
if (isset($form_data[5]) && is_array($form_data[5]) && isset($form_data[5]['options'])) {
    foreach ($form_data[5]['options'] as $option) {
        echo htmlspecialchars($option['label']);
        module_form::generate_form_element($option);
        echo '<br/>';
    }
    ?>
    <?php 
}
?>

    <input type="hidden" name="really_confirm_delete" id="really_confirm_delete" value="">
    <?php 
$form_actions = array('class' => 'action_bar action_bar_center action_bar_single', 'elements' => array(array('type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Confirm Delete'), 'onclick' => "\$('#really_confirm_delete').val('yep');"), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . $form_data[3] . "'; return false;")));
echo module_form::generate_form_actions($form_actions);
?>
</form>

<?php 
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:confirm_delete.php

示例10: tinymce_blur

        ?>
");
			        }
			        <?php 
    }
    ?>


		        }
		        function tinymce_blur() {

		        }
	        </script>

	        <?php 
    module_form::generate_form_element(array('type' => 'wysiwyg', 'name' => 'new_ticket_message', 'value' => '', 'options' => array('inline' => false)));
    ?>

	        <table class="tableclass tableclass_full tableclass_form">
		        <tbody>

		        <?php 
    if (module_config::c('ticket_allow_attachment', 1)) {
        ?>

			        <tr>
				        <th>
					        <?php 
        _e('Add Attachment');
        ?>
开发者ID:sgh1986915,项目名称:php-crm,代码行数:30,代码来源:ticket_admin_edit_messages.php

示例11: array

        $extra_summary = array();
        foreach ($extras as $extra) {
            if (isset($ticket['extra_data'][$extra['ticket_data_key_id']]) && $ticket['extra_data'][$extra['ticket_data_key_id']]['value'] && strpos($ticket['extra_data'][$extra['ticket_data_key_id']]['value'], 'encrypt:') === false) {
                $extra_summary[] = $ticket['extra_data'][$extra['ticket_data_key_id']]['value'];
            }
        }
        $fieldset_data = array('heading' => array('title' => _l('Extra Information'), 'type' => 'h3', 'responsive' => array('summary' => implode(', ', $extra_summary))), 'elements' => array());
        foreach ($extras as $extra) {
            $fieldset_data['elements'][] = array('title' => htmlspecialchars($extra['key']), 'fields' => array(function () use($extra, $ticket) {
                // we do a hook in here with the encryption plugin.
                // if some of these fields are marked for encryption we display a nice lock
                // and some stars instead of the value.
                // if there isn't a value then we don't display any stars, just a lock symbol
                // we also have to show an "unlock" button so the admin can unlock the value.
                if (!isset($extras_editable) || $extras_editable) {
                    module_form::generate_form_element(array('type' => $extra['type'], 'name' => 'ticket_extra[' . $extra['ticket_data_key_id'] . ']', 'value' => isset($ticket['extra_data'][$extra['ticket_data_key_id']]) ? $ticket['extra_data'][$extra['ticket_data_key_id']]['value'] : '', 'options' => isset($extra['options']) && $extra['options'] ? unserialize($extra['options']) : array(), 'class' => 'no_permissions', 'encrypt' => class_exists('module_encrypt', false) && isset($extra['encrypt_key_id']) && $extra['encrypt_key_id'], 'page_name' => 'ticket_extras', 'id' => 'ticket_extras_' . $extra['ticket_data_key_id']));
                    if (preg_match('#(https?://[^\\s]*)$#', isset($ticket['extra_data'][$extra['ticket_data_key_id']]) ? $ticket['extra_data'][$extra['ticket_data_key_id']]['value'] : '', $matches)) {
                        ?>
 <a href="<?php 
                        echo htmlspecialchars($matches[1]);
                        ?>
" target="_blank"><?php 
                        _e('Open');
                        ?>
 &raquo;</a> <?php 
                    } else {
                        if (preg_match('#(www\\.[^\\s]*)$#', isset($ticket['extra_data'][$extra['ticket_data_key_id']]) ? $ticket['extra_data'][$extra['ticket_data_key_id']]['value'] : '', $matches)) {
                            ?>
 <a href="http://<?php 
                            echo htmlspecialchars($matches[1]);
                            ?>
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:ticket_extras_sidebar.php

示例12: htmlspecialchars

    /*echo $setting['key'];*/
    ?>
                </td>-->
                <th><?php 
    echo $setting['description'];
    ?>
</th>
                <td>

                    <?php 
    if ($setting['type'] == 'html') {
        echo $setting['html'];
    } else {
        $setting['name'] = 'config[' . $setting['key'] . ']';
        $setting['value'] = module_config::c($setting['key'], $setting['default']);
        module_form::generate_form_element($setting);
    }
    /*switch($setting['type']){
                            case 'number':
                            ?>
                                <input type="text" name="config[<?php echo $setting['key'];?>]" value="<?php echo htmlspecialchars(module_config::c($setting['key'],$setting['default']));?>" size="20">
                                <?php
                            break;
                            case 'text':
                            ?>
                                <input type="text" name="config[<?php echo $setting['key'];?>]" value="<?php echo htmlspecialchars(module_config::c($setting['key'],$setting['default']));?>" size="60">
                                <?php
                            break;
                            case 'textarea':
                            ?>
                                <textarea name="config[<?php echo $setting['key'];?>]" rows="6" cols="50"><?php echo htmlspecialchars(module_config::c($setting['key'],$setting['default']));?></textarea>
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:settings_form.php


注:本文中的module_form::generate_form_element方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。