Пример #1
0
<?php

if ($categories = \Shop\Models\Categories::find()) {
    ?>
<div>

<select name="category_ids[]" class="select2" >

    <?php 
    $current = \Dsc\ArrayHelper::getColumn((array) $flash->old('categories'), 'id');
    ?>
    <?php 
    foreach ($categories as $one) {
        ?>
    <option value="<?php 
        echo $one->_id;
        ?>
" <?php 
        if (in_array($one->_id, $current)) {
            echo "selected='selected'";
        }
        ?>
>
        <?php 
        echo @str_repeat("&ndash;", substr_count(@$one->path, "/") - 1) . " " . $one->title;
        ?>
    </option>
    <?php 
    }
    ?>
 
Пример #2
0
<form class="form-horizontal" action="./admin/menu/create" method="post">
	<div class="form-group">
		<label for="link-url" class="col-sm-4 control-label">Category</label>
		<div class="col-sm-8">
			<?php 
if ($__items = \Shop\Models\Categories::find()) {
    ?>
			<select name="details[url]" class="form-control">
			<?php 
    foreach ($__items as $__item) {
        ?>
			    <option value="./shop/category<?php 
        echo $__item->path;
        ?>
">
			    	<?php 
        echo @str_repeat("&ndash;", substr_count(@$__item->path, "/") - 1) . " " . $__item->title;
        ?>
			    </option>                    
			<?php 
    }
    ?>
 
			</select>
			<?php 
}
?>
   
		</div>
	</div>
	<div class="form-group">
Пример #3
0
 public function forSelection()
 {
     $term = $this->input->get('q', null, 'default');
     $key = new \MongoRegex('/' . $term . '/i');
     $results = \Shop\Models\Categories::forSelection(array('title' => $key));
     $response = new \stdClass();
     $response->more = false;
     $response->term = $term;
     $response->results = $results;
     return $this->outputJson($response);
 }
Пример #4
0
}
?>
>Out of Stock</option>
                    </select>
                </li>
                <li>
                    <select name="filter[category][id]" class="form-control" onchange="this.form.submit();">
                        <option value="">All Categories</option>
                        <option value="__uncategorized" <?php 
if ($state->get('filter.category.id') == '__uncategorized') {
    echo "selected='selected'";
}
?>
>Uncategorized</option>
                        <?php 
foreach (\Shop\Models\Categories::find() as $cat) {
    ?>
                        	<option value="<?php 
    echo (string) $cat->id;
    ?>
" <?php 
    if ($state->get('filter.category.id') == (string) $cat->id) {
        echo "selected='selected'";
    }
    ?>
><?php 
    echo @str_repeat("&ndash;", substr_count(@$cat->path, "/") - 1) . " " . $cat->title;
    ?>
</option>
                        <?php 
}
Пример #5
0
                </a> <br>
                 <a style="color:#333; font-size: 9px;" href="./admin/shop/category/edit/<?php 
        echo $item->_id;
        ?>
">
                <?php 
        echo $item->path;
        ?>
                </a>
            </td>
            
          
            
            <td class="">
                <?php 
        echo \Shop\Models\Categories::productCount($item->_id);
        ?>
            </td>
            <td class="">
                <?php 
        echo count($item->product_specs);
        ?>
            </td>
            
         
                            
            <td class="text-center col-lg-2 col-md-3">
	        	<?php 
        if ($allow_preview) {
            ?>
                <a class="btn btn-xs btn-warning" target="_blank" title="Unpublished Preview" href="./shop/category/<?php