From 9be8e6bac76fff0dce6938993bd19424e0f88f19 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Mon, 12 Dec 2022 23:40:10 +0100 Subject: [PATCH] rename main class --- _admin.php | 12 ++++++------ _install.php | 6 +++--- _prepend.php | 12 ++++++------ _public.php | 4 ++-- _widgets.php | 8 ++++---- inc/class.enhancepostcontent.php | 10 +++++----- index.php | 6 +++--- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/_admin.php b/_admin.php index 4b62dae..57cb514 100644 --- a/_admin.php +++ b/_admin.php @@ -41,8 +41,8 @@ dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $f # Preference form dcCore::app()->addBehavior('adminBlogPreferencesFormV2', function (dcSettings $blog_settings) { $active = (bool) $blog_settings->enhancePostContent->enhancePostContent_active; - $allowedtplvalues = libEPC::blogAllowedTplValues(); - $allowedpubpages = libEPC::blogAllowedPubPages(); + $allowedtplvalues = enhancePostContent::blogAllowedTplValues(); + $allowedpubpages = enhancePostContent::blogAllowedPubPages(); echo '

' . __('Enhance post content') . '

' . @@ -61,10 +61,10 @@ dcCore::app()->addBehavior('adminBlogPreferencesFormV2', function (dcSettings $b '
' . __('Extra') . '
' . '

' . __('This is a special feature to edit list of allowed template values and public pages where this plugin works.') . '

' . '

' . - form::field('epc_allowedtplvalues', 100, 0, libEPC::implode($allowedtplvalues)) . '

' . + form::field('epc_allowedtplvalues', 100, 0, enhancePostContent::implode($allowedtplvalues)) . '

' . '

' . __('Use "readable_name1:template_value1;readable_name2:template_value2;" like "entry content:EntryContent;entry excerpt:EntryExcerpt;".') . '

' . '

' . - form::field('epc_allowedpubpages', 100, 0, libEPC::implode($allowedpubpages)) . '

' . + form::field('epc_allowedpubpages', 100, 0, enhancePostContent::implode($allowedpubpages)) . '

' . '

' . __('Use "readable_name1:template_page1;readable_name2:template_page2;" like "post page:post.html;home page:home.html;".') . '

' . '
' . '' . @@ -75,8 +75,8 @@ dcCore::app()->addBehavior('adminBlogPreferencesFormV2', function (dcSettings $b # Save preference dcCore::app()->addBehavior('adminBeforeBlogSettingsUpdate', function (dcSettings $blog_settings) { $active = !empty($_POST['epc_active']); - $allowedtplvalues = libEPC::explode($_POST['epc_allowedtplvalues']); - $allowedpubpages = libEPC::explode($_POST['epc_allowedpubpages']); + $allowedtplvalues = enhancePostContent::explode($_POST['epc_allowedtplvalues']); + $allowedpubpages = enhancePostContent::explode($_POST['epc_allowedpubpages']); $blog_settings->enhancePostContent->put('enhancePostContent_active', $active); $blog_settings->enhancePostContent->put('enhancePostContent_allowedtplvalues', serialize($allowedtplvalues)); diff --git a/_install.php b/_install.php index 8308fce..d11db35 100644 --- a/_install.php +++ b/_install.php @@ -52,11 +52,11 @@ try { $s->put('enhancePostContent_list_sortby', 'epc_key', 'string', 'Admin records list field order', false, true); $s->put('enhancePostContent_list_order', 'desc', 'string', 'Admin records list order', false, true); $s->put('enhancePostContent_list_nb', 20, 'integer', 'Admin records list nb per page', false, true); - $s->put('enhancePostContent_allowedtplvalues', serialize(libEPC::defaultAllowedTplValues()), 'string', 'List of allowed template values', false, true); - $s->put('enhancePostContent_allowedpubpages', serialize(libEPC::defaultAllowedPubPages()), 'string', 'List of allowed template pages', false, true); + $s->put('enhancePostContent_allowedtplvalues', serialize(enhancePostContent::defaultAllowedTplValues()), 'string', 'List of allowed template values', false, true); + $s->put('enhancePostContent_allowedpubpages', serialize(enhancePostContent::defaultAllowedPubPages()), 'string', 'List of allowed template pages', false, true); # Filters settings - $filters = libEPC::getFilters(); + $filters = enhancePostContent::getFilters(); foreach ($filters as $id => $filter) { # Only editable options $opt = [ diff --git a/_prepend.php b/_prepend.php index 0323231..34ac926 100644 --- a/_prepend.php +++ b/_prepend.php @@ -30,14 +30,14 @@ $filters = [ $d = __DIR__ . '/inc/'; Clearbricks::lib()->autoload([ - 'libEPC' => $d . 'lib.epc.php', - 'epcFilter' => $d . 'lib.epc.filter.php', - 'epcRecords' => $d . 'lib.epc.records.php', - 'adminEpcList' => $d . 'lib.epc.pager.php', + 'enhancePostContent' => $d . 'class.enhancepostcontent.php', + 'epcFilter' => $d . 'class.epcfilter.php', + 'epcRecords' => $d . 'class.epcrecords.php', + 'adminEpcList' => $d . 'class.adminepclist.php', ]); foreach ($filters as $f) { - Clearbricks::lib()->autoload(['epcFilter' . $f => $d . 'lib.epc.filters.php']); + Clearbricks::lib()->autoload(['epcFilter' . $f => $d . 'class.epcfilter' . strtolower($f) . '.php']); dcCore::app()->addBehavior('enhancePostContentFilters', ['epcFilter' . $f, 'create']); } @@ -47,7 +47,7 @@ dcCore::app()->url->register( '^epc\.css', function ($args) { $css = []; - $filters = libEPC::getFilters(); + $filters = enhancePostContent::getFilters(); foreach ($filters as $id => $filter) { if ('' == $filter->class || '' == $filter->style) { diff --git a/_public.php b/_public.php index 5dca60d..5f16eca 100644 --- a/_public.php +++ b/_public.php @@ -28,10 +28,10 @@ dcCore::app()->addBehavior('publicHeadContent', function () { }); // Filter template blocks content dcCore::app()->addBehavior('publicBeforeContentFilterV2', function ($tag, $args) { - $filters = libEPC::getFilters(); + $filters = enhancePostContent::getFilters(); foreach ($filters as $id => $filter) { - if (!libEPC::testContext($tag, $args, $filter)) { + if (!enhancePostContent::testContext($tag, $args, $filter)) { continue; } $filter->publicContent($tag, $args); diff --git a/_widgets.php b/_widgets.php index d531921..f26b01b 100644 --- a/_widgets.php +++ b/_widgets.php @@ -50,7 +50,7 @@ class enhancePostContentWidget 'text' ); # Type - $filters = libEPC::getFilters(); + $filters = enhancePostContent::getFilters(); $types = []; foreach ($filters as $id => $filter) { $types[$filter->name] = $id; @@ -63,7 +63,7 @@ class enhancePostContentWidget $types ); # Content - $contents = libEPC::defaultAllowedWidgetValues(); + $contents = enhancePostContent::defaultAllowedWidgetValues(); foreach ($contents as $k => $v) { $w->epclist->setting( 'content' . $v['id'], @@ -122,7 +122,7 @@ class enhancePostContentWidget # Content $content = ''; - foreach (libEPC::defaultAllowedWidgetValues() as $k => $v) { + foreach (enhancePostContent::defaultAllowedWidgetValues() as $k => $v) { $ns = 'content' . $v['id']; if ($w->$ns && is_callable($v['cb'])) { $content .= call_user_func_array( @@ -138,7 +138,7 @@ class enhancePostContentWidget # Filter $list = []; - $filters = libEPC::getFilters(); + $filters = enhancePostContent::getFilters(); if (isset($filters[$w->type])) { $filters[$w->type]->nocase = $w->nocase; diff --git a/inc/class.enhancepostcontent.php b/inc/class.enhancepostcontent.php index b5ca1ba..2537d98 100644 --- a/inc/class.enhancepostcontent.php +++ b/inc/class.enhancepostcontent.php @@ -21,7 +21,7 @@ __('search results page'); __('atom feeds'); __('RSS feeds'); -class libEPC +class enhancePostContent { protected static $default_filters = null; public static $epcFilterLimit = []; @@ -56,15 +56,15 @@ class libEPC $rs = new arrayObject([ 'entry excerpt' => [ 'id' => 'entryexcerpt', - 'cb' => ['libEPC','widgetContentEntryExcerpt'], + 'cb' => ['enhancePostContent','widgetContentEntryExcerpt'], ], 'entry content' => [ 'id' => 'entrycontent', - 'cb' => ['libEPC','widgetContentEntryContent'], + 'cb' => ['enhancePostContent','widgetContentEntryContent'], ], 'comment content' => [ 'id' => 'commentcontent', - 'cb' => ['libEPC','widgetContentCommentContent'], + 'cb' => ['enhancePostContent','widgetContentCommentContent'], ], ]); @@ -164,7 +164,7 @@ class libEPC $tags = implode('|', $ignore_tags); } if (!empty($tags)) { - $s = preg_replace_callback('#(<(' . $tags . ')[^>]*?>)(.*?)()#s', ['libEPC', 'removeTags'], $s); + $s = preg_replace_callback('#(<(' . $tags . ')[^>]*?>)(.*?)()#s', ['enhancePostContent', 'removeTags'], $s); } # Remove words inside html tag (class, title, alt, href, ...) $s = preg_replace('#(ççççç(' . $p . '(s|))ççççç)(?=[^<]+>)#s' . $i, '$2$4', $s); diff --git a/index.php b/index.php index fe48967..42309b5 100644 --- a/index.php +++ b/index.php @@ -20,7 +20,7 @@ dcPage::check(dcCore::app()->auth->makePermissions([ # -- Prepare queries and object -- -$_filters = libEPC::getFilters(); +$_filters = enhancePostContent::getFilters(); $filters_id = $filters_combo = []; foreach ($_filters as $id => $filter) { @@ -196,7 +196,7 @@ echo '

' . __('Pages to be filtered') . '

'; -foreach (libEPC::blogAllowedPubPages() as $k => $v) { +foreach (enhancePostContent::blogAllowedPubPages() as $k => $v) { echo '

' . __('Contents to be filtered') . '

'; -foreach (libEPC::blogAllowedTplValues() as $k => $v) { +foreach (enhancePostContent::blogAllowedTplValues() as $k => $v) { echo '