addBehavior('adminBlogPreferencesFormV2', function ($blog_settings) { $exists = []; $path = path::fullFromRoot((string) $blog_settings->get('system')->get('public_path'), DC_ROOT); foreach (['ico', 'png', 'bmp', 'gif', 'jpg', 'mng'] as $ext) { if (file_exists($path . '/favicon.' . $ext)) { $exists[] = sprintf('
  • %s
  • ', $path . '/favicon.' . $ext, 'favicon.' . $ext); } } echo '

    ' . __('Favicon') . '

    ' . '
    ' . '

    ' . '

    ' . __("You must place an image called favicon.png or .jpg or .ico into your blog's public directory.") . '

    ' . ( empty($exists) ? '

    ' . __('There are no favicon in blog public directory') . '

    ' : '

    ' . __('Current favicons:') . '

      ' . implode($exists) . '
    ' ) . '

    '; }); dcCore::app()->addBehavior('adminBeforeBlogSettingsUpdate', function ($blog_settings) { $blog_settings->get('system')->put('simply_favicon', !empty($_POST['simply_favicon'])); });