meta->getMetadata(['meta_type' => 'template']); $tags = dcCore::app()->meta->computeMetaStats($tags); $tags->sort('meta_id_lower', 'asc'); $last_letter = null; $cols = ['','']; $col = 0; while ($tags->fetch()) { $letter = mb_strtoupper(mb_substr($tags->meta_id, 0, 1)); if ($last_letter != $letter) { if ($tags->index() >= round($tags->count() / 2)) { $col = 1; } $cols[$col] .= '' . $letter . ''; } $img = '%1$s'; if (array_key_exists($tags->meta_id, dcCore::app()->templator->tpl)) { $img_status = sprintf($img, __('available template'), 'check-on.png'); } else { $img_status = sprintf($img, __('missing template'), 'check-off.png'); } $cols[$col] .= '' . '' . $tags->meta_id . ' ' . $img_status . '' . '' . $tags->count . ' ' . (($tags->count == 1) ? __('entry') : __('entries')) . '' . ''; $last_letter = $letter; } $table = '
%s
'; echo '' . __('Templator') . '' . dcPage::cssLoad(dcPage::getPF('tags/style.css')) . '' . dcPage::breadcrumb([ html::escapeHTML(dcCore::app()->blog->name) => '', __('Additional templates') => '', ]) . dcPage::notices() . '

' . __('New template') . '

'; if ($cols[0]) { echo '
'; printf($table, $cols[0]); if ($cols[1]) { printf($table, $cols[1]); } echo '
'; } else { echo '

' . __('No specific templates on this blog.') . '

'; } dcPage::helpBlock('templator'); echo '';