Exemple #1
0
        $_options[$format->slug] = $format->label . ' (' . $format->example . ')';
    }
    echo form_field_dropdown($_field, $_options, lang('accounts_edit_basic_field_time_format_tip'));
} else {
    echo form_hidden($_field['key'], $_field['default']);
}
// --------------------------------------------------------------------------
//	Preferred Language
$_field = array();
$_field['key'] = 'language';
$_field['label'] = lang('accounts_edit_basic_field_language_label');
$_field['default'] = $user_edit->language ? $user_edit->language : APP_DEFAULT_LANG_CODE;
$_field['required'] = FALSE;
$_field['class'] = 'select2';
if (count($languages) > 1) {
    echo form_field_dropdown($_field, $languages, lang('accounts_edit_basic_field_language_tip'));
} else {
    echo form_hidden($_field['key'], $_field['default']);
}
// --------------------------------------------------------------------------
//	Registered IP
$_field = array();
$_field['key'] = 'ip_address';
$_field['label'] = lang('accounts_edit_basic_field_register_ip_label');
$_field['default'] = $user_edit->ip_address;
$_field['required'] = FALSE;
$_field['readonly'] = TRUE;
echo form_field($_field);
// --------------------------------------------------------------------------
//	Last IP
$_field = array();
Exemple #2
0
$_options['CLASSIC'] = 'Classic';
$_options['FLAT'] = 'Flat';
$_options['BIRMAN'] = 'Birman';
echo form_field_dropdown($_field, $_options);
// --------------------------------------------------------------------------
$_field = array();
$_field['key'] = 'social_layout';
$_field['label'] = 'Layout';
$_field['class'] = 'select2';
$_field['id'] = 'blog-settings-social-layout';
$_field['default'] = app_setting($_field['key'], 'blog') ? app_setting($_field['key'], 'blog') : 'HORIZONTAL';
$_options = array();
$_options['HORIZONTAL'] = 'Horizontal';
$_options['VERTICAL'] = 'Vertical';
$_options['SINGLE'] = 'Single Button';
echo form_field_dropdown($_field, $_options);
// --------------------------------------------------------------------------
$_display = app_setting($_field['key'], 'blog') && app_setting($_field['key'], 'blog') == 'SINGLE' ? 'block' : 'none';
echo '<div id="blog-settings-social-layout-single-text" style="display:' . $_display . '">';
$_field = array();
$_field['key'] = 'social_layout_single_text';
$_field['label'] = 'Button Text';
$_field['default'] = app_setting($_field['key'], 'blog') ? app_setting($_field['key'], 'blog') : 'Share';
$_field['placeholder'] = 'Specify what text should be rendered on the button';
echo form_field($_field);
echo '</div>';
// --------------------------------------------------------------------------
$_field = array();
$_field['key'] = 'social_counters';
$_field['label'] = 'Show Counters';
$_field['id'] = 'social-counters';
Exemple #3
0
$_field['key'] = 'group_id';
$_field['label'] = lang('accounts_create_field_group_label');
$_field['required'] = TRUE;
$_field['default'] = $this->user_group_model->get_default_group_id();
$_field['class'] = 'select2';
//	Prepare ID's
$_groups_by_id = array();
foreach ($groups as $group) {
    //	If the group is a superuser group and the active user is not a superuser
    //	then remove it
    if (isset($group->acl['superuser']) && $group->acl['superuser'] && !$user->is_superuser()) {
        continue;
    }
    $_groups_by_id[$group->id] = $group->label;
}
echo form_field_dropdown($_field, $_groups_by_id, lang('accounts_create_field_group_tip'));
//	Render the group descriptions
echo '<ul id="user-group-descriptions">';
foreach ($groups as $group) {
    if (isset($group->acl['superuser']) && $group->acl['superuser'] && !$user->is_superuser()) {
        continue;
    }
    // --------------------------------------------------------------------------
    $_display = $group->id == $this->user_group_model->get_default_group_id() ? 'block' : 'none';
    echo '<li class="system-alert notice" id="user-group-' . $group->id . '" style="display:' . $_display . ';">';
    echo '<strong>' . $group->label . ':</strong> ' . $group->description;
    echo '</li>';
}
echo '</ul>';
// --------------------------------------------------------------------------
//	Password
Exemple #4
0
    $_field['default'] = array();
    //	Build an array which matches the potential $_POST array
    foreach ($item->tags as $tag) {
        $_field['default'][] = $tag->id;
    }
}
echo form_field_dropdown_multiple($_field, $tags, $_tip);
// --------------------------------------------------------------------------
$_field = array();
$_field['key'] = 'tax_rate_id';
$_field['label'] = 'Tax Rate';
$_field['class'] = 'tax_rate_id select2';
$_field['required'] = TRUE;
$_field['info'] = '<a href="#" class="manage-tax-rates awesome orange small">Manage Tax Rates</a>';
$_field['default'] = !empty($item->tax_rate->id) ? $item->tax_rate->id : NULL;
echo form_field_dropdown($_field, $tax_rates);
?>
		</div>

		<div class="tab page description" id="tab-description">
		<?php 
$_field = array();
$_field['key'] = 'description';
$_field['default'] = !empty($item->description) ? $item->description : '';
echo form_error($_field['key'], '<p class="system-alert error">', '</p>');
echo form_textarea($_field['key'], set_value($_field['key'], $_field['default']), 'class="wysiwyg"');
?>
		</div>

		<div class="tab page variations" id="tab-variations">
			<p>
Exemple #5
0
$_field['key'] = 'limited_use_limit';
$_field['label'] = 'Limit number of uses';
$_field['placeholder'] = 'Define the number of times this voucher can be used.';
$_field['required'] = TRUE;
echo form_field($_field);
?>
		</div>
		<div id="application-product_types" style="display:none;">
			<?php 
//	Product Types application
$_field = array();
$_field['key'] = 'product_type_id';
$_field['label'] = 'Limit to products of type';
$_field['required'] = TRUE;
$_field['class'] = 'select2';
echo form_field_dropdown($_field, $product_types);
?>
		</div>
	</fieldset>
	<p>
		<?php 
echo form_submit('submit', lang('action_create'));
?>
	</p>
	<?php 
echo form_close();
?>
</div>

<script type="text/javascript">
	$( function(){
Exemple #6
0
    //	TODO: add a link to the docs here
    $_field['type'] = 'textarea';
    $_field['default'] = !empty($cmspage->draft->template_data->data->additional_fields->{$template->slug}->manual_config) ? $cmspage->draft->template_data->data->additional_fields->{$template->slug}->manual_config : '';
    echo form_field($_field);
    if ($template->additional_fields) {
        foreach ($template->additional_fields as $field) {
            //	Set the default key
            $field['default'] = !empty($cmspage->draft->template_data->data->additional_fields->{$template->slug}->{$field['key']}) ? $cmspage->draft->template_data->data->additional_fields->{$template->slug}->{$field['key']} : '';
            //	Override the field key
            $field['key'] = 'additional_field[' . $template->slug . '][' . $field['key'] . ']';
            //	Tip?
            $_tip = !empty($field['tip']) ? $field['tip'] : '';
            switch ($field['type']) {
                case 'dropdown':
                    $_options = !empty($field['options']) ? $field['options'] : array();
                    echo form_field_dropdown($field, $_options, $_tip);
                    break;
                default:
                    echo form_field($field, $_tip);
                    break;
            }
        }
    }
    echo '</div>';
}
?>
	</fieldset>

	<fieldset>
		<legend>Page Content</legend>
		<p>
Exemple #7
0
//	Located
$_field = array();
$_field['key'] = 'located';
$_field['label'] = 'Located';
$_field['default'] = '';
$_field['required'] = FALSE;
$_field['placeholder'] = 'A brief outline of where this block might be used';
echo form_field($_field);
// --------------------------------------------------------------------------
//	Block Type
$_field = array();
$_field['key'] = 'type';
$_field['label'] = 'Block Type';
$_field['required'] = TRUE;
$_field['class'] = 'select2';
echo form_field_dropdown($_field, $block_types);
?>
	</fieldset>

	<fieldset id="default-value">
		<?php 
if (count($languages) > 1) {
    echo '<legend>' . APP_DEFAULT_LANG_LABEL . ' Value</legend>';
    echo '<p class="system-alert message">';
    echo '<strong>Note:</strong> All blocks must have an <?=APP_DEFAULT_LANG_LABEL?> value, define the initial ' . APP_DEFAULT_LANG_LABEL . ' value now.';
    echo '</p>';
} else {
    echo '<legend>Value</legend>';
}
//	Value
echo form_textarea('value', set_value('value'), 'placeholder="Define the default value" id="default_value"');