diff --git a/www/protected/controllers/APIController.php b/www/protected/controllers/APIController.php deleted file mode 100644 index cef6c40..0000000 --- a/www/protected/controllers/APIController.php +++ /dev/null @@ -1,59 +0,0 @@ -array('*'), - ), - ); - } - - public function actionUpdate() - { - if (! isset($_GET['Name'])) { - throw new CHttpException(404,'Invalid Request - [Name] missing'); - return; - } - - $Name = $_GET['Name']; - - $this->actionUpdate2($Name); - } - - public function actionUpdate2($Name) - { - $data = ProgramUpdates::model()->findByAttributes(['Name' => $Name]); - - if (! isset($_GET['Name'])) { - throw new CHttpException(404,'Invalid Request - [Name] not found'); - return; - } - - $this->render('update', ['data' => $data]); - } - - public function actionTest() - { - $this->render('test', []); - } -} \ No newline at end of file diff --git a/www/protected/controllers/BlogPostController.php b/www/protected/controllers/BlogPostController.php deleted file mode 100644 index d833ec8..0000000 --- a/www/protected/controllers/BlogPostController.php +++ /dev/null @@ -1,197 +0,0 @@ -array('index','view', 'ajaxMarkdownPreview'), - 'users'=>array('*'), - ), - array('allow', // allow authenticated user to perform 'create' and 'update' actions - 'actions'=>array('create','update','admin','delete'), - 'users'=>array('@'), - ), -// array('allow', // allow admin user to perform 'admin' and 'delete' actions -// 'actions'=>array(), -// 'users'=>array('admin'), -// ), - array('deny', // deny everythign else to all users - 'users'=>array('*'), - ), - ); - } - - /** - * Displays a particular model. - * @param integer $id the ID of the model to be displayed - */ - public function actionView($id) - { - $this->render('view',array( - 'model'=>$this->loadModel($id), - )); - } - - /** - * Creates a new model. - * If creation is successful, the browser will be redirected to the 'view' page. - */ - public function actionCreate() - { - $this->layout = '//layouts/column2'; - - $model=new BlogPost; - - // Uncomment the following line if AJAX validation is needed - // $this->performAjaxValidation($model); - - if (isset($_POST['BlogPost'])) { - $model->attributes=$_POST['BlogPost']; - if ($model->save()) { - $this->redirect(array('view','id'=>$model->ID)); - } - } - - $this->render('create',array( - 'model'=>$model, - )); - } - - /** - * Updates a particular model. - * If update is successful, the browser will be redirected to the 'view' page. - * @param integer $id the ID of the model to be updated - */ - public function actionUpdate($id) - { - $this->layout = '//layouts/column2'; - - $model=$this->loadModel($id); - - // Uncomment the following line if AJAX validation is needed - // $this->performAjaxValidation($model); - - if (isset($_POST['BlogPost'])) { - $model->attributes=$_POST['BlogPost']; - if ($model->save()) { - $this->redirect(array('view','id'=>$model->ID)); - } - } - - $this->render('update',array( - 'model'=>$model, - )); - } - - /** - * Deletes a particular model. - * If deletion is successful, the browser will be redirected to the 'admin' page. - * @param integer $id the ID of the model to be deleted - * @throws CHttpException - */ - public function actionDelete($id) - { - $this->layout = '//layouts/column2'; - - $this->loadModel($id)->delete(); - - // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser - if (!isset($_GET['ajax'])) { - $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); - } - } - - /** - * Lists all models. - */ - public function actionIndex() - { - $criteria = new CDbCriteria; - $criteria->order = "Date DESC"; - - $all = BlogPost::model()->findAll($criteria); - - $this->render('index', - [ - 'blogposts' => $all, - ] - ); - } - - public function actionAjaxMarkdownPreview() { - if(Yii::app()->request->isAjaxRequest){ - $this->renderPartial('_ajaxMarkdownPreview', - [ - 'Content' => $_POST['Content'], - ], - false, true); - } else { - throw new CHttpException(400,'Invalid request. This is a Ajax only action.'); - } - } - - /** - * Manages all models. - */ - public function actionAdmin() - { - $this->layout = '//layouts/column2'; - - $model=new BlogPost('search'); - $model->unsetAttributes(); // clear any default values - if (isset($_GET['BlogPost'])) { - $model->attributes=$_GET['BlogPost']; - } - - $this->render('admin',array( - 'model'=>$model, - )); - } - - /** - * Returns the data model based on the primary key given in the GET variable. - * If the data model is not found, an HTTP exception will be raised. - * @param integer $id the ID of the model to be loaded - * @return BlogPost the loaded model - * @throws CHttpException - */ - public function loadModel($id) - { - $model=BlogPost::model()->findByPk($id); - if ($model===null) { - throw new CHttpException(404,'The requested page does not exist.'); - } - return $model; - } - - /** - * Performs the AJAX validation. - * @param BlogPost $model the model to be validated - */ - protected function performAjaxValidation($model) - { - if (isset($_POST['ajax']) && $_POST['ajax']==='blog-post-form') { - echo CActiveForm::validate($model); - Yii::app()->end(); - } - } -} \ No newline at end of file diff --git a/www/protected/controllers/MSMainController.php b/www/protected/controllers/MSMainController.php deleted file mode 100644 index fa22025..0000000 --- a/www/protected/controllers/MSMainController.php +++ /dev/null @@ -1,153 +0,0 @@ -array('index', 'about', 'debugerror', 'error', 'login', 'logout'), - 'users'=>array('*'), - ), - array('allow', - 'actions'=>array('admin'), - 'users'=>array('admin'), - ), - array('deny', - 'users'=>array('*'), - ), - ); - } - - public function actionIndex() - { - $criteria = new CDbCriteria; - $criteria->order = "date DESC"; - - $all_log = Log::model()->findAll($criteria); - /* @var $all_log Log[] */ - - $data = array(); - $data['program'] = ProgramHelper::GetDailyProg(); - $data['logs'] = $all_log; - - $this->render('index', $data); - } - - public function actionError() - { - if($error=Yii::app()->errorHandler->error) - { - if(Yii::app()->request->isAjaxRequest) - echo $error['message']; - else - $this->render('error', $error); - } - } - - public function actionDebugError() - { - if($error=Yii::app()->errorHandler->error) - { - if(Yii::app()->request->isAjaxRequest) - echo $error['message']; - else - $this->render('debugerror', $error); - } - } - - public function actionAbout() - { - $data = array(); - - $this->js_scripts[] = file_get_contents('protected/components/extendedGitGraph/script.js'); - - if(isset($_POST['SendMailForm'])) - { - $model = new SendMailForm(); - - $model->attributes=$_POST['SendMailForm']; - - if($model->validate()) { - if ($model->send()) - { - $data['alerts_success'][] = "Successfully send mail from " . $model->name; - $data['model'] = new SendMailForm(); - } - else - { - $data['alerts_error'][] = "Internal error while sending mail"; - $data['model'] = $model; - } - - } - else - { - $data['model'] = $model; - } - } - else - { - $data['model'] = new SendMailForm(); - } - - $this->render('about', $data); - } - - public function actionLogin() - { - $model = new LoginForm(); - - // if it is ajax validation request - if(isset($_POST['ajax']) && $_POST['ajax']==='login-form') - { - echo TbActiveForm::validate($model); - Yii::app()->end(); - } - - // collect user input data - if(isset($_POST['LoginForm'])) - { - $model->attributes=$_POST['LoginForm']; - // validate user input and redirect to the previous page if valid - if($model->validate() && $model->login()) - $this->redirect(Yii::app()->user->returnUrl); - } - // display the login form - $this->render('login', array('model'=>$model)); - } - - public function actionAdmin() - { - if (isset($_GET['do_egh_update']) && $_GET['do_egh_update'] == '1') { - $this->layout = null; - $this->render('admin_updateEGH', array()); - return; - } - - $this->render('admin', array()); - } - - public function actionLogout() - { - Yii::app()->user->logout(); - $this->redirect(Yii::app()->homeUrl); - } - - public function action -} \ No newline at end of file diff --git a/www/protected/controllers/ProgramUpdatesController.php b/www/protected/controllers/ProgramUpdatesController.php deleted file mode 100644 index a577955..0000000 --- a/www/protected/controllers/ProgramUpdatesController.php +++ /dev/null @@ -1,127 +0,0 @@ -array('index','view','create','update','admin','delete'), - 'users'=>array('admin'), - ), - array('deny', // deny all users - 'users'=>array('*'), - ), - ); - } - - public function actionView($id) - { - $this->render('view',array( - 'model'=>$this->loadModel($id), - )); - } - - public function actionCreate() - { - $model=new ProgramUpdates; - - // Uncomment the following line if AJAX validation is needed - // $this->performAjaxValidation($model); - - if (isset($_POST['ProgramUpdates'])) { - $model->attributes=$_POST['ProgramUpdates']; - if ($model->save()) { - $this->redirect(array('view','id'=>$model->Name)); - } - } - - $this->render('create',array( - 'model'=>$model, - )); - } - - public function actionUpdate($id) - { - $model=$this->loadModel($id); - - // Uncomment the following line if AJAX validation is needed - // $this->performAjaxValidation($model); - - if (isset($_POST['ProgramUpdates'])) { - $model->attributes=$_POST['ProgramUpdates']; - if ($model->save()) { - $this->redirect(array('view','id'=>$model->Name)); - } - } - - $this->render('update',array( - 'model'=>$model, - )); - } - - public function actionDelete($id) - { - if (Yii::app()->request->isPostRequest) { - // we only allow deletion via POST request - $this->loadModel($id)->delete(); - - // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser - if (!isset($_GET['ajax'])) { - $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); - } - } else { - throw new CHttpException(400,'Invalid request. Please do not repeat this request again.'); - } - } - - public function actionIndex() - { - $dataProvider=new CActiveDataProvider('ProgramUpdates'); - $this->render('index',array( - 'dataProvider'=>$dataProvider, - )); - } - - public function actionAdmin() - { - $model=new ProgramUpdates('search'); - $model->unsetAttributes(); // clear any default values - if (isset($_GET['ProgramUpdates'])) { - $model->attributes=$_GET['ProgramUpdates']; - } - - $this->render('admin',array( - 'model'=>$model, - )); - } - - public function loadModel($id) - { - $model=ProgramUpdates::model()->findByPk($id); - if ($model===null) { - throw new CHttpException(404,'The requested page does not exist.'); - } - return $model; - } - - protected function performAjaxValidation($model) - { - if (isset($_POST['ajax']) && $_POST['ajax']==='program-updates-form') { - echo CActiveForm::validate($model); - Yii::app()->end(); - } - } -} \ No newline at end of file diff --git a/www/protected/controllers/ApiController.php b/www/protected/controllers_/ApiController.php similarity index 100% rename from www/protected/controllers/ApiController.php rename to www/protected/controllers_/ApiController.php diff --git a/www/protected/controllers/BlogpostController.php b/www/protected/controllers_/BlogpostController.php similarity index 100% rename from www/protected/controllers/BlogpostController.php rename to www/protected/controllers_/BlogpostController.php diff --git a/www/protected/controllers/HighscoresController.php b/www/protected/controllers_/HighscoresController.php similarity index 100% rename from www/protected/controllers/HighscoresController.php rename to www/protected/controllers_/HighscoresController.php diff --git a/www/protected/controllers/LogController.php b/www/protected/controllers_/LogController.php similarity index 100% rename from www/protected/controllers/LogController.php rename to www/protected/controllers_/LogController.php diff --git a/www/protected/controllers/MsmainController.php b/www/protected/controllers_/MsmainController.php similarity index 100% rename from www/protected/controllers/MsmainController.php rename to www/protected/controllers_/MsmainController.php diff --git a/www/protected/controllers/ProgramsController.php b/www/protected/controllers_/ProgramsController.php similarity index 100% rename from www/protected/controllers/ProgramsController.php rename to www/protected/controllers_/ProgramsController.php diff --git a/www/protected/controllers/ProgramupdatesController.php b/www/protected/controllers_/ProgramupdatesController.php similarity index 100% rename from www/protected/controllers/ProgramupdatesController.php rename to www/protected/controllers_/ProgramupdatesController.php diff --git a/www/protected/views/blogpost/_ajaxMarkdownPreview.php b/www/protected/views/blogpost/_ajaxMarkdownPreview.php deleted file mode 100644 index 44b06c4..0000000 --- a/www/protected/views/blogpost/_ajaxMarkdownPreview.php +++ /dev/null @@ -1,3 +0,0 @@ - - -
- - beginWidget('bootstrap.widgets.TbActiveForm', array( - 'id'=>'blog-post-form', - // Please note: When you enable ajax validation, make sure the corresponding - // controller action is handling ajax validation correctly. - // There is a call to performAjaxValidation() commented in generated controller code. - // See class documentation of CActiveForm for details on this. - 'enableAjaxValidation'=>false, -)); ?> - -

Fields with * are required.

- - errorSummary($model); ?> - - isNewRecord) - echo $form->textFieldControlGroup($model,'Date',array('span'=>5, 'value' => date('Y-m-d'))); - else - echo $form->textFieldControlGroup($model,'Date',array('span'=>5, )); - ?> - - textFieldControlGroup($model,'Title',array('span'=>8)); ?> - - textAreaControlGroup($model,'Content',array('rows'=>30,'span'=>8)); ?> - - 'POST', - 'data' => ['Content' => 'js: $("#BlogPost_Content").val()'], - 'update' => '#markdownAjaxContent', - 'error'=>'function(msg){alert("An error has happened" + JSON.stringify(msg));}', - ]); ?> - -
-
- -
- renderPartial('_ajaxMarkdownPreview', ['Content' => $model->Content, ], false, true); ?> -
- -
- isNewRecord ? 'Create' : 'Save',array( - 'color'=>TbHtml::BUTTON_COLOR_PRIMARY, - 'size'=>TbHtml::BUTTON_SIZE_LARGE, - )); ?> -
- - endWidget(); ?> - -
\ No newline at end of file diff --git a/www/protected/views/blogpost/_search.php b/www/protected/views/blogpost/_search.php deleted file mode 100644 index e4119e3..0000000 --- a/www/protected/views/blogpost/_search.php +++ /dev/null @@ -1,26 +0,0 @@ - - -
- - beginWidget('bootstrap.widgets.TbActiveForm', array( - 'action'=>Yii::app()->createUrl($this->route), - 'method'=>'get', -)); ?> - - textFieldControlGroup($model,'ID',array('span'=>5)); ?> - - textFieldControlGroup($model,'Date',array('span'=>5)); ?> - - textAreaControlGroup($model,'Content',array('rows'=>6,'span'=>8)); ?> - -
- TbHtml::BUTTON_COLOR_PRIMARY,));?> -
- - endWidget(); ?> - -
\ No newline at end of file diff --git a/www/protected/views/blogpost/_view.php b/www/protected/views/blogpost/_view.php deleted file mode 100644 index c6f5d75..0000000 --- a/www/protected/views/blogpost/_view.php +++ /dev/null @@ -1,25 +0,0 @@ - - -
- - getAttributeLabel('ID')); ?>: - ID),array('view','id'=>$data->ID)); ?> -
- - getAttributeLabel('Date')); ?>: - Date); ?> -
- - getAttributeLabel('Title')); ?>: - Title); ?> -
- - getAttributeLabel('Content')); ?>: - Content); ?> -
- - -
\ No newline at end of file diff --git a/www/protected/views/blogpost/admin.php b/www/protected/views/blogpost/admin.php deleted file mode 100644 index 5aa6393..0000000 --- a/www/protected/views/blogpost/admin.php +++ /dev/null @@ -1,57 +0,0 @@ -breadcrumbs=array( - 'Blog Posts'=>array('index'), - 'Manage', -); - -$this->menu=array( - array('label'=>'List BlogPost', 'url'=>array('index')), - array('label'=>'Create BlogPost', 'url'=>array('create')), -); - -Yii::app()->clientScript->registerScript('search', " -$('.search-button').click(function(){ - $('.search-form').toggle(); - return false; -}); -$('.search-form form').submit(function(){ - $('#blog-post-grid').yiiGridView('update', { - data: $(this).serialize() - }); - return false; -}); -"); -?> - -

