コード例 #1
0
ファイル: helper.php プロジェクト: catchup-forks/gameshop
function renderNode($node, $rootParent = false)
{
    if ($node->isLeaf()) {
        $route = route('StoreCategoryShow', $node->slug);
        if ($rootParent) {
            return '<li><a class="root-parent" href="' . $route . '">' . $node->name . '</a></li>';
        } else {
            return '<li><a href="' . $route . '">' . $node->name . '</a></li>';
        }
    } else {
        if ($rootParent) {
            $html = '<li class="dropdown-submenu"><a class="root-parent" tabindex="-1" href="#" role="button">' . $node->name;
            $html .= '</a><ul class="dropdown-menu" role="menu">';
        } else {
            $html = '<li class="dropdown-submenu"><a tabindex="-1" href="#" role="button">' . $node->name;
            $html .= '</a><ul class="dropdown-menu" role="menu">';
        }
        foreach ($node->children as $child) {
            $html .= renderNode($child);
        }
        $html .= '</ul>';
        $html .= '</li>';
    }
    return $html;
}
コード例 #2
0
ファイル: helpers.php プロジェクト: merkuriospam/plantas
function renderNode($node)
{
    $botones = '<div class="input-group-btn">
              <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="fa fa-cog"></span> <span class="fa fa-caret-down"></span></button>
              <ul class="dropdown-menu">
                <li class="cursor"><a onclick="categorias.crear(\'' . $node->id . '\');"><span class="fa fa-plus"></span> New Child</a></li>
                <li class="cursor"><a onclick="categorias.editar(\'' . $node->id . '\',\'' . $node->nombre . '\',\'' . $node->tipo_id . '\');"><span class="fa fa-edit"></span> Edit</a></li>
                <li class="cursor"><a onclick="categorias.mover(\'izquierda\', \'' . $node->id . '\')"><span class="fa fa-caret-up"></span> Move Up</a></li>
                <li class="cursor"><a onclick="categorias.mover(\'derecha\', \'' . $node->id . '\')"><span class="fa fa-caret-down"></span> Move Down</a></li>
                <li class="divider"></li>
                <li class="cursor"><a onclick="categorias.eliminar(\'' . $node->id . '\');"><span class="fa fa-minus"></span> Delete</a></li>
              </ul>
            </div>';
    if ($node->isLeaf()) {
        return '<li>' . $botones . $node->nombre . '</li>';
    } else {
        $html = '<li>' . $botones . $node->nombre;
        $html .= '<ul>';
        foreach ($node->children as $child) {
            $html .= renderNode($child);
        }
        $html .= '</ul>';
        $html .= '</li>';
    }
    return $html;
}
コード例 #3
0
 /**
  * Displays all the stock movement entries for the specified stock for the
  * specified inventory.
  *
  * @param $inventory_id
  * @param $stock_id
  *
  * @return mixed
  */
 public function index($inventory_id, $stock_id)
 {
     $item = $this->inventory->find($inventory_id);
     $stock = $this->inventoryStock->find($stock_id);
     $data = $this->inputAll();
     $data['stock_id'] = $stock->id;
     $movements = $this->inventoryStockMovement->setInput($data)->getByPageWithFilter();
     return view('inventory.stocks.movements.index', ['title' => "Viewing Stock Movements for Item: {$item->name} in Location: " . renderNode($stock->location), 'item' => $item, 'stock' => $stock, 'movements' => $movements]);
 }
コード例 #4
0
ファイル: helpers.php プロジェクト: ljjakovljevic/ekof-bp
function renderNode($node)
{
    echo "<li>{$node->naziv}";
    if ($node->children()->count() > 0) {
        echo "<ul>";
        foreach ($node->children as $child) {
            renderNode($child);
        }
        echo "</ul>";
    }
    echo "</li>";
}
コード例 #5
0
ファイル: index.php プロジェクト: engmohamedamer/gotest
function renderNode($node)
{
    if (!count($node->children)) {
        $html = '<li>' . Html::a($node->title, ['/shop/cat', 'slug' => $node->slug]) . '</li>';
    } else {
        $html = '<li>' . $node->title . '</li>';
        $html .= '<ul>';
        foreach ($node->children as $child) {
            $html .= renderNode($child);
        }
        $html .= '</ul>';
    }
    return $html;
}
コード例 #6
0
ファイル: index.php プロジェクト: hogvarce/house-plastic
function renderNode($node)
{
    if (!count($node->children)) {
        $html = '<li class="col-xs-12 col-sm-6 col-md-4 text-center">' . (isset($node->image) ? Html::a(Html::img($node->image, ['width' => '100%', 'alt' => $node->title]), ['/articles/cat', 'slug' => $node->slug]) : '') . '<h4>' . Html::a($node->title, ['/articles/cat', 'slug' => $node->slug]) . '</h4></li>';
    } else {
        $html = '<li>' . $node->title . '</li>';
        $html .= '<ul>';
        foreach ($node->children as $child) {
            $html .= renderNode($child);
        }
        $html .= '</ul>';
    }
    return $html;
}
コード例 #7
0
ファイル: index.blade.php プロジェクト: nopbongdem/quiz
function renderNode($node)
{
    if ($node->isLeaf()) {
        return '<li>' . $node->name . '</li>';
    } else {
        $html = '<li>' . $node->name;
        $html .= '<ul>';
        foreach ($node->children as $child) {
            $html .= renderNode($child);
        }
        $html .= '</ul>';
        $html .= '</li>';
    }
    return $html;
}
コード例 #8
0
ファイル: index.php プロジェクト: hogvarce/house-plastic
function renderNode($node)
{
    if (!count($node->children)) {
        $html = '<li class="col-xs-12 col-sm-4 col-md-3"><div class="category-block">
                ' . Html::a(Html::img($node->image, ['class' => 'cat-preview', 'alt' => $node->title]), ['/shop/cat', 'slug' => $node->slug]) . '
                ' . Html::a($node->title, ['/shop/cat', 'slug' => $node->slug], ['class' => 'cat-title']) . '
        </div></li>';
    } else {
        $html = '<li class="parent-category col-xs-12"><h4>' . $node->title . '</h4></li>';
        $html .= '<ul class="list-inline clearfix">';
        foreach ($node->children as $child) {
            $html .= renderNode($child);
        }
        $html .= '</ul>';
    }
    return $html;
}
コード例 #9
0
ファイル: Category.php プロジェクト: mmonbr/20Pavos
function renderNode($node, $current)
{
    if ($node->getDescendantCount() > 0) {
        $html = '<div class="item">' . renderCategoryLink($node, $current);
        if ($node->id == $current->id || $current->isDescendantOf($node)) {
            $html .= '<div class="menu">';
            foreach ($node->children as $child) {
                $html .= renderNode($child, $current);
            }
            $html .= '</div>';
        }
        $html .= '</div>';
    } else {
        return '<div class="item">' . renderCategoryLink($node, $current) . '</div>';
    }
    return $html;
}
コード例 #10
0
function renderNode($node)
{
    echo "<li class='products__categories__item parent'>";
    if ($node->children()->count() <= 0) {
        echo '<a class="products__categories__link " href="' . URL::route('category_products_path', $node->id) . '">' . $node->name . '</a>';
    } else {
        echo '<span class="products__categories__link">' . $node->name . ' <i class="icon-caret-right"></i></span>';
    }
    if ($node->children()->count() > 0) {
        echo "<ul class='products__categories__submenu'>";
        foreach ($node->children as $child) {
            renderNode($child);
        }
        echo "</ul>";
    }
    echo "</li>";
}
コード例 #11
0
ファイル: index.php プロジェクト: hogvarce/shop
function renderNode($node)
{
    if (!count($node->children)) {
        $html = '<li>
            ' . Html::a(Html::img($node->image, ['width' => '100', 'alt' => $node->title]), ['/shop/cat', 'slug' => $node->slug]) . '
            ' . Html::a($node->title, ['/shop/cat', 'slug' => $node->slug]) . '
        </li>';
    } else {
        $html = '<li>' . $node->title . '</li>';
        $html .= '<ul class="list-inline">';
        foreach ($node->children as $child) {
            $html .= renderNode($child);
        }
        $html .= '</ul><hr>';
    }
    return $html;
}
コード例 #12
0
ファイル: addEdit.blade.php プロジェクト: sushilcs111/td
function renderNode($node, $category)
{
    echo "<li class='tree-item fl_left ps_relative_li'>";
    echo '<div class="checkbox">
                        <label class="i-checks checks-sm"><input type="checkbox"  name="parent_id" value="' . $node->id . '" ' . ($category->parent_id == $node->id ? "checked" : "") . '  /><i></i>' . $node->category . '</label>
                      </div>';
    if ($node->children()->count() > 0) {
        echo "<ul class='treemap fl_left'>";
        foreach ($node->children as $child) {
            renderNode($child, $category);
        }
        echo "</ul>";
    }
    echo "</li>";
}
コード例 #13
0
ファイル: Location.php プロジェクト: stevebauman/maintenance
 /**
  * Returns a single lined string with arrows indicating depth of the current category.
  *
  * @return string
  */
 public function getTrailAttribute()
 {
     return renderNode($this);
 }
コード例 #14
0
@section('content')
          <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">Nodos</h3>
              <div class="box-tools pull-right">
                <button class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse"><i class="fa fa-minus"></i></button>
                <button class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <div class="box-body">
              <ul class="categorias">
                <?php 
foreach ($data['categorias'] as $node) {
    ?>
                  <?php 
    echo renderNode($node);
    ?>
                <?php 
}
?>
              </ul>
            </div><!-- /.box-body -->
            <!--<div class="box-footer">
              Footer
            </div>--><!-- /.box-footer-->
          </div>
          <!-- Modal -->
          <div id="modalNodoNuevo" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            {!! Form::open(array('url' => 'categorias')) !!}
            {!! Form::hidden('red_id',$data['red_id'], array('id' => 'red_id')) !!}
            {!! Form::hidden('accion','', array('id' => 'accion')) !!}
コード例 #15
0
function renderNode($node, $prodCats)
{
    echo "<li class='tree-item fl_left ps_relative_li'>";
    echo '<div class="checkbox">
                                <label class="i-checks checks-sm"><input type="checkbox"  name="category_id[]" value="' . $node->id . '"  ' . (App\Library\Helper::searchForKey("id", $node->id, $prodCats) ? 'checked' : '') . '  /> <i></i>' . $node->category . '</label>
                              </div>';
    if ($node->children()->count() > 0) {
        echo "<ul class='fl_left treemap'>";
        foreach ($node->children as $child) {
            renderNode($child, $prodCats);
        }
        echo "</ul>";
    }
    echo "</li>";
}
コード例 #16
0
 /**
  * Render nodes for nested sets
  *
  * @param $node
  * @param $resource
  * @return string
  */
 function renderNode($node, $resource)
 {
     $id = 'data-id="' . $node->id . '"';
     $list = 'class="dd-list"';
     $class = 'class="dd-item"';
     $handle = 'class="dd-handle"';
     $title = '<span class="ol-buttons"> ' . get_ops($resource, $node->id, 'inline') . '</span>';
     $title .= '<div ' . $handle . '>' . $node->title . '</div>';
     if ($node->isLeaf()) {
         return '<li ' . $class . ' ' . $id . '>' . $title . '</li>';
     } else {
         $html = '<li ' . $class . ' ' . $id . '>' . $title;
         $html .= '<ol ' . $list . '>';
         foreach ($node->children as $child) {
             $html .= renderNode($child, $resource);
         }
         $html .= '</ol>';
         $html .= '</li>';
     }
     return $html;
 }
コード例 #17
0
ファイル: helpers.php プロジェクト: zedx/core
 /**
  * Render Node.
  *
  * @param Node   $node
  * @param string $type
  *
  * @return void
  */
 function renderNode($node, $type)
 {
     $additional = '';
     switch ($type) {
         case 'menu':
             $label = '<span class="label label-info">' . trans('backend.menu.' . $node->type . '.' . $node->type) . '</span>';
             $name = '<i class="' . $node->icon . '"></i> ' . $node->name;
             $route = '#';
             $modal = 'data-toggle="modal" data-menu="' . e($node->toJson()) . '" data-target="#confirmEditAction" data-title="' . $node->name . '"';
             break;
         default:
             $label = '';
             $name = $node->name;
             $route = route('zxadmin.' . $type . '.edit', $node->id);
             $modal = '';
             break;
     }
     if ($type == 'category') {
         $additional = '   <a href="' . route('zxadmin.category.create') . '?parent_id=' . $node->id . '" class="btn-edit-category btn btn-xs btn-success">' . '     <i class="fa fa-plus"></i> ' . trans('backend.category.add_sub_category') . '   </a>';
     }
     $text = trans('backend.' . $type . '.deleted_' . $type);
     $message = trans('backend.' . $type . '.delete_' . $type . '_confirmation');
     echo '<li class="dd-item dd3-item" data-element-parent-action data-id="' . $node->id . '" data-parent-id="' . $node->parent_id . '">' . '<div class="dd-handle fa fa-arrows dd3-handle"></div>' . '<div class="dd3-content">' . $name . ' <span class="pull-right">' . $label . $additional . '   <a href="' . $route . '" class="btn-edit-' . $type . ' btn btn-xs btn-primary" ' . $modal . '>' . '     <i class="fa fa-edit"></i> ' . trans('backend.' . $type . '.edit') . '   </a>' . ' <span><a href="#" class="btn btn-xs btn-danger" data-element-action data-element-action-text=\'' . $text . '\' data-element-action-route = \'' . route('zxadmin.' . $type . '.destroy', [$node->id]) . '\' data-toggle="modal" data-target="#confirmDeleteAction" data-title="' . $node->name . '" data-message=\'' . $message . '\'><i class="fa fa-remove"></i> ' . trans('backend.' . $type . '.delete') . '</a></span>' . ' </span>' . '</div>';
     if ($node->children()->count() > 0) {
         echo '<ol class="dd-list">';
         foreach ($node->children as $child) {
             renderNode($child, $type);
         }
         echo '</ol>';
     }
     echo '</li>';
 }