admin->getPageURL(); $fname = $f->basename; $count = ''; $params = []; $link = 'media_item.php?id=' . $f->media_id; $link_edit = dcCore::app()->adminurl->get('admin.plugin.templator', ['part' => 'edit', 'file' => $f->basename]); $icon = dcPage::getPF('templator/img/template.png'); $class = 'media-item media-col-' . ($i % 2); $details = $special = ''; $widget_icon = ''; $part = 'copy'; if (preg_match('/^category-(.+).html$/', $f->basename, $cat_id)) { $cat_id = (int) $cat_id[1]; $category = dcCore::app()->blog->getCategory($cat_id); $full_name = ''; $cat_parents = dcCore::app()->blog->getCategoryParents($cat_id); while ($cat_parents->fetch()) { $full_name = $cat_parents->cat_title . ' › '; }; $fname = '' . __('Category') . ' : ' . $full_name . dcCore::app()->blog->getCategory($cat_id)->cat_title; $params['cat_id'] = $cat_id; $params['post_type'] = ''; $icon = dcPage::getPF('templator/img/template-alt.png'); $part = 'copycat'; try { $counter = dcCore::app()->blog->getPosts($params, true); if ($counter->f(0) == 0) { $count = __('No entry'); } elseif ($counter->f(0) == 1) { $count = '' . $counter->f(0) . ' ' . __('entry') . ''; } else { $count = '' . $counter->f(0) . ' ' . __('entries') . ''; } } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } } elseif (preg_match('/^widget-(.+)$/', $f->basename)) { $count = ' '; $icon = dcPage::getPF('templator/img/template-widget.png'); $special = $widget_icon; } else { $params['meta_id'] = $f->basename; $params['meta_type'] = 'template'; $params['post_type'] = ''; try { $counter = dcCore::app()->meta->getPostsByMeta($params, true); $url = dcCore::app()->adminurl->get('admin.plugin.templator', [ 'part' => 'posts', 'file' => $fname, 'redir' => dcCore::app()->adminurl->get('admin.plugin.templator', ['part' => 'files']), ]); if ($counter->f(0) == 0) { $count = __('No entry'); } elseif ($counter->f(0) == 1) { $count = '' . $counter->f(0) . ' ' . __('entry') . ''; } else { $count = '' . $counter->f(0) . ' ' . __('entries') . ''; } } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } } $res = '
' . '' . '
'; return $res; } }