Manage Blog Posts

- -

- You may optionally enter a comparison operator (<, <=, >, >=, - <> -or =) at the beginning of each of your search values to specify how the comparison should be done. -

- -'search-button btn')); ?> - - -widget('bootstrap.widgets.TbGridView',array( - 'id'=>'blog-post-grid', - 'dataProvider'=>$model->search(), - 'filter'=>$model, - 'columns'=>array( - 'ID', - 'Date', - 'Title', - array( - 'class'=>'bootstrap.widgets.TbButtonColumn', - ), - ), -)); ?> \ No newline at end of file diff --git a/www/protected/views/blogpost/create.php b/www/protected/views/blogpost/create.php deleted file mode 100644 index 5120efa..0000000 --- a/www/protected/views/blogpost/create.php +++ /dev/null @@ -1,20 +0,0 @@ - - -breadcrumbs=array( - 'Blog Posts'=>array('index'), - 'Create', -); - -$this->menu=array( - array('label'=>'List BlogPost', 'url'=>array('index')), - array('label'=>'Manage BlogPost', 'url'=>array('admin')), -); -?> - -

Create BlogPost

- -renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file diff --git a/www/protected/views/blogpost/index.php b/www/protected/views/blogpost/index.php deleted file mode 100644 index 36ebb6f..0000000 --- a/www/protected/views/blogpost/index.php +++ /dev/null @@ -1,36 +0,0 @@ - - -pageTitle = 'Blog - ' . Yii::app()->name; - -$this->breadcrumbs = array( - 'Blog' => array('/blog'), -); - -$this->selectedNav = 'blog'; - -?> - -
- - - - widget('BlogLink', - [ - 'date' => new DateTime($blogpost->Date), - 'caption' => $blogpost->Title, - 'link' => $blogpost->getLink(), - ]); - } - ?> - -
\ No newline at end of file diff --git a/www/protected/views/blogpost/update.php b/www/protected/views/blogpost/update.php deleted file mode 100644 index 955e2b5..0000000 --- a/www/protected/views/blogpost/update.php +++ /dev/null @@ -1,26 +0,0 @@ - - -pageTitle = 'Update Blogpost - ' . Yii::app()->name; - -$this->breadcrumbs = array( - 'BlogPosts' => array('index'), - $model->Title => array('/blog/view/' . $model->ID), - 'Update', -); - -$this->menu=array( - array('label'=>'List BlogPost', 'url'=>array('index')), - array('label'=>'Create BlogPost', 'url'=>array('create')), - array('label'=>'View BlogPost', 'url'=>array('view', 'id'=>$model->ID)), - array('label'=>'Manage BlogPost', 'url'=>array('admin')), -); -?> - -

Update BlogPost ID; ?>

- -renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file diff --git a/www/protected/views/blogpost/view.php b/www/protected/views/blogpost/view.php deleted file mode 100644 index e7a93fb..0000000 --- a/www/protected/views/blogpost/view.php +++ /dev/null @@ -1,33 +0,0 @@ - - -pageTitle = 'Blogpost: ' . $model->Title . ' - ' . Yii::app()->name; - -$this->breadcrumbs = array( - 'Blog' => array('/blog'), - $model->Title, -); -?> - -
- - - -
- Content); ?> - -
-
- Title; ?> -
-
- getDateTime()->format('d.m.Y'); ?> -
-
-
- -
diff --git a/www/protected/views/blogPost/_ajaxMarkdownPreview.php b/www/protected/views/blogpost_/_ajaxMarkdownPreview.php similarity index 100% rename from www/protected/views/blogPost/_ajaxMarkdownPreview.php rename to www/protected/views/blogpost_/_ajaxMarkdownPreview.php diff --git a/www/protected/views/blogPost/_form.php b/www/protected/views/blogpost_/_form.php similarity index 100% rename from www/protected/views/blogPost/_form.php rename to www/protected/views/blogpost_/_form.php diff --git a/www/protected/views/blogPost/_search.php b/www/protected/views/blogpost_/_search.php similarity index 100% rename from www/protected/views/blogPost/_search.php rename to www/protected/views/blogpost_/_search.php diff --git a/www/protected/views/blogPost/_view.php b/www/protected/views/blogpost_/_view.php similarity index 100% rename from www/protected/views/blogPost/_view.php rename to www/protected/views/blogpost_/_view.php diff --git a/www/protected/views/blogPost/admin.php b/www/protected/views/blogpost_/admin.php similarity index 100% rename from www/protected/views/blogPost/admin.php rename to www/protected/views/blogpost_/admin.php diff --git a/www/protected/views/blogPost/create.php b/www/protected/views/blogpost_/create.php similarity index 100% rename from www/protected/views/blogPost/create.php rename to www/protected/views/blogpost_/create.php diff --git a/www/protected/views/blogPost/index.php b/www/protected/views/blogpost_/index.php similarity index 100% rename from www/protected/views/blogPost/index.php rename to www/protected/views/blogpost_/index.php diff --git a/www/protected/views/blogPost/update.php b/www/protected/views/blogpost_/update.php similarity index 100% rename from www/protected/views/blogPost/update.php rename to www/protected/views/blogpost_/update.php diff --git a/www/protected/views/blogPost/view.php b/www/protected/views/blogpost_/view.php similarity index 100% rename from www/protected/views/blogPost/view.php rename to www/protected/views/blogpost_/view.php diff --git a/www/protected/views/highscores/list_top50.php b/www/protected/views/highscores/list_top50.php deleted file mode 100644 index 1b1b17f..0000000 --- a/www/protected/views/highscores/list_top50.php +++ /dev/null @@ -1,8 +0,0 @@ -ENTRIES[$i]->POINTS . '||' . htmlentities($game->ENTRIES[$i]->PLAYER) . "\r\n"); -} \ No newline at end of file diff --git a/www/protected/views/highscores/listentries.php b/www/protected/views/highscores/listentries.php deleted file mode 100644 index 74d8dbc..0000000 --- a/www/protected/views/highscores/listentries.php +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - highscores - - - - - - - - - - - - - ENTRIES as $entry) - { - $current++; - - if ($current >= $start && $current - $start <= $pagesize) - { - if ($current == $highlight) - echo ''; - else - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - } - } - - $more = max(0, $start - $pagesize); - $less = $start + $pagesize; - - echo ''; - if ($start > 0) - echo ''; - else - echo ''; - echo ''; - if ($start + $pagesize < count($game->ENTRIES)) - echo ''; - else - echo ''; - echo ''; - - ?> -
NAME; ?>
rankpointsname
$current$entry->POINTS$entry->PLAYER
ID&start=$more&highlight=$highlight" . '">[more points]ID&start=$less&highlight=$highlight" . '">[less points]
- - \ No newline at end of file diff --git a/www/protected/views/highscores/listgames.php b/www/protected/views/highscores/listgames.php deleted file mode 100644 index 4813dfc..0000000 --- a/www/protected/views/highscores/listgames.php +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - highscores - - - - -getListLink() . '">' . $game->NAME . '
' . "\r\n"; - } -?> - - - \ No newline at end of file diff --git a/www/protected/views/Highscores/list_top50.php b/www/protected/views/highscores_/list_top50.php similarity index 100% rename from www/protected/views/Highscores/list_top50.php rename to www/protected/views/highscores_/list_top50.php diff --git a/www/protected/views/Highscores/listentries.php b/www/protected/views/highscores_/listentries.php similarity index 100% rename from www/protected/views/Highscores/listentries.php rename to www/protected/views/highscores_/listentries.php diff --git a/www/protected/views/Highscores/listgames.php b/www/protected/views/highscores_/listgames.php similarity index 100% rename from www/protected/views/Highscores/listgames.php rename to www/protected/views/highscores_/listgames.php