blog->settings->categoriespage->categoriespage_active) return; $core->addBehavior('initWidgets',array('widgetsCategoriesPage','initWidgets')); class widgetsCategoriesPage { # Widget function public static function categoriesPageWidgets($w) { global $core; if (($w->homeonly == 1 && $core->url->type != 'default') || ($w->homeonly == 2 && $core->url->type == 'default')) { return; } $res = ($w->content_only ? '' : '
'). ($w->title ? '

'.html::escapeHTML($w->title).'

' : ''). ''. ($w->content_only ? '' : '
'); return $res; } public static function initWidgets($w) { $w->create('CategoriesPage',__('Categories page'),array('widgetsCategoriesPage','categoriesPageWidgets')); $w->CategoriesPage->setting('title',__('Title:'),__('Categories page'),'text'); $w->CategoriesPage->setting('homeonly',__('Display on:'),0,'combo', array( __('All pages') => 0, __('Home page only') => 1, __('Except on home page') => 2 ) ); $w->CategoriesPage->setting('content_only',__('Content only'),0,'check'); $w->CategoriesPage->setting('class',__('CSS class:'),''); } }