use url handler for css
This commit is contained in:
parent
e462baba87
commit
b2b7484206
@ -19,4 +19,11 @@ $d = dirname(__FILE__) . '/inc/';
|
||||
|
||||
$__autoload['libEPC'] = $d . 'lib.epc.php';
|
||||
$__autoload['epcRecords'] = $d . 'lib.epc.records.php';
|
||||
$__autoload['adminEpcList'] = $d . 'lib.epc.pager.php';
|
||||
$__autoload['adminEpcList'] = $d . 'lib.epc.pager.php';
|
||||
|
||||
$core->url->register(
|
||||
'epccss',
|
||||
'epc.css',
|
||||
'^epc\.css',
|
||||
['publicEnhancePostContent', 'css']
|
||||
);
|
21
_public.php
21
_public.php
@ -45,12 +45,16 @@ class publicEnhancePostContent
|
||||
*/
|
||||
public static function publicHeadContent(dcCore $core)
|
||||
{
|
||||
echo dcUtils::cssLoad($core->blog->url . $core->url->getURLFor('epccss'));
|
||||
}
|
||||
|
||||
public static function css($args)
|
||||
{
|
||||
$css = [];
|
||||
$filters = libEPC::blogFilters();
|
||||
|
||||
foreach($filters as $name => $filter) {
|
||||
|
||||
if (empty($filter['class'])
|
||||
|| empty($filter['style'])) {
|
||||
if (empty($filter['class']) || empty($filter['style'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -63,11 +67,16 @@ class publicEnhancePostContent
|
||||
}
|
||||
|
||||
if (!empty($res)) {
|
||||
echo
|
||||
"\n<!-- CSS for enhancePostContent " . $name . " --> \n" .
|
||||
"<style type=\"text/css\"> " . $res . "</style> \n";
|
||||
$css[] =
|
||||
"/* CSS for enhancePostContent " . $name . " */ \n" . $res . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
header('Content-Type: text/css; charset=UTF-8');
|
||||
|
||||
echo implode("\n", $css);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user