New Copyright widget.
[dotclear.git] / widget.copyright.php
diff --git a/widget.copyright.php b/widget.copyright.php
new file mode 100644 (file)
index 0000000..1cf240d
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+class xorgCopyrightWidget {
+  public static function behavior_initWidgets(&$w) {
+    $w->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 = '<div><h2>Mentions légales</h2><ul>';
+    if ($editor) {
+      $text .= '<li>Editeur&nbsp;: ' . $editor . '</li>';
+    }
+    $text .= '<li>Hébergé par <a href="http://xorg.polytechnique.org">Polytechnique.org</a></li>';
+    if ($copyright) {
+      $text .= '<li>' . $copyright . '</li>';
+    }
+    return $text . '</ul></div>';
+  }
+}
+
+?>