/www/hosting/vkrtechnologies.com/shop/vendor/macros/presenter/presenter_modules/Goods.php
public function jsonData(?string $url = null): array
{
return [
'url' => isset($url) ? $url : url::current(true),
'content' => $this->renderContent(),
'pagination' => $this->renderPagination(),
'page' => $this->searcher()->getPage(),
'order' => $this->searcher()->getOrderKey(),
'limit' => $this->searcher()->getLimit(),
'fs' => $this->searcher()->encodedFilterData(),
];
}
public function categories_heading_tree($current_category)
{
return ORM::factory('Presenter_Category')
->where('lft > ', $this->category()->lft)
->where('rgt < ', $this->category()->rgt)
->where('lft <= ', $current_category->lft)
->where('rgt >= ', $current_category->rgt)
->orderby('lft', 'ASC')
->find_all();
}
/**
* Vrati model nastavene kategorie
* @return Presetner_Category_Model
*/
public function category()
{
return PresenterCategory::instance()->model();
}
/**
* Strankovani
* @return \Pagination
*/
public function pagination()
{
Arguments
"Attempt to read property "lft" on null"
/www/hosting/vkrtechnologies.com/shop/vendor/macros/presenter/presenter_modules/Goods.php
public function jsonData(?string $url = null): array
{
return [
'url' => isset($url) ? $url : url::current(true),
'content' => $this->renderContent(),
'pagination' => $this->renderPagination(),
'page' => $this->searcher()->getPage(),
'order' => $this->searcher()->getOrderKey(),
'limit' => $this->searcher()->getLimit(),
'fs' => $this->searcher()->encodedFilterData(),
];
}
public function categories_heading_tree($current_category)
{
return ORM::factory('Presenter_Category')
->where('lft > ', $this->category()->lft)
->where('rgt < ', $this->category()->rgt)
->where('lft <= ', $current_category->lft)
->where('rgt >= ', $current_category->rgt)
->orderby('lft', 'ASC')
->find_all();
}
/**
* Vrati model nastavene kategorie
* @return Presetner_Category_Model
*/
public function category()
{
return PresenterCategory::instance()->model();
}
/**
* Strankovani
* @return \Pagination
*/
public function pagination()
{
/www/hosting/vkrtechnologies.com/shop/vendor/macros/presenter/views/presenter_module/goods/content/group_by_categories.php
<?php defined('SYSPATH') or die('No direct access allowed.');
/* @var $this Goods_PresenterModule */
$showed_category_ids = [$this->category()->pk()];
if (count($this->items()) === 0) {
return;
}
echo '<div class="container-fluid" >';
echo '<div class="row" >';
foreach ($this->items() as $good) :
if (! in_array($good->category_id, $showed_category_ids)) {
if (count($showed_category_ids) > 1) {
echo '</div><!-- .row -->';
}
$categories = [];
foreach ($this->categories_heading_tree($good->presenter_category) as $category_head) {
if (! in_array($category_head->id, $showed_category_ids)) {
$showed_category_ids[] = $category_head->id;
$categories[] = $category_head;
}
}
echo $this->view('content/group_by_categories/categories', ['categories' => $categories]);
echo '<div class="row" >';
}
echo '
<div class="' . $this->config('col_class') . '" >
' . $this->view('box', compact('good')) . '
</div>';
endforeach;
echo '
</div><!-- .row -->
</div><!-- .container-fluid -->';
/www/hosting/vkrtechnologies.com/shop/vendor/macros/macros/system/libraries/View.php
}
if (! function_exists('_kohana_load_view')) {
function _kohana_load_view($kohana_view_filename, $kohana_input_data)
{
if ($kohana_view_filename == '') {
return;
}
// Buffering on
ob_start();
// Import the view variables to local namespace
extract($kohana_input_data, EXTR_SKIP);
// Views are straight HTML pages with embedded PHP, so importing them
// this way insures that $this can be accessed as if the user was in
// the controller, which gives the easiest access to libraries in views
try {
include $kohana_view_filename;
} catch (Throwable $e) {
// viz Controller::_kohana_load_view - Error je taky potreba zachytit
ob_end_clean();
throw $e;
}
// Fetch the output and close the buffer
return ob_get_clean();
}
}
Arguments
"/www/hosting/vkrtechnologies.com/shop/vendor/macros/presenter/views/presenter_module/goods/content/group_by_categories.php"
/www/hosting/vkrtechnologies.com/shop/vendor/macros/macros/system/libraries/View.php
if (isset($dbgMeasure)) {
debugbar()->stopMeasure($dbgMeasure);
unset($dbgMeasure);
}
if (debugbar()->isEnabled()) {
debugbar()->addView(
$this->name,
$this->kohana_local_data,
microtime(true) - $start,
memory_get_usage() - $memoryStart
);
}
}
}
protected static function load_view_and_bind_to($fileName, $data, $newThis)
{
$closure = new ReflectionFunction('_kohana_load_view');
$closure = Closure::bind($closure->getClosure(), $newThis);
return $closure($fileName, $data);
}
}
if (! function_exists('_kohana_load_view')) {
function _kohana_load_view($kohana_view_filename, $kohana_input_data)
{
if ($kohana_view_filename == '') {
return;
}
// Buffering on
ob_start();
// Import the view variables to local namespace
extract($kohana_input_data, EXTR_SKIP);
// Views are straight HTML pages with embedded PHP, so importing them
// this way insures that $this can be accessed as if the user was in
// the controller, which gives the easiest access to libraries in views
try {
/www/hosting/vkrtechnologies.com/shop/vendor/macros/macros/system/libraries/View.php
public function render($print = false, $renderer = false, $show_kohana_filename = false)
{
if (debugbar()->isEnabled()) {
$dbgMeasure = debugbar()->startMeasure('View (' . $this->name() . ')');
}
$start = microtime(true);
$memoryStart = memory_get_usage();
try {
$this->_before_render();
if (empty($this->kohana_filename)) {
throw new Kohana_Exception(sprintf('View filename of "%s" was not set.', $this->name));
}
if (is_string($this->kohana_filetype)) {
// Merge global and local data, local overrides global with the same name
$data = array_merge(View::$kohana_global_data, $this->kohana_local_data);
if (!is_null($this->_closure_bind)) {
$output = static::load_view_and_bind_to($this->kohana_filename, $data, $this->_closure_bind);
} elseif (is_null(Kohana::$instance)) {
$output = static::load_view_and_bind_to($this->kohana_filename, $data, $this);
} else {
$output = Kohana::$instance->_kohana_load_view($this->kohana_filename, $data);
}
if ($renderer !== false and is_callable($renderer, true)) {
// Pass the output through the user defined renderer
$output = call_user_func($renderer, $output);
}
if ($print === true) {
// Display the output
echo $output;
return;
}
} else {
// Set the content type and size
header('Content-Type: ' . $this->kohana_filetype[0]);
/www/hosting/vkrtechnologies.com/shop/vendor/macros/macros/system/libraries/View.php
return $this;
}
/**
* Udalost volana pred samotnym vypisem pohledu.<br>
* Defaultne nedela nic, slouzi pouze pro potomky teto tridy.
*/
protected function _before_render()
{
}
/**
* Magically converts view object to string.
*
* @return string
*/
public function __toString()
{
try {
return $this->render();
} catch (Exception $e) {
// Display the exception using its internal __toString method
return (string) app(\Macros\Macros\ExceptionHandler::class)->handleException($e);
}
}
public function set_name($name)
{
$this->name = $name;
if (is_string($name) and $name !== '' and empty($this->filename)) {
// Set the filename
$this->set_filename($name);
}
return $this->name;
}
public function name()
{
return $this->name;
/www/hosting/vkrtechnologies.com/shop/vendor/macros/presenter/presenter_modules/Goods.php
/**
* @return Presenter_Good_Model
*/
public function model(?Presenter_Good_Model $model = null)
{
if ( ! is_null($model)) {
$this->searcher()->setModel($model);
return $this;
}
return $this->searcher()->getModel();
}
public function content(): string
{
$view_name = 'boxes';
if ($this->category()->loaded()) {
$view_name = $this->category()->presenter_goods_type;
}
return (string) $this->view('content/' . $view_name);
}
public function renderContent(): string
{
return '<div class="goods-content" data-goods-content >' . $this->content() . '</div>';
}
public function renderPagination(): string
{
return '<div class="goods-pagination" data-goods-pagination >' . $this->view('pagination') . '</div>';
}
public function renderOrdering(): string
{
return '<div class="goods-ordering" data-goods-ordering >' . $this->view('ordering') . '</div>';
}
public function jsonData(?string $url = null): array
{
return [
/www/hosting/vkrtechnologies.com/shop/vendor/macros/presenter/presenter_modules/Goods.php
if ( ! is_null($model)) {
$this->searcher()->setModel($model);
return $this;
}
return $this->searcher()->getModel();
}
public function content(): string
{
$view_name = 'boxes';
if ($this->category()->loaded()) {
$view_name = $this->category()->presenter_goods_type;
}
return (string) $this->view('content/' . $view_name);
}
public function renderContent(): string
{
return '<div class="goods-content" data-goods-content >' . $this->content() . '</div>';
}
public function renderPagination(): string
{
return '<div class="goods-pagination" data-goods-pagination >' . $this->view('pagination') . '</div>';
}
public function renderOrdering(): string
{
return '<div class="goods-ordering" data-goods-ordering >' . $this->view('ordering') . '</div>';
}
public function jsonData(?string $url = null): array
{
return [
'url' => isset($url) ? $url : url::current(true),
'content' => $this->renderContent(),
'pagination' => $this->renderPagination(),
'page' => $this->searcher()->getPage(),
'order' => $this->searcher()->getOrderKey(),
/www/hosting/vkrtechnologies.com/shop/application/views/presenter_module/goods.php
?>
<div class="presenter_module_goods" id="<?= h($this->uid()) ?>">
<?php if (count($subcategories) > 0) : ?>
<div class="subcategory-links mb-4">
<?php foreach ($subcategories as $subcategory) : ?>
<a href="<?= h(presenter()->url()->category($subcategory)) ?>"><?= h($subcategory->name) ?></a>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ($this->config('show_order')) : ?>
<div class="d-flex justify-content-end mb-3"><?= $this->renderOrdering() ?></div>
<?php endif; ?>
<hr>
<?= $this->renderPagination() ?>
<div class="items mb-4"><?= $this->renderContent() ?></div>
<?= $this->renderPagination() ?>
</div>
<?= $this->connectPlugin() ?>
/www/hosting/vkrtechnologies.com/shop/vendor/macros/macros/system/libraries/View.php
}
if (! function_exists('_kohana_load_view')) {
function _kohana_load_view($kohana_view_filename, $kohana_input_data)
{
if ($kohana_view_filename == '') {
return;
}
// Buffering on
ob_start();
// Import the view variables to local namespace
extract($kohana_input_data, EXTR_SKIP);
// Views are straight HTML pages with embedded PHP, so importing them
// this way insures that $this can be accessed as if the user was in
// the controller, which gives the easiest access to libraries in views
try {
include $kohana_view_filename;
} catch (Throwable $e) {
// viz Controller::_kohana_load_view - Error je taky potreba zachytit
ob_end_clean();
throw $e;
}
// Fetch the output and close the buffer
return ob_get_clean();
}
}
Arguments
"/www/hosting/vkrtechnologies.com/shop/application/views/presenter_module/goods.php"
/www/hosting/vkrtechnologies.com/shop/vendor/macros/macros/system/libraries/View.php
if (isset($dbgMeasure)) {
debugbar()->stopMeasure($dbgMeasure);
unset($dbgMeasure);
}
if (debugbar()->isEnabled()) {
debugbar()->addView(
$this->name,
$this->kohana_local_data,
microtime(true) - $start,
memory_get_usage() - $memoryStart
);
}
}
}
protected static function load_view_and_bind_to($fileName, $data, $newThis)
{
$closure = new ReflectionFunction('_kohana_load_view');
$closure = Closure::bind($closure->getClosure(), $newThis);
return $closure($fileName, $data);
}
}
if (! function_exists('_kohana_load_view')) {
function _kohana_load_view($kohana_view_filename, $kohana_input_data)
{
if ($kohana_view_filename == '') {
return;
}
// Buffering on
ob_start();
// Import the view variables to local namespace
extract($kohana_input_data, EXTR_SKIP);
// Views are straight HTML pages with embedded PHP, so importing them
// this way insures that $this can be accessed as if the user was in
// the controller, which gives the easiest access to libraries in views
try {
/www/hosting/vkrtechnologies.com/shop/vendor/macros/macros/system/libraries/View.php
public function render($print = false, $renderer = false, $show_kohana_filename = false)
{
if (debugbar()->isEnabled()) {
$dbgMeasure = debugbar()->startMeasure('View (' . $this->name() . ')');
}
$start = microtime(true);
$memoryStart = memory_get_usage();
try {
$this->_before_render();
if (empty($this->kohana_filename)) {
throw new Kohana_Exception(sprintf('View filename of "%s" was not set.', $this->name));
}
if (is_string($this->kohana_filetype)) {
// Merge global and local data, local overrides global with the same name
$data = array_merge(View::$kohana_global_data, $this->kohana_local_data);
if (!is_null($this->_closure_bind)) {
$output = static::load_view_and_bind_to($this->kohana_filename, $data, $this->_closure_bind);
} elseif (is_null(Kohana::$instance)) {
$output = static::load_view_and_bind_to($this->kohana_filename, $data, $this);
} else {
$output = Kohana::$instance->_kohana_load_view($this->kohana_filename, $data);
}
if ($renderer !== false and is_callable($renderer, true)) {
// Pass the output through the user defined renderer
$output = call_user_func($renderer, $output);
}
if ($print === true) {
// Display the output
echo $output;
return;
}
} else {
// Set the content type and size
header('Content-Type: ' . $this->kohana_filetype[0]);
/www/hosting/vkrtechnologies.com/shop/vendor/macros/presenter/libraries/PresenterModule.php
$benchmark = new PresenterModuleBenchmark($this);
}
$this->beforeRender();
if (empty($view_name)) {
$view_name = $this->config('view_name');
}
if (empty($view_name) and !empty($this->_view_name)) {
$view_name = $this->viewPath();
}
if (empty($view_name)) {
throw new Kohana_Exception('Presenter module ' . $this->name() . ' has not set _view_name property');
}
$this->joinAssets();
$result = $this->_view($view_name)->render();
if (isset($benchmark)) {
$benchmark->stop();
}
return (string) $result;
}
/**
* Metoda volana pred renderovanim
*/
public function beforeRender()
{
}
/**
* Vrati nazev prvku
* @return string
*/
public function name()
/www/hosting/vkrtechnologies.com/shop/vendor/macros/presenter/src/Controllers/CategoryController.php
}
/**
* @return Goods_PresenterModule
*/
private function goodsModule()
{
/** @var Goods_PresenterModule $goods */
$goods = presenter()->module('goods');
$goods->searcher()->addFilter('category')
->setData(presenter()->category()->getActiveId());
return $goods;
}
protected function _goods()
{
$goodsModule = $this->goodsModule();
$goods = $goodsModule->render();
$config = config('presenter_category.goods');
$filters = arr::get($config, 'filters');
$viewData = [
'goods' => $goods,
'goodsModule' => $goodsModule,
'heading' => presenter()->category()->title(),
];
foreach(['left', 'top', 'bottom'] as $side) {
$viewData[$side . '_filters'] = view('presenter/category/filters', [
'filters' => array_map(
function ($filter) use ($goodsModule) {
return $goodsModule->filter($filter);
},
(array) arr::get($filters, $side, [])
),
'side' => $side,
/www/hosting/vkrtechnologies.com/shop/vendor/macros/presenter/src/Controllers/CategoryController.php
->setBreadcrumbs($this->breadcrumbs()->show_homepage_link());
if (request::is_json()) {
if ( ! $presenterCategory->show_goods) {
return [];
}
$this->sendJson($this->goodsModule()->jsonData());
return;
}
$this->getWebInstance()
->js('shop/basket')
->css('shop/category')
->title($presenterCategory->title())
->keywords($presenterCategory->keywords())
->description($presenterCategory->description());
if ($presenterCategory->show_goods) {
$content = $this->_goods();
}
else {
$content = $this->_categories();
}
$content->set('head_images', $this->_head_images());
$content->set('presenter_category', $presenterCategory);
$content->set('category', $presenterCategory->model());
return view('presenter/category', compact('content'));
}
/**
* @return Goods_PresenterModule
*/
private function goodsModule()
{
/** @var Goods_PresenterModule $goods */
$goods = presenter()->module('goods');
/www/hosting/vkrtechnologies.com/shop/vendor/macros/macros/system/libraries/Router.php
}
} catch (ReflectionException $e) {
// Use __call instead
$_method = $class->getMethod('__call');
// Use arguments in __call format
$arguments = [$method, $arguments];
}
} finally {
// Stop the controller setup benchmark
debugbar()->stopMeasure($controllerSetupMeasure);
unset($controllerSetupMeasure);
}
try {
// Start the controller execution benchmark
$controllerExecutionMeasure = debugbar()->startMeasure('CONTROLLER EXECUTION');
// Execute the controller method
$method_result = $_method->invokeArgs($_controller, $arguments);
if ($class->hasMethod('process_method_result')) {
$class->getMethod('process_method_result')->invoke($_controller, $method_result);
}
} finally {
// Stop the controller execution benchmark
debugbar()->stopMeasure($controllerExecutionMeasure);
unset($controllerExecutionMeasure);
}
// Start the controller execution benchmark
$controllerPostContrMeasure = debugbar()->startMeasure('CONTROLLER POST_CONTROLLER');
try {
// Controller method has been executed
if ($uri === null) {
Event::run('system.post_controller', $method_result);
} else {
$result = $class->getMethod('_render')->invoke($_controller, $method_result);
}
} finally {
/www/hosting/vkrtechnologies.com/shop/vendor/macros/macros/system/macros/Application.php
{
debugbar()->measure('SETUP ROUTER', function () {
self::loadRoutes();
\Router::find_uri();
\Router::setup();
});
debugbar()->measure('INIT SYSTEM', function () {
// Prepare the system
Event::run('system.ready');
// Determine routing
Event::run('system.routing');
});
if ($this->isDebugEnabled() && str_contains($_SERVER['HTTP_ACCEPT'] ?? '', 'text/html')) {
ob_start();
}
\Router::execute();
if ($this->isDebugEnabled() && str_contains($_SERVER['HTTP_ACCEPT'] ?? '', 'text/html')) {
$output = ob_get_clean();
$debugbar = $this->make(DebugBarInterface::class);
if (defined('APP_START')) {
$debugbar->addMeasure('TOTAL', APP_START, microtime(true));
}
if (strpos($output, '</body>') !== false) {
$output = str_replace('</body>', $debugbar->render() . '</body>', $output);
}
echo $output;
}
// Clean up and exit
Event::run('system.shutdown');
}
/www/hosting/vkrtechnologies.com/shop/public/index.php
<?php
declare(strict_types=1);
$root = dirname(__DIR__);
require $root . '/vendor/autoload.php';
$app = \Macros\Macros\ApplicationFactory::create($root);
try {
// Spusti aplikaci
$app->run();
} catch (\Exception $e) {
\Macros\Macros\ExceptionHandler::factory($app)->handleException($e);
}