From db4de47e1731c6f47ba71a0eaf1affd4daef4d31 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Wed, 4 Jun 2008 00:31:58 +0200 Subject: [PATCH] New Copyright widget. Signed-off-by: Florent Bruneau --- _admin.php | 2 ++ _public.php | 1 + widget.copyright.php | 24 ++++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 widget.copyright.php diff --git a/_admin.php b/_admin.php index 8cbb165..3e21539 100644 --- a/_admin.php +++ b/_admin.php @@ -1,6 +1,7 @@ addBehavior('coreBlogConstruct', array('xorgAuth', 'behavior_coreBlogCons /* Declare the authentication widget on public page */ $core->addBehavior('initWidgets', array('xorgAuthWidget', 'behavior_initWidgets')); +$core->addBehavior('initWidgets', array('xorgCopyrightWidget', 'behavior_initWidgets')); /* Declare stuff to set permissions on each post */ diff --git a/_public.php b/_public.php index a962ea5..c67db8b 100644 --- a/_public.php +++ b/_public.php @@ -2,6 +2,7 @@ require_once dirname(__FILE__) . '/page.auth.php'; require_once dirname(__FILE__) . '/widget.auth.php'; +require_once dirname(__FILE__) . '/widget.copyright.php'; require_once dirname(__FILE__) . '/widget.post.perms.php'; require_once dirname(__FILE__) . '/class.xorg.auth.php'; require_once dirname(__FILE__) . '/page.webservice.php'; diff --git a/widget.copyright.php b/widget.copyright.php new file mode 100644 index 0000000..1cf240d --- /dev/null +++ b/widget.copyright.php @@ -0,0 +1,24 @@ +create('XorgCopyright', __('Copyright'), array('xorgCopyrightWidget', 'widget')); + } + + static public function widget(&$w) { + global $core; + $copyright = $core->blog->settings->get('copyright_notice'); + $editor = $core->blog->settings->get('editor'); + + $text = '

Mentions légales

    '; + if ($editor) { + $text .= '
  • Editeur : ' . $editor . '
  • '; + } + $text .= '
  • Hébergé par Polytechnique.org
  • '; + if ($copyright) { + $text .= '
  • ' . $copyright . '
  • '; + } + return $text . '
'; + } +} + +?> -- 2.1.4