diff --git a/.idea/www.mikescher.de.iml b/.idea/www.mikescher.de.iml
index 6b8184f..b8c607a 100644
--- a/.idea/www.mikescher.de.iml
+++ b/.idea/www.mikescher.de.iml
@@ -1,7 +1,9 @@
-
+
+
+
diff --git a/www/protected/components/Controller.php b/www/protected/components/MSController.php
similarity index 81%
rename from www/protected/components/Controller.php
rename to www/protected/components/MSController.php
index 083187e..f6d029d 100644
--- a/www/protected/components/Controller.php
+++ b/www/protected/components/MSController.php
@@ -3,21 +3,23 @@
* Controller is the customized base controller class.
* All controller classes for this application should extend from this base class.
*/
-class Controller extends CController
+class MSController extends CController
{
/**
* @var string the default layout for the controller view. Defaults to '//layouts/main',
* meaning using a single column layout. See 'protected/views/layouts/main.php'.
*/
public $layout='//layouts/main';
- /**
- * @var array context menu items. This property will be assigned to {@link CMenu::items}.
- */
- public $menu=array();
+
/**
* @var array the breadcrumbs of the current page. The value of this property will
* be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}
* for more details on how to specify this property.
*/
public $breadcrumbs=array();
+
+ /**
+ * @var string the currently active Element in the Navbar
+ */
+ public $selectedNav = '';
}
\ No newline at end of file
diff --git a/www/protected/config/env/.gitignore b/www/protected/config/env/.gitignore
new file mode 100644
index 0000000..c1338b2
--- /dev/null
+++ b/www/protected/config/env/.gitignore
@@ -0,0 +1 @@
+*.secret.php
\ No newline at end of file
diff --git a/www/protected/config/env/dev.php b/www/protected/config/env/dev.php
index 8ea7ba6..fcd5729 100644
--- a/www/protected/config/env/dev.php
+++ b/www/protected/config/env/dev.php
@@ -17,7 +17,7 @@ return [
'errorHandler' =>
[
- 'errorAction' => 'site/debugerror',
+ 'errorAction' => 'msmain/debugerror',
],
],
diff --git a/www/protected/config/env/prod.php b/www/protected/config/env/prod.php
index 0478f83..eeb5f05 100644
--- a/www/protected/config/env/prod.php
+++ b/www/protected/config/env/prod.php
@@ -4,20 +4,21 @@ return [
'components' =>
[
'db' =>
- [
- 'connectionString' => 'mysql:host=rdbms.strato.de;dbname=DB451718',
- 'username' => 'U451718',
- 'password' => '?.?>?>?>', //TODO Change me and move me to extra file
- 'enableProfiling' => false,
- 'enableParamLogging' => false,
- 'charset' => 'utf8',
- 'emulatePrepare' => true, // needed by some MySQL installations
- 'schemaCachingDuration' => 3600, // Performance with AR's
- ],
+ ArrayX::merge(
+ [
+ 'connectionString' => 'mysql:host=rdbms.strato.de;dbname=DB451718',
+ 'enableProfiling' => false,
+ 'enableParamLogging' => false,
+ 'charset' => 'utf8',
+ 'emulatePrepare' => true, // needed by some MySQL installations
+ 'schemaCachingDuration' => 3600, // Performance with AR's
+ ],
+ require_once('database-access.secret.php') // DB Username & PW
+ ),
'errorHandler' =>
[
- 'errorAction' => 'site/error',
+ 'errorAction' => 'msmain/error',
],
],
diff --git a/www/protected/config/main.php b/www/protected/config/main.php
index 290c110..468ba0b 100644
--- a/www/protected/config/main.php
+++ b/www/protected/config/main.php
@@ -69,9 +69,9 @@ return ArrayX::merge(
'downloads/downloads.php' => 'programs/index', // Compatibility
'downloads/' => 'programs/view', // Compatibility
- '' => 'site/index',
+ '' => 'msmain/index',
- '' => 'site/',
+ '' => 'msmain/',
],
],
@@ -87,6 +87,11 @@ return ArrayX::merge(
],
],
],
+
+ 'db' =>
+ [
+ 'tablePrefix' => 'ms4_',
+ ],
],
// application-level parameters that can be accessed
diff --git a/www/protected/controllers/SiteController.php b/www/protected/controllers/MSMainController.php
similarity index 96%
rename from www/protected/controllers/SiteController.php
rename to www/protected/controllers/MSMainController.php
index da0c565..a9dbe12 100644
--- a/www/protected/controllers/SiteController.php
+++ b/www/protected/controllers/MSMainController.php
@@ -1,9 +1,7 @@
28),
array('programming_lang', 'length', 'max'=>16),
// The following rule is used by search().
- // @todo Please remove those attributes that should not be searched.
+ // @TODO-MS Please remove those attributes that should not be searched.
array('ID, Name, Thumbnailname, Downloads, Kategorie, Sterne, enabled, visible, Language, programming_lang, Description, add_date, download_url, viewable_code, sourceforge_url, homepage_url, github_url, uses_absCanv, update_identifier, highscore_gid', 'safe', 'on'=>'search'),
);
}
@@ -156,12 +156,13 @@ class Program extends CActiveRecord
/**
* @return string
+ * @throws CHttpException
*/
public function getImagePath() {
if (file_exists('images/programs/thumbnails/' . $this->Name . '.png'))
return '/images/programs/thumbnails/' . $this->Name . '.png';
else if (file_exists('images/programs/thumbnails/' . $this->Name . '.jpg'))
- return '/images/programs/thumbnails/' . $this->Name . '.jpg'; //TODO REM ME - never use jpg
+ return '/images/programs/thumbnails/' . $this->Name . '.jpg'; //TODO-MS REM ME - never use jpg
else throw new CHttpException(500, "Could not find Program Thumbnail '" . $this->Name . "'");
}
diff --git a/www/protected/views/site/about.php b/www/protected/views/msmain/about.php
similarity index 100%
rename from www/protected/views/site/about.php
rename to www/protected/views/msmain/about.php
diff --git a/www/protected/views/site/debugerror.php b/www/protected/views/msmain/debugerror.php
similarity index 100%
rename from www/protected/views/site/debugerror.php
rename to www/protected/views/msmain/debugerror.php
diff --git a/www/protected/views/site/error.php b/www/protected/views/msmain/error.php
similarity index 100%
rename from www/protected/views/site/error.php
rename to www/protected/views/msmain/error.php
diff --git a/www/protected/views/site/index.php b/www/protected/views/msmain/index.php
similarity index 96%
rename from www/protected/views/site/index.php
rename to www/protected/views/msmain/index.php
index e4354cc..87c8b06 100644
--- a/www/protected/views/site/index.php
+++ b/www/protected/views/msmain/index.php
@@ -40,7 +40,7 @@ $this->selectedNav = 'index';
db;
- $command=$connection->createCommand("SELECT * FROM Programme");
+ $command=$connection->createCommand("SELECT * FROM {{Programs}}");
$command->execute(); // a non-query SQL statement execution
// or execute an SQL query and fetch the result set
$reader=$command->query();
diff --git a/www/protected/views/site/login.php b/www/protected/views/msmain/login.php
similarity index 100%
rename from www/protected/views/site/login.php
rename to www/protected/views/msmain/login.php