------------------------------------------------------------
revno: 881
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Wed 2011-07-13 23:31:56 +0200
message:
class Site added
modified:
src/bootstrap.php
src/libs/aiki.php
src/libs/output.php
src/style.php
--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk
Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'src/bootstrap.php'
--- src/bootstrap.php 2011-07-07 03:52:30 +0000
+++ src/bootstrap.php 2011-07-13 21:31:56 +0000
@@ -128,37 +128,16 @@
$aiki->load("message");
/**
+ * Get the site information
+ */
+$site = $aiki->load("site");
+
+/**
* Load membership class for global use.
* @global membership $membership
*/
$membership = $aiki->load("membership");
-/**
- * @todo: scoping is wrong here, need solution on these.
- * @see bootstrap.php
- */
-if (isset($_GET['site']))
- $site=addslashes($_GET['site']);
-else
- $site = $config['site'];
-
-/**
- * Get the site information for determining installer setup.
- * @global array $site_info
- */
-$site_info = $db->get_row("SELECT * from aiki_sites where site_shortcut='$site' limit 1");
-if (!$site_info)
-{
- /**
- * @todo: this needs translation. Its a hardcoded string!
- */
- die("Fatal Error: Wrong site name provided. " .
- (( ENABLE_RUNTIME_INSTALLER == FALSE ) ?
- "ENABLE_RUNTIME_INSTALLER is set to FALSE." : ""));
-}
-
-if ($site_info and $site_info->is_active != 1)
- die($site_info->if_closed_output);
// load rest of classes
$aiki->load("text");
=== modified file 'src/libs/aiki.php'
--- src/libs/aiki.php 2011-07-12 17:28:05 +0000
+++ src/libs/aiki.php 2011-07-13 21:31:56 +0000
@@ -152,7 +152,7 @@
*/
public function processVars($text)
{
- global $aiki, $page, $membership, $config, $languages, $site_info;
+ global $aiki, $page, $membership, $config, $languages, $site;
/**
* @todo Setting variables really doesn't have a place in this function
@@ -176,8 +176,8 @@
"[language]" => $languages->language,
"[username]" => $membership->username,
"[page]" => $page,
- "[site_name]" => $site_info->site_name,
- "[site]" => $config['site'],
+ "[site_name]" => $site->site_name(),
+ "[site]" => $site,
"[direction]" => $languages->dir,
"insertedby_username" => $membership->username,
"insertedby_userid" => $membership->userid,
=== modified file 'src/libs/output.php'
--- src/libs/output.php 2011-07-07 22:17:54 +0000
+++ src/libs/output.php 2011-07-13 21:31:56 +0000
@@ -70,7 +70,6 @@
/**
* Returns the title and default meta tags as html
*
- * @global array $site_info
* @return string
*
* @todo title has a hardcoded default here, need to remove
@@ -78,11 +77,11 @@
*/
public function write_title_and_metas()
{
- global $site_info;
+ global $site;
$header = '
<meta charset="__encoding__"/>
<title>' . ( $this->title ? "$this->title - " : "" ) .
- $site_info->site_name . '</title>
+ $site->site_name() . '</title>
<meta name="generator" content="Aikiframework '.
AIKI_VERSION.'.'.AIKI_REVISION.'" />
';
@@ -161,7 +160,7 @@
'<link rel="stylesheet" type="text/css" '.
' href="%sstyle.php?site=%s&widgets=%s&language=%s" />',
$config['url'],
- $site,
+ $site->get_site(),
implode("_", $layout->widgets_css),
$language);
}
=== modified file 'src/style.php'
--- src/style.php 2011-06-27 20:23:02 +0000
+++ src/style.php 2011-07-13 21:31:56 +0000
@@ -31,11 +31,7 @@
*/
require_once("bootstrap.php");
-/**
- * @global string $site
- * @todo the site var looks useless here, should trace and remove
- */
-$site = isset($_GET['site']) ? addslashes($_GET['site']) : 'default';
+
/**
* @global string $widgets
*/
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp