Exemplo n.º 1
0
Arquivo: edit.php Projeto: Nnamso/tbox
?>
">
<div class="modal-body">	
	<div class="form-group">
		<label for="inputPassword" class="col-sm-2"><?php 
echo lang('parent');
?>
</label>
		<div class="col-sm-10">	
			<select name="cateLang[parent_id]" class="form-control form-control input-sm" id="product-category-parent">
				<option value="0"><?php 
echo lang('art_parent_category');
?>
</option>
				<?php 
echo dispayTree($categories, 0, array('type' => 'select', 'name' => ''), array($category->parent_id));
?>
			</select>			
		</div>
	</div>	
  
	<ul id="nav-tabs-lang" class="nav nav-tabs">
		<li class="active"><a data-toggle="tab" href="#"><?php 
echo lang('art_category_info');
?>
</a></li>		
	</ul>
	<div class="tab-content" id="tab-content-lang">
		<div id="en" class="tab-pane active">			
			<div class="form-group">
				<label class="col-sm-2 control-label"><?php 
Exemplo n.º 2
0
function dispayTree($categories, $level = 0, $options = array('type' => 'checkbox', 'name' => 'category'), $cate_checked = array())
{
    if (!is_array($categories) or empty($categories)) {
        return '';
    }
    $html = '';
    if (count($categories)) {
        foreach ($categories as $category) {
            $checked = '';
            if ($options['type'] == 'checkbox') {
                if (in_array($category->id, $cate_checked)) {
                    $checked = 'checked="checked"';
                }
                $html .= str_repeat('&emsp;&emsp;', $level) . '<input type="checkbox" ' . $checked . ' name="' . $options['name'] . '" value="' . $category->id . '"/> ' . $category->title . '<br />';
            } else {
                if ($options['type'] == 'select') {
                    if (in_array($category->id, $cate_checked)) {
                        $checked = 'selected="selected"';
                    }
                    $html .= '<option ' . $checked . ' value="' . $category->id . '">' . str_repeat('&emsp;', $level) . str_repeat('- ', $level) . $category->title . '</option>';
                }
            }
            if (count($category->subcategories) > 0) {
                $html .= dispayTree($category->subcategories, $level + 1, $options, $cate_checked);
            }
        }
    }
    return $html;
}
Exemplo n.º 3
0
Arquivo: edit.php Projeto: Nnamso/tbox
										<div class="form-group">
											<input type="text" class="add_new_category form-control input-sm" placeholder="<?php 
echo lang('product_title_category');
?>
" autocomplete="off">
										</div>
										
										<div class="form-group">
										
											<select class="form-control" id="product-category-parent">
												<option value="0"><?php 
echo lang('product_parent_category');
?>
</option>
												<?php 
echo dispayTree($categories, 0, array('type' => 'select', 'name' => ''));
?>
											</select>
										
										</div>
										<div class="form-group">
											<a href="javascript:void(0)" class="btn btn-default btn-sm" onclick="dgUI.product.addCategoryJs(this, 'save')"><?php 
echo lang('product_add_category');
?>
</a>
										</div>
									</div>
								</div>
								
							</div>
						</div>
Exemplo n.º 4
0
Arquivo: edit.php Projeto: Nnamso/tbox
				
		<!-- my category -->
		<div class="form-group">
			<label class="col-sm-4">
				<?php 
    echo lang('category_my');
    ?>
				<i title="<?php 
    echo lang('category_my_description');
    ?>
" class="glyphicon glyphicon-question-sign popover-dismiss tooltips"></i>
			</label>
			<div class="col-sm-5">
				<select name="art[cate_id]" class="form-control form-control input-sm">					
					<?php 
    echo dispayTree($categories, 0, array('type' => 'select', 'name' => ''), array($art->cate_id));
    ?>
				</select>
			</div>
		</div>
		
		<div class="form-group">
			<label class="col-sm-4"><?php 
    echo lang('type');
    ?>
</label>
			<div class="col-sm-5">
				<?php 
    echo form_dropdown('art[type]', array('vector', 'photo', 'icon'), $art->type, ' class="form-control"');
    ?>
			</div>