Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
f9902e0
slideshow rewrite
Stardog Feb 22, 2018
18e6ab6
Rewrite of slideshow
Stardog May 2, 2018
b400cb0
Rewrite of slideshow
Stardog May 2, 2018
55c0dc0
Edited tables for slides and shows.
tylercraig9332 May 16, 2018
7ee2896
Deleted some classes and fixed a typo in the install file
tylercraig9332 May 21, 2018
6291f79
Reoved more files that would be better if we rewrote them.
tylercraig9332 May 21, 2018
3f04c70
Merge pull request #10 from tylercraig9332/studentMaster
cambelem May 21, 2018
22e7093
fixes the navbar for bootstrap 4
May 21, 2018
d2fe822
Merge pull request #11 from cambelem/fixNavBar
tylercraig9332 May 21, 2018
8badae6
Added some react files that will be populated that will render parts …
tylercraig9332 May 23, 2018
18562c3
unstall now works!
tylercraig9332 May 23, 2018
b4761d7
Added a bunch of React files relating to the ShowView.
tylercraig9332 May 23, 2018
1301eab
Removed Templates that we won't be using.
tylercraig9332 May 23, 2018
0f06939
Merge pull request #12 from tylercraig9332/studentMaster
cambelem May 29, 2018
18f7d16
Removed the react controller files because they are already incorperated
tylercraig9332 May 30, 2018
34ed198
Fixed an issue where React wasn't rebuilding the right scripts
tylercraig9332 May 31, 2018
db318c6
Changed Directory for admin view of all the lists. Forgot to add this…
tylercraig9332 May 31, 2018
f7acd8e
Restuctured some more directories
tylercraig9332 May 31, 2018
185fb45
Fixed some bugs with the placement React code for viewing slides.
tylercraig9332 May 31, 2018
7bddf65
Merge pull request #14 from tylercraig9332/studentMaster
tylercraig9332 Jun 6, 2018
e637a38
Created the slideshow view. This is only a view; it has yet to be hoo…
tylercraig9332 Jun 6, 2018
f5139e6
Merge branch 'studentMaster' of github.com:AppStateESS/slideshow into…
tylercraig9332 Jun 6, 2018
9a52b52
Merge pull request #16 from tylercraig9332/studentMaster
cambelem Jun 8, 2018
95699c8
Merge branch 'studentMaster' of github.com:AppStateESS/slideshow into…
tylercraig9332 Jun 13, 2018
e92c336
Moved some stuff from controller into view.
tylercraig9332 Jun 14, 2018
6edb672
Removed a debug call.
tylercraig9332 Jun 14, 2018
acec6d1
Merge pull request #20 from tylercraig9332/classView
cambelem Jun 15, 2018
d570129
Can now create a new slide show.
tylercraig9332 Jun 15, 2018
1a204c9
Merge pull request #21 from tylercraig9332/studentMaster
tylercraig9332 Jun 15, 2018
2fcf166
Added edit page
tylercraig9332 Jul 24, 2018
0b7b18e
Tied down the editor state to each individual slide. Also added some …
tylercraig9332 Jul 27, 2018
b62a59d
Create Delete Update Show Works (#23)
cambelem Jul 31, 2018
a463586
Merge pull request #22 from tylercraig9332/studentMaster
cambelem Jul 31, 2018
90d1b2d
fixed merge issue.
Jul 31, 2018
d876a97
Added transition to edit page. More work needs to be done.
Jul 31, 2018
77a034d
Merge pull request #24 from cambelem/studentMaster
tylercraig9332 Aug 20, 2018
76bcd74
Added ability to stack workspace objects and fixed slide stack.
Aug 23, 2018
ab986b0
Merge pull request #26 from cambelem/studentMaster
tylercraig9332 Aug 27, 2018
a08dd00
Deletes components from edit field.
Sep 24, 2018
534bc4f
Merge branch 'studentMaster' of https://github.com/AppStateESS/slides…
Sep 24, 2018
bcba8db
Merge pull request #35 from cambelem/studentMaster
tylercraig9332 Sep 24, 2018
83b1c00
Delete branch later.
oliviaperugini Sep 28, 2018
58d42ce
Reworked slide view to realign with Edit control.
Oct 5, 2018
7eb911b
Fixed useless method call.
Oct 5, 2018
32da5ee
Merge pull request #38 from cambelem/refactorSlidesView
oliviaperugini Oct 5, 2018
a0d0e0f
Deletes slides from the view (#43)
cambelem Nov 1, 2018
60eae1e
Slideshows can now be saved to the database
tylercraig9332 Sep 20, 2018
107bbb0
Added loading of Slideshow content; however there are some bugs still.
tylercraig9332 Sep 24, 2018
99ab5f8
Fixed a bug where a direct save was not working. Also discovered a bu…
tylercraig9332 Sep 24, 2018
ec6f9ed
Cleaned up some ugly code
tylercraig9332 Sep 28, 2018
cdaeb90
There is a bug with JSON.parse, I added a clearer console comment to …
tylercraig9332 Sep 28, 2018
3342fc4
a brace was left off during the merge.
tylercraig9332 Oct 2, 2018
9b3ee33
I GOT SAVE AND LOAD WORKING !!!!!! but... I only have it hardcoded fo…
tylercraig9332 Oct 9, 2018
ae17252
Slideshows can now be saved to the database
tylercraig9332 Sep 20, 2018
5f62090
Added loading of Slideshow content; however there are some bugs still.
tylercraig9332 Sep 24, 2018
959fe96
Fixed a bug where a direct save was not working. Also discovered a bu…
tylercraig9332 Sep 24, 2018
8303976
Cleaned up some ugly code
tylercraig9332 Sep 28, 2018
2b09afd
a brace was left off during the merge.
tylercraig9332 Oct 2, 2018
f76af9d
I GOT SAVE AND LOAD WORKING !!!!!! but... I only have it hardcoded fo…
tylercraig9332 Oct 9, 2018
e19ceec
Removed all debug console messages
tylercraig9332 Oct 9, 2018
69a34ef
Added an update file as well as removed showId field from the db and …
tylercraig9332 Oct 15, 2018
d09d53f
each edit page is now unique. Also, cleaned up the navbar a bit.
tylercraig9332 Oct 15, 2018
f3e1ad1
Removed showId from update since I only have it
tylercraig9332 Oct 19, 2018
cf23a04
Directory on export.js was causing an error due to mispelling.
tylercraig9332 Oct 19, 2018
138e10c
Merge branch 'tylercraig9332-backChange' into studentMaster
Nov 7, 2018
b7c2864
Presenting of Slideshows 😁 (#46)
tylercraig9332 Nov 16, 2018
f64d244
Fix slide highlight (#49)
cambelem Nov 20, 2018
4b0e781
Added some functionality within Toolbar, and fixed delete (#52)
tylercraig9332 Nov 30, 2018
e2615cc
New EditView render and Toolbar functionality added (#57)
tylercraig9332 Feb 4, 2019
8f119af
Added support for plugins. Added undo, redo and cleaned up the toolba…
tylercraig9332 Mar 11, 2019
49637c9
Front-end view for editing quizes (#65)
tylercraig9332 May 15, 2019
36857e0
Present view for quizzes (#74)
tylercraig9332 May 21, 2019
df9250c
Showcard delete-alert and image (#71)
zanoble May 21, 2019
40727bc
Backend Miscellaneous Changes (#76)
tylercraig9332 May 21, 2019
10fb282
Navbar (#78)
zanoble May 23, 2019
2625355
Session Handling and User Roles 🙂 (#79)
tylercraig9332 May 24, 2019
22f51dc
fixed issue with active being overwritten on save of content
zanoble May 29, 2019
723530f
Merge pull request #82 from zanoble/activebug
zanoble May 29, 2019
78f8520
Updated project readme
tylercraig9332 May 29, 2019
937fe82
Seperated all slide content into it's own table and corresponding con…
tylercraig9332 Jun 18, 2019
b9290e9
Settings Menu (#90)
zanoble Jun 24, 2019
bdff5f5
Quiz rewrite and multiple select implementation (#96)
tylercraig9332 Jul 11, 2019
ec01b5d
Added Image Support and Fixed Index Bug (#97)
tylercraig9332 Jul 17, 2019
d39ec48
Added Alignment and Text Color
tylercraig9332 Jul 18, 2019
8dea8b4
Added alert for when selectionstate is collapsed
tylercraig9332 Jul 18, 2019
0406302
Added Links and removed plugins to Draft.js
tylercraig9332 Jul 18, 2019
5b0e895
Tweaked alignment and restructured files
tylercraig9332 Jul 19, 2019
e0e5b21
Fixed issues with Link and added tooltip
tylercraig9332 Jul 19, 2019
54d264c
Link tooltip now opens in a new tab
tylercraig9332 Jul 19, 2019
5d3ff4b
removed log
tylercraig9332 Jul 19, 2019
a502617
Added customStyleMap to Present
tylercraig9332 Jul 19, 2019
f609ce1
Added Advanced Text Color
tylercraig9332 Jul 22, 2019
4727562
Addressed dependency errors
tylercraig9332 Jul 22, 2019
ce39fab
Improved create new slideshow function in ShowView
tylercraig9332 Jul 22, 2019
8a84602
Fixed small error log bug with image
tylercraig9332 Jul 22, 2019
48e535f
removed code button from toolbar
tylercraig9332 Jul 22, 2019
a9f6100
added caching to alignment to address clunkyness
tylercraig9332 Jul 22, 2019
c486f3a
fixed caching bug with alignment of text
tylercraig9332 Jul 22, 2019
948642b
Added tooltips to toolbar buttons
tylercraig9332 Jul 22, 2019
ab07d13
Removed Draft-js-plugins and fixed bugs
tylercraig9332 Jul 23, 2019
c01c914
New image popover and addressed bugs
tylercraig9332 Jul 23, 2019
0c80bf4
Addressed more bugs
tylercraig9332 Jul 24, 2019
efab552
small bug
tylercraig9332 Jul 24, 2019
2b69ed4
Made link decorator more apparent
tylercraig9332 Jul 24, 2019
e97a58f
Draft.js Addons - Alignment, Text Color and Link Support (#98)
tylercraig9332 Jul 26, 2019
68ef6f5
Session view (#100)
zanoble Jul 30, 2019
34f59fc
Navigation Cards and New Edit Quiz Ui (#101)
tylercraig9332 Jul 30, 2019
25e1c62
ajax request in settings moved, lists alignment (#108)
zanoble Aug 13, 2019
6881f92
New ShowCards & Many Slideshow Visual Changes (#110)
tylercraig9332 Aug 13, 2019
6d23045
Fixed Bold / Italic Bug (#115)
tylercraig9332 Sep 9, 2019
56b8914
Small Style Changes (#116)
tylercraig9332 Oct 3, 2019
ae69842
Progress bar and navigation changes. (#117)
zanoble Oct 3, 2019
d11e522
moved small class componetns into Toolbar.jsx as function components …
tylercraig9332 Oct 21, 2019
b0b31b3
Removed old javascript files that were unused (#120)
tylercraig9332 Oct 21, 2019
3e6c016
#69 beautified index page (#119)
zanoble Oct 21, 2019
e270874
added async to redirects (#121)
tylercraig9332 Oct 22, 2019
1626857
Quiz Table Integration!! (#122)
tylercraig9332 Oct 23, 2019
f9f754e
Custom Response Messages and Present rewrite (#125)
tylercraig9332 Dec 17, 2019
c7791e3
Added loading skeleton to edit to prevent async bugs (#126)
tylercraig9332 Dec 17, 2019
3739d96
Added slide animations for an entire show and navCard placeholder img
tylercraig9332 Jan 6, 2020
6486b74
Added slide animations for an entire show and navCard placeholder img…
tylercraig9332 Jan 13, 2020
475d34e
EditView restructure (#131)
tylercraig9332 Jan 22, 2020
10e6159
merge
tylercraig9332 Jan 27, 2020
9b1fd7b
quick fix quiz null check error
tylercraig9332 Jan 27, 2020
d25ecda
Sort and Search for show (#124)
connorp987 Jan 29, 2020
549affb
Background (#133)
zanoble Oct 13, 2020
ba04529
Update README.md
connorp987 Jun 1, 2021
4e2fd0a
Update README.md
connorp987 Jun 2, 2021
c6d5f88
Update README.md
caldwellc1 Jun 2, 2021
78c8420
Added nbproject
Stardog Jun 24, 2021
bd59cbf
Updated to 1.4.3
Stardog Jun 24, 2021
7d37aed
Added missing 1.4.2 update call
Stardog Jun 24, 2021
fa0a2a0
Mass package update.
Stardog Jun 24, 2021
1b291d7
Dropped nbproject down a level
Stardog Jun 24, 2021
e6aa114
Altered to work with new webpage.
Stardog Jun 24, 2021
efd21ce
Updated webpack to work with new packages.
Stardog Jun 24, 2021
77a7e51
Updated tippy and formatted.
Stardog Jun 24, 2021
21c4ae7
Updated tippyjs/react
Stardog Jun 24, 2021
febc4f2
Added global for ES6 warning
Stardog Jun 24, 2021
6cc35c5
Formatting
Stardog Jun 24, 2021
24d66ad
Missing proptype assignments added.
Stardog Jun 24, 2021
f6ddce5
Comment note added.
Stardog Jun 24, 2021
e4f8cfc
Formatting and proptypes.
Stardog Jun 24, 2021
28450f3
Formatting and proptypes.
Stardog Jun 24, 2021
b0c60cf
Proptype, formatting, removed commented code.
Stardog Jun 24, 2021
6e9d39c
Added Tippy theme to draft buttons. Fixed #142
Stardog Jun 24, 2021
187e252
Added missing asset production code.
Stardog Jun 24, 2021
51a9d89
Added TerserPlugin, removed extra BSP include.
Stardog Jun 24, 2021
647f108
Removed unused production script.
Stardog Jun 24, 2021
52663ad
Added terser.
Stardog Jun 24, 2021
34db439
Added assets.json ignore.
Stardog Jun 24, 2021
e78b6c3
Resized giant 5MB file to under 1MB
Stardog Jun 24, 2021
ac0f760
Removing the log in requirement.
Stardog Jun 24, 2021
2a081db
Adding a new ip column to the session to record...
Stardog Jun 24, 2021
35922c6
Added the current role to the BadCommand exception messages.
Stardog Jun 24, 2021
934b310
Correcting the controller stack.
Stardog Jun 24, 2021
7079721
Removed the login screen on the front page.
Stardog Jun 24, 2021
10f6fad
Removed post function. Not needed.
Stardog Jun 24, 2021
9f46c67
Added ip variable.
Stardog Jun 24, 2021
10186cb
Added name variable to help with identification.
Stardog Jun 24, 2021
2be45ed
Removed commented code.
Stardog Jun 24, 2021
5df5648
Formatted.
Stardog Jun 24, 2021
4026f6c
Removed sign in.
Stardog Jun 24, 2021
4a24c30
New controller for user.
Stardog Jun 24, 2021
2e16242
Formatting and changing h1 to h2.
Stardog Jun 25, 2021
95e3144
Added proptypes.
Stardog Jun 25, 2021
b9bdb52
Formatting.
Stardog Jun 25, 2021
27ac0e8
Cleaned up formatting.
Stardog Jun 25, 2021
d8f7933
Added light-border theme to Tippy
Stardog Jun 25, 2021
aa0c5c9
Added tippy theming and proptypes.
Stardog Jun 25, 2021
edb4acc
Added light-border theme to Tippy
Stardog Jun 25, 2021
9b4d9e0
Tippy theme added.
Stardog Jun 25, 2021
0751fd3
Removed error alert. Very annoying to debug with it.
Stardog Jun 25, 2021
e028ad0
Reformatted intro page.
Stardog Jun 25, 2021
2607773
4 space formatting
Stardog Jun 28, 2021
19e5dba
Added a function to try and pull the current page id
Stardog Jun 28, 2021
4b8e1c1
USing getPageId to get the showId
Stardog Jun 28, 2021
c1d734c
Moved proptype for settings lower.
Stardog Jun 28, 2021
1d386dd
Adding showId to the url router.
Stardog Jun 28, 2021
96bfdfe
Admin button appears on present.
Stardog Jun 28, 2021
5d360ba
Added prop type for isAdmin
Stardog Jun 28, 2021
d7f0c3f
Added isAdmin variable.
Stardog Jun 28, 2021
f23d56d
Removed unnecessary Tippy labeling from some buttons.
Stardog Jun 28, 2021
b320a40
Edit defaults to forced login.
Stardog Jun 28, 2021
4f2c22f
Changed the jsonResponse to return proper numbers
Stardog Jun 28, 2021
cbf6d09
Fixed shows and slides allowing users to view inactive data.
Stardog Jun 28, 2021
de76823
getShowDetails now has an inactive parameter check.
Stardog Jun 28, 2021
19b5e1f
Added an inactive parameter check to get() and getSlides()
Stardog Jun 28, 2021
bf5d19f
Changed script to handle missing or inactive shows.
Stardog Jun 28, 2021
173c07e
Changed fetchShow due to sketchy results.
Stardog Jun 28, 2021
31cba29
Moved edit button to bottom.
Stardog Jun 28, 2021
52239cf
Changed prop types to numbers after json fix.
Stardog Jun 28, 2021
0006517
absolute search bar was overlaping title.
Stardog Jun 28, 2021
398af44
Fixed image move window placement.
Stardog Jun 28, 2021
d8bce73
Images can now be added to quizzes, fixed some formatting
connorp987 Jun 28, 2021
943480a
Removed Tippy.
Stardog Jun 28, 2021
a077248
Changed icon from fa images to image.
Stardog Jun 28, 2021
7e54f7d
Moved textcolor placement to top to prevent overlap with text.
Stardog Jun 28, 2021
6eef4d9
Fixed image placement pop to side of image.
Stardog Jun 28, 2021
4b1ff31
merge and style
connorp987 Jun 29, 2021
802501f
Added images to quiz present
connorp987 Jun 29, 2021
6db7802
removed unnecessary isQuiz check
connorp987 Jun 29, 2021
335452a
fixed imaged being too large in present
connorp987 Jun 29, 2021
23b5728
Added capability to add background images on Quizzes.
connorp987 Jul 16, 2021
219d04d
Alert added for background Insert.
connorp987 Jul 16, 2021
c639cc1
comments
connorp987 Jul 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
/javascript/dev/
/javascript/build/
/node_modules/
package-lock.json
/nbproject/
/assets.json
30 changes: 13 additions & 17 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace slideshow;

use slideshow\Factory\NavBar;
use slideshow\Factory\Home;
use Canopy\Request;
use Canopy\Response;
use Canopy\Server;
Expand All @@ -21,7 +22,7 @@ public function __construct()
parent::__construct();
$this->loadDefines();
$this->setTitle('slideshow');
$this->setProperName('SlideShow');
$this->setProperName('Slideshow');
spl_autoload_register('\slideshow\Module::autoloader', true, true);
}

Expand All @@ -39,7 +40,7 @@ public function getController(Request $request)
} catch (\Exception $e) {
if (SS_FRIENDLY_ERROR) {
\phpws2\Error::log($e);
echo \Layout::wrap('<div class="jumbotron"><h1>Uh oh...</h1><p>An error occurred with SlideShow.</p></div>', 'SlideShow Error', true);
echo \Layout::wrap('<div class="jumbotron"><h1>Uh oh...</h1><p>An error occurred with Slideshow.</p></div>', 'Slideshow Error', true);
exit();
} else {
throw $e;
Expand All @@ -55,8 +56,10 @@ private function friendlyController()

public function afterRun(Request $request, Response $response)
{
\Layout::addStyle('slideshow');
$this->showNavBar($request);
if (!\PHPWS_Core::atHome()) {
\Layout::addStyle('slideshow');
$this->showNavBar($request);
}
}

private function loadDefines()
Expand All @@ -72,29 +75,22 @@ private function loadDefines()

public function runTime(Request $request)
{
if (\Current_User::allow('slideshow')) {
NavBar::addItem($this->showList());
}
if ($request->getModule() !== 'slideshow') {
\Layout::addStyle('slideshow');
if (\PHPWS_Core::atHome()) {
$content = Home::view();
\Layout::add($content);
} else if ($request->getModule() !== 'slideshow') {
// PHPCORE::atHome
$this->showNavBar($request);
}
}

private function showNavBar(Request $request)
{
if ($request->isGet() && !$request->isAjax() &&
(\Current_User::allow('slideshow') || \Current_User::allow('users'))) {

if ($request->isGet() && !$request->isAjax()) {
NavBar::view($request);
}
}

private function showList()
{
return '<a href="./slideshow/Show/list"><i class="fa fa-list"></i> Show list</a>';
}

public static function autoloader($class_name)
{
static $not_found = array();
Expand Down
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,33 @@
# slideshow
It's a show consisting mainly of slides
# Slideshow
Slideshow is a quiz-integrated presentation-based web application designed and maintained by the student developers of [Electronic Student Services](http://ess.appstate.edu) at [Appalachian State University](http://www.appstate.edu)
## Getting Started
### What's needed to run Slideshow on your machine
* The latest version of [Canopy](https://github.com/AppStateESS/canopy) and all that is needed to run it (Docker, etc)
* Up-to-date versions of [Node](https://nodejs.org/en/) & [npm](https://www.npmjs.com/get-npm)
### To Install
* run `git clone https://github.com/AppStateESS/slideshow.git` in Canopy's `mod` directory
* head into Canopy and install the module through Boost
* in the `slideshow` directory, run `npm install`
* Create a `defines.php` based on `defines.dist.php` under `slideshow/config/`. Then change SLIDESHOW_REACT_DEV to `true` and SS_FRIENDLY_ERROR to `false`.
### Helpful Info
* [Canopy Setup Wiki](https://github.com/AppStateESS/slideshow/wiki/Canopy-Installation)
* [Connecting to the Database Wiki](https://github.com/AppStateESS/slideshow/wiki/Connecting-to-the-database-to-view-your-tables.)
## Contributing
Feel free to fork and open a pull request
## Authors
[Contribution View](https://github.com/AppStateESS/slideshow/graphs/contributors)

This project was originally in development by Matthew McNaney from the [core team at ESS](https://ess.appstate.edu/contact-us). Student developers stripped the project and rewrote it using new technologies. The project is currently guided by Cydney Caldwell.
### Student Rewrite Developers
* [Tyler Craig](https://github.com/AppStateESS/slideshow/commits?author=tylercraig9332)
* [Eric Cambel](https://github.com/AppStateESS/slideshow/commits?author=cambelem)
* [Zack Noble](https://github.com/AppStateESS/slideshow/commits?author=zanoble)
* [Connor Plunkett](https://github.com/connorp987)
## License
Copyright 2019 Electronic Student Services @ Appalachian State University

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49 changes: 49 additions & 0 deletions boost/Tables.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* MIT License
* Copyright (c) 2019 Electronic Student Services @ Appalachian State University
*
* See LICENSE file in root directory for copyright and distribution permissions.
*
* @author Matthew McNaney <mcnaneym@appstate.edu>
* @author Tyler Craig <craigta1@appstate.edu>
* @license https://opensource.org/licenses/MIT
*/
namespace slideshow;

use phpws2\Database;

class Tables
{

protected $db;

public function __construct()
{
$this->db = Database::getDB();
}

public function createShow()
{
$show = new \slideshow\Resource\ShowResource;
return $show->createTable($this->db);
}

public function createSession()
{
$session = new \slideshow\Resource\SessionResource;
return $session->createTable($this->db);
}

public function createSlide()
{
$slide = new \slideshow\Resource\SlideResource;
return $slide->createTable($this->db);
}

public function createQuiz()
{
$quiz = new \slideshow\Resource\QuizResource;
return $quiz->createTable($this->db);
}
}
6 changes: 3 additions & 3 deletions boost/boost.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* @author Tyler Craig <craigta1@appstate.edu>
* @author Matthew McNaney <mcnaneym@appstate.edu>
* @license http://opensource.org/licenses/gpl-3.0.html
*/
$proper_name = 'Slidehow';
$version = '1.0.0';
$proper_name = 'Slideshow';
$version = '1.4.4';
$register = false;
$unregister = false;
$import_sql = false;
Expand Down
2 changes: 1 addition & 1 deletion boost/controlpanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
'label' => 'Slideshow',
'restricted' => TRUE,
'url' => 'slideshow/',
'description' => 'Slideshow', 'Slideshow module using reveal.js.',
'description' => 'Slideshow', 'Slideshow module',
'image' => 'slideshow.png',
'tab' => 'content');
38 changes: 20 additions & 18 deletions boost/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,38 @@

/**
* @author Matthew McNaney <mcnaneym at appstate dot edu>
* @author Tyler Craig <craigta1 at appstate dot edu>
*/

use phpws2\Database;
require_once PHPWS_SOURCE_DIR . 'mod/slideshow/boost/Tables.php';

function slideshow_install(&$content)
{
$db = \phpws2\Database::getDB();
$db->begin();

$show;
$session;
$slide;
$quiz;
try {
$ssUserToSection = $db->buildTable('ss_usertosection');
$ssUserToSection->addDataType('userId', 'int')->setIsNull(true);
$ssUserToSection->addDataType('showId', 'int')->setIsNull(true);
$ssUserToSection->addDataType('sectionId', 'int')->setIsNull(true);
$ssUserToSection->addDataType('currentSlide', 'int')->setIsNull(true)->setDefault(1);
$ssUserToSection->addDataType('complete', 'int')->setIsNull(true)->setDefault(0);
$ssUserToSection->create();

$decision = new \slideshow\Resource\DecisionResource;
$decision->createTable($db);

$section = new \slideshow\Resource\SectionResource;
$section->createTable($db);
$tables = new slideshow\Tables;

$show = new \slideshow\Resource\ShowResource;
$show->createTable($db);
$show = $tables->createShow();
$session = $tables->createSession();
$slide = $tables->createSlide();
$quiz = $tables->createQuiz();

$slide = new \slideshow\Resource\SlideResource;
$slide->createTable($db);

} catch (\Exception $e) {
\phpws2\Error::log($e);
$db->rollback();

//$show->drop(true);
//$session->drop(true);
//$slide->drop(true);
//$quiz->drop(true);

throw $e;
}
$db->commit();
Expand Down
19 changes: 18 additions & 1 deletion boost/uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,22 @@

function slideshow_uninstall(&$content)
{
return TRUE;
$db = \phpws2\Database::getDB();
$db->begin();
try {
$db->buildTable('ss_show')->drop();
$db->buildTable('ss_session')->drop();
$db->buildTable('ss_slide')->drop();
$db->buildTable('ss_quiz')->drop();

}
catch (Exception $e) {
\phpws2\Error::log($e);
throw $e;
}
$db->commit();

$content[] = "Tables dropped";
return true;

}
Loading