aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-04-05 15:28:19 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-04-05 15:28:19 +0000
commit1a42c1c617bea6ec2c9344073fcef082fae9cb35 (patch)
tree8b7d9d623165d2dd298fab9dcb64a029e4e45f36
parentf178c9a514e1fc849ebeaa8e8a546296836d29d6 (diff)
h-source:improved the way license is shown
-rw-r--r--h-source/Application/Controllers/ClientController.php7
-rw-r--r--h-source/Application/Controllers/UsersController.php11
-rw-r--r--h-source/Application/Include/license.php50
-rw-r--r--h-source/Application/Views/Client/license.php8
4 files changed, 37 insertions, 39 deletions
diff --git a/h-source/Application/Controllers/ClientController.php b/h-source/Application/Controllers/ClientController.php
index e0ff37e..51966c9 100644
--- a/h-source/Application/Controllers/ClientController.php
+++ b/h-source/Application/Controllers/ClientController.php
@@ -30,12 +30,19 @@ class ClientController extends BaseController
public function licenseinfo($lang = 'en')
{
+ header ("Content-Type:text/xml");
+
+ $data["xml"] = "<?xml version='1.0' encoding='UTF-8'?>\n";
+
+ $this->append($data);
$this->clean();
$this->load("license");
}
public function userinfo($lang = 'en')
{
+ header ("Content-Type:text/xml");
+
$this->s['registered']->checkStatus();
$data['user_status'] = strcmp($this->islogged,'yes') === 0 ? 'logged' : 'not-logged';
diff --git a/h-source/Application/Controllers/UsersController.php b/h-source/Application/Controllers/UsersController.php
index 651b371..b8fe57e 100644
--- a/h-source/Application/Controllers/UsersController.php
+++ b/h-source/Application/Controllers/UsersController.php
@@ -118,17 +118,6 @@ class UsersController extends BaseController
$this->load('logout');
}
-// public function info($lang = 'en')
-// {
-// $this->s['registered']->checkStatus();
-//
-// $data['user_status'] = strcmp($this->islogged,'yes') === 0 ? 'logged' : 'not-logged';
-//
-// $this->append($data);
-// $this->clean();
-// $this->load('info');
-// }
-
public function add($lang = 'en')
{
$data['title'] = 'create account - '.Website::$generalName;
diff --git a/h-source/Application/Include/license.php b/h-source/Application/Include/license.php
index b1a1999..f1e45e4 100644
--- a/h-source/Application/Include/license.php
+++ b/h-source/Application/Include/license.php
@@ -26,13 +26,13 @@ class License
//license notice that does appear at the bottom of each hardware and wiki page
public static $bottom = array(
'en' => "The contents of this page are in the Public Domain. (see the <a href='http://creativecommons.org/publicdomain/zero/1.0/'>CC0 page</a> for detailed information). Anyone is free to copy, modify, publish, use, sell, or distribute the text for any purpose, commercial or non-commercial, and by any means.",
- 'it' => "Il contenuti di questa pagina sono di Pubblico Dominio. (leggi la <a href='http://creativecommons.org/publicdomain/zero/1.0/deed.it'>pagina CC0</a> per informazioni dettagliate). Chiunque è libero di copiare, modificare, pubblicare, usare, vendere, o distribuire tale contenuto per qualsiasi fine, commerciale o non commerciale, e con ogni mezzo.",
+ 'it' => "I contenuti di questa pagina sono di Pubblico Dominio. (leggi la <a href='http://creativecommons.org/publicdomain/zero/1.0/deed.it'>pagina CC0</a> per informazioni dettagliate). Chiunque è libero di copiare, modificare, pubblicare, usare, vendere, o distribuire tale contenuto per qualsiasi fine, commerciale o non commerciale, e con ogni mezzo.",
);
//license notice that does appear inside the xml download page
public static $insideXml = array(
'en' => "The contents of this page are in the Public Domain. (see the CC0 page at http://creativecommons.org/publicdomain/zero/1.0/ for detailed information). Anyone is free to copy, modify, publish, use, sell, or distribute the text for any purpose, commercial or non-commercial, and by any means.",
- 'it' => "Il contenuti di questa pagina sono di Pubblico Dominio. (leggi la pagina CC0 all'indirizzo 'http://creativecommons.org/publicdomain/zero/1.0/deed.it' per informazioni dettagliate). Chiunque è libero di copiare, modificare, pubblicare, usare, vendere, o distribuire tale contenuto per qualsiasi fine, commerciale o non commerciale, e con ogni mezzo.",
+ 'it' => "I contenuti di questa pagina sono di Pubblico Dominio. (leggi la pagina CC0 all'indirizzo http://creativecommons.org/publicdomain/zero/1.0/deed.it per informazioni dettagliate). Chiunque è libero di copiare, modificare, pubblicare, usare, vendere, o distribuire tale contenuto per qualsiasi fine, commerciale o non commerciale, e con ogni mezzo.",
);
//license notice that does appear before the submission of each hardware and wiki page
@@ -41,43 +41,45 @@ class License
'it' => "Ogni testo da te inviato diventerà di Pubblico Dominio. (leggi la <a href='http://creativecommons.org/publicdomain/zero/1.0/deed.it'>pagina CC0</a> per informazioni dettagliate).",
);
- //get the bottom notice
- public static function getBottom()
+ //license notice that does appear before the submission of each hardware page from the h-node client (h-client)
+ public static $submissionNoticeClient = array(
+ 'en' => "Any text submitted by you will be put in the Public Domain (see the CC0 page at \nhttp://creativecommons.org/publicdomain/zero/1.0/ for detailed information).",
+ 'it' => "Ogni testo da te inviato diventerà di Pubblico Dominio. (leggi la pagina CC0 all'indirizzo http://creativecommons.org/publicdomain/zero/1.0/deed.it per informazioni dettagliate).",
+ );
+
+ public static function getNotice($noticeArray)
{
- if (array_key_exists(Lang::$current,self::$bottom))
+ if (array_key_exists(Lang::$current,$noticeArray))
{
- return self::$bottom[Lang::$current];
+ return $noticeArray[Lang::$current];
}
else
{
- return self::$bottom['en'];
+ return $noticeArray['en'];
}
}
+
+ //get the bottom notice
+ public static function getBottom()
+ {
+ return self::getNotice(self::$bottom);
+ }
//get the submission notice
public static function getSubmissionNotice()
{
- if (array_key_exists(Lang::$current,self::$submissionNotice))
- {
- return self::$submissionNotice[Lang::$current];
- }
- else
- {
- return self::$submissionNotice['en'];
- }
+ return self::getNotice(self::$submissionNotice);
}
//get the license notice insidethe xml download page
public static function getInsideXml()
{
- if (array_key_exists(Lang::$current,self::$insideXml))
- {
- return self::$insideXml[Lang::$current];
- }
- else
- {
- return self::$insideXml['en'];
- }
+ return self::getNotice(self::$insideXml);
+ }
+
+ //get the notice for the client
+ public static function getClientNotice()
+ {
+ return self::getNotice(self::$submissionNoticeClient);
}
-
} \ No newline at end of file
diff --git a/h-source/Application/Views/Client/license.php b/h-source/Application/Views/Client/license.php
index 387fb6e..c38d615 100644
--- a/h-source/Application/Views/Client/license.php
+++ b/h-source/Application/Views/Client/license.php
@@ -1,8 +1,8 @@
<?php if (!defined('EG')) die('Direct access not allowed!'); ?>
-<?php echo "<?xml version='1.0' encoding='UTF-8'?>\n";?>
-<license_info>
- <?php echo License::getSubmissionNotice();?>
-</license_info>
+<?php echo $xml; ?>
+<xml>
+ <license_info><![CDATA[<?php echo License::getClientNotice();?>]]></license_info>
+</xml>
<?php
// h-source, a web software to build a community of people that want to share their hardware information.