├── data
└── cache
│ └── .gitignore
├── config
└── autoload
│ ├── .gitignore
│ ├── local.environment
│ ├── README.md
│ └── global.php
├── public
├── img
│ ├── logo.png
│ ├── FullStar.png
│ ├── HalfStar.png
│ ├── favicon.gif
│ ├── play-btn.png
│ ├── EmptyStar.png
│ ├── chartfail.png
│ ├── chartstub.png
│ ├── pause-btn.png
│ └── input_spinner.gif
├── css
│ └── images
│ │ ├── ui-icons_444444_256x240.png
│ │ ├── ui-icons_555555_256x240.png
│ │ ├── ui-icons_777620_256x240.png
│ │ ├── ui-icons_777777_256x240.png
│ │ ├── ui-icons_cc0000_256x240.png
│ │ └── ui-icons_ffffff_256x240.png
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── glyphicons-halflings-regular.woff2
├── .htaccess
└── index.php
├── module
└── Application
│ ├── language
│ ├── ar_JO.mo
│ ├── ar_SY.mo
│ ├── cs_CZ.mo
│ ├── de_DE.mo
│ ├── en_US.mo
│ ├── es_ES.mo
│ ├── fr_CA.mo
│ ├── fr_FR.mo
│ ├── it_IT.mo
│ ├── ja_JP.mo
│ ├── nb_NO.mo
│ ├── nl_NL.mo
│ ├── pl_PL.mo
│ ├── pt_BR.mo
│ ├── ru_RU.mo
│ ├── sk_SK.mo
│ ├── sl_SI.mo
│ ├── tr_TR.mo
│ ├── uk_UA.mo
│ ├── vi_VN.mo
│ ├── zh_CN.mo
│ └── zh_TW.mo
│ ├── src
│ └── Application
│ │ ├── Utils
│ │ ├── VoteType.php
│ │ ├── Events.php
│ │ ├── PostInitializationInterface.php
│ │ ├── DbConsts
│ │ │ ├── DbTags.php
│ │ │ ├── DbDictStatus.php
│ │ │ ├── DbDictAuthorship.php
│ │ │ ├── DbDictPageKind.php
│ │ │ ├── DbAuthors.php
│ │ │ ├── DbPageRequests.php
│ │ │ ├── DbCategories.php
│ │ │ ├── DbScpperUsers.php
│ │ │ ├── DbViewPageRequests.php
│ │ │ ├── DbFans.php
│ │ │ ├── DbVotes.php
│ │ │ ├── DbPageStatus.php
│ │ │ ├── DbVoteHistory.php
│ │ │ ├── DbUsers.php
│ │ │ ├── DbViewTags.php
│ │ │ ├── DbViewUsers.php
│ │ │ ├── DbRevisions.php
│ │ │ ├── DbPageReports.php
│ │ │ ├── DbUserActivity.php
│ │ │ ├── DbMembership.php
│ │ │ ├── DbPageSummary.php
│ │ │ ├── DbPages.php
│ │ │ ├── DbSites.php
│ │ │ ├── DbViewFans.php
│ │ │ ├── DbSiteStats.php
│ │ │ ├── DbViewMembership.php
│ │ │ ├── DbViewUserActivity.php
│ │ │ ├── DbViewRevisions.php
│ │ │ ├── DbViewRevisionsAll.php
│ │ │ ├── DbViewRevisionsDeleted.php
│ │ │ ├── DbViewPageReports.php
│ │ │ ├── DbViewAuthors.php
│ │ │ ├── DbViewAllPages.php
│ │ │ ├── DbViewVotes.php
│ │ │ ├── DbViewVotesAll.php
│ │ │ ├── DbViewVotesDeleted.php
│ │ │ ├── DbViewVoteHistoryAll.php
│ │ │ ├── DbViewSites.php
│ │ │ ├── DbViewPages.php
│ │ │ ├── DbViewPagesAll.php
│ │ │ └── DbViewPagesDeleted.php
│ │ ├── PostInitializer.php
│ │ ├── Order.php
│ │ ├── AuthorSummaryConsts.php
│ │ ├── AuthorView.php
│ │ ├── UserView.php
│ │ ├── QueryAggregateInterface.php
│ │ ├── PageView.php
│ │ ├── ReportState.php
│ │ ├── DbSelectColumns.php
│ │ ├── PageStatus.php
│ │ ├── UserType.php
│ │ ├── AuthorRole.php
│ │ └── PageKind.php
│ │ ├── Mapper
│ │ ├── SiteMapperInterface.php
│ │ ├── SiteDbSqlMapper.php
│ │ ├── PageReportMapperInterface.php
│ │ ├── SimpleMapperInterface.php
│ │ ├── UserMapperInterface.php
│ │ ├── TagMapperInterface.php
│ │ └── RevisionMapperInterface.php
│ │ ├── Factory
│ │ ├── Service
│ │ │ ├── SiteServiceFactory.php
│ │ │ ├── RevisionServiceFactory.php
│ │ │ ├── VoteServiceFactory.php
│ │ │ ├── PageServiceFactory.php
│ │ │ ├── TagServiceFactory.php
│ │ │ ├── UserServiceFactory.php
│ │ │ ├── FileEventLoggerFactory.php
│ │ │ ├── UtilityServiceFactory.php
│ │ │ ├── HubServiceFactory.php
│ │ │ ├── AuthentificationServiceFactory.php
│ │ │ └── DbAdapterFactory.php
│ │ ├── Controller
│ │ │ ├── IndexControllerFactory.php
│ │ │ ├── Roundup2018ControllerFactory.php
│ │ │ ├── SearchControllerFactory.php
│ │ │ ├── PageControllerFactory.php
│ │ │ ├── UserControllerFactory.php
│ │ │ ├── PagesControllerFactory.php
│ │ │ ├── UsersControllerFactory.php
│ │ │ ├── VotesControllerFactory.php
│ │ │ ├── RevisionsControllerFactory.php
│ │ │ ├── TagsControllerFactory.php
│ │ │ ├── AdminPanelControllerFactory.php
│ │ │ ├── LoginControllerFactory.php
│ │ │ └── ActivityControllerFactory.php
│ │ ├── Prototype
│ │ │ ├── SitePrototypeFactory.php
│ │ │ ├── RevisionPrototypeFactory.php
│ │ │ ├── PageReportPrototypeFactory.php
│ │ │ ├── MembershipPrototypeFactory.php
│ │ │ ├── AuthorshipPrototypeFactory.php
│ │ │ ├── UserPrototypeFactory.php
│ │ │ ├── VotePrototypeFactory.php
│ │ │ ├── UserActivityPrototypeFactory.php
│ │ │ └── PagePrototypeFactory.php
│ │ └── Mapper
│ │ │ ├── VoteDbSqlMapperFactory.php
│ │ │ ├── SiteDbSqlMapperFactory.php
│ │ │ ├── TagDbSqlMapperFactory.php
│ │ │ ├── UserActivityDbSqlMapperFactory.php
│ │ │ ├── RevisionDbSqlMapperFactory.php
│ │ │ ├── AuthorshipDbSqlMapperFactory.php
│ │ │ ├── PageDbSqlMapperFactory.php
│ │ │ ├── UserDbSqlMapperFactory.php
│ │ │ └── MembershipDbSqlMapperFactory.php
│ │ ├── Model
│ │ ├── TagInterface.php
│ │ ├── AuthorshipInterface.php
│ │ ├── RevisionInterface.php
│ │ ├── MembershipInterface.php
│ │ ├── Tag.php
│ │ ├── PageReportContributor.php
│ │ ├── AuthorSummaryInterface.php
│ │ ├── VoteInterface.php
│ │ ├── UserActivityInterface.php
│ │ └── PageReportInterface.php
│ │ ├── Component
│ │ └── PaginatedTable
│ │ │ ├── ColumnIterator.php
│ │ │ ├── TableInterface.php
│ │ │ ├── TableColumns.php
│ │ │ └── Table.php
│ │ ├── Service
│ │ ├── SiteServiceInterface.php
│ │ ├── TagServiceInterface.php
│ │ ├── UtilityServiceInterface.php
│ │ ├── TagService.php
│ │ ├── SiteService.php
│ │ ├── HubServiceInterface.php
│ │ ├── EventLogger.php
│ │ └── RevisionServiceInterface.php
│ │ ├── Hydrator
│ │ ├── UserDbHydrator.php
│ │ ├── Strategy
│ │ │ └── IntStrategy.php
│ │ ├── MembershipDbHydrator.php
│ │ ├── PrefixDbHydrator.php
│ │ ├── UserActivityDbHydrator.php
│ │ ├── PageReportFormHydrator.php
│ │ └── UserSiteDbHydrator.php
│ │ ├── Controller
│ │ └── Roundup2018Controller.php
│ │ └── Form
│ │ ├── DateIntervalForm.php
│ │ └── PageReport
│ │ └── ReviewPageReportForm.php
│ └── view
│ ├── partial
│ ├── site.phtml
│ ├── tables
│ │ ├── default
│ │ │ └── table.phtml
│ │ ├── responsive
│ │ │ ├── columns.phtml
│ │ │ └── cells.phtml
│ │ ├── users.phtml
│ │ ├── revisions.phtml
│ │ ├── editors.phtml
│ │ ├── members.phtml
│ │ ├── voters.phtml
│ │ ├── authors.phtml
│ │ ├── pages.phtml
│ │ └── siteUsers.phtml
│ ├── user.phtml
│ ├── authors.phtml
│ ├── page.phtml
│ ├── breadcrumb.phtml
│ └── author.phtml
│ └── application
│ ├── admin-panel
│ └── reports.phtml
│ ├── revisions
│ └── revisions.phtml
│ ├── pages
│ ├── pages.phtml
│ └── deleted.phtml
│ ├── users
│ └── users.phtml
│ ├── login
│ └── login.phtml
│ └── votes
│ └── votes.phtml
├── .gitignore
├── composer.json
├── Dockerfile
├── LICENSE.txt
├── Vagrantfile
└── init_autoloader.php
/data/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/config/autoload/.gitignore:
--------------------------------------------------------------------------------
1 | local.php
2 | *.local.php
3 |
--------------------------------------------------------------------------------
/public/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/img/logo.png
--------------------------------------------------------------------------------
/public/img/FullStar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/img/FullStar.png
--------------------------------------------------------------------------------
/public/img/HalfStar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/img/HalfStar.png
--------------------------------------------------------------------------------
/public/img/favicon.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/img/favicon.gif
--------------------------------------------------------------------------------
/public/img/play-btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/img/play-btn.png
--------------------------------------------------------------------------------
/public/img/EmptyStar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/img/EmptyStar.png
--------------------------------------------------------------------------------
/public/img/chartfail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/img/chartfail.png
--------------------------------------------------------------------------------
/public/img/chartstub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/img/chartstub.png
--------------------------------------------------------------------------------
/public/img/pause-btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/img/pause-btn.png
--------------------------------------------------------------------------------
/public/img/input_spinner.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/img/input_spinner.gif
--------------------------------------------------------------------------------
/module/Application/language/ar_JO.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/ar_JO.mo
--------------------------------------------------------------------------------
/module/Application/language/ar_SY.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/ar_SY.mo
--------------------------------------------------------------------------------
/module/Application/language/cs_CZ.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/cs_CZ.mo
--------------------------------------------------------------------------------
/module/Application/language/de_DE.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/de_DE.mo
--------------------------------------------------------------------------------
/module/Application/language/en_US.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/en_US.mo
--------------------------------------------------------------------------------
/module/Application/language/es_ES.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/es_ES.mo
--------------------------------------------------------------------------------
/module/Application/language/fr_CA.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/fr_CA.mo
--------------------------------------------------------------------------------
/module/Application/language/fr_FR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/fr_FR.mo
--------------------------------------------------------------------------------
/module/Application/language/it_IT.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/it_IT.mo
--------------------------------------------------------------------------------
/module/Application/language/ja_JP.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/ja_JP.mo
--------------------------------------------------------------------------------
/module/Application/language/nb_NO.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/nb_NO.mo
--------------------------------------------------------------------------------
/module/Application/language/nl_NL.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/nl_NL.mo
--------------------------------------------------------------------------------
/module/Application/language/pl_PL.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/pl_PL.mo
--------------------------------------------------------------------------------
/module/Application/language/pt_BR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/pt_BR.mo
--------------------------------------------------------------------------------
/module/Application/language/ru_RU.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/ru_RU.mo
--------------------------------------------------------------------------------
/module/Application/language/sk_SK.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/sk_SK.mo
--------------------------------------------------------------------------------
/module/Application/language/sl_SI.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/sl_SI.mo
--------------------------------------------------------------------------------
/module/Application/language/tr_TR.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/tr_TR.mo
--------------------------------------------------------------------------------
/module/Application/language/uk_UA.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/uk_UA.mo
--------------------------------------------------------------------------------
/module/Application/language/vi_VN.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/vi_VN.mo
--------------------------------------------------------------------------------
/module/Application/language/zh_CN.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/zh_CN.mo
--------------------------------------------------------------------------------
/module/Application/language/zh_TW.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/module/Application/language/zh_TW.mo
--------------------------------------------------------------------------------
/public/css/images/ui-icons_444444_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/css/images/ui-icons_444444_256x240.png
--------------------------------------------------------------------------------
/public/css/images/ui-icons_555555_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/css/images/ui-icons_555555_256x240.png
--------------------------------------------------------------------------------
/public/css/images/ui-icons_777620_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/css/images/ui-icons_777620_256x240.png
--------------------------------------------------------------------------------
/public/css/images/ui-icons_777777_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/css/images/ui-icons_777777_256x240.png
--------------------------------------------------------------------------------
/public/css/images/ui-icons_cc0000_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/css/images/ui-icons_cc0000_256x240.png
--------------------------------------------------------------------------------
/public/css/images/ui-icons_ffffff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/css/images/ui-icons_ffffff_256x240.png
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/public/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FiftyNine/scpper-web/HEAD/public/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | nbproject
2 | ._*
3 | .vagrant
4 | .~lock.*
5 | .buildpath
6 | .DS_Store
7 | .idea
8 | .project
9 | .settings
10 | vendor
11 | composer.phar
12 | *.log
13 | /public/phpinfo.php
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/VoteType.php:
--------------------------------------------------------------------------------
1 | link): ?>escapeHtml($this->site->getEnglishName()); ?>link): ?>
--------------------------------------------------------------------------------
/config/autoload/local.environment:
--------------------------------------------------------------------------------
1 | [
5 | 'dsn' => "mysql:dbname=".getenv('DB_NAME').";host=".getenv('DB_HOST').";charset=utf8mb4",
6 | 'username' => getenv('DB_USER'),
7 | 'password' => getenv('DB_PASSWORD'),
8 | ],
9 | ];
10 |
--------------------------------------------------------------------------------
/module/Application/view/partial/tables/default/table.phtml:
--------------------------------------------------------------------------------
1 | partial(
3 | 'partial/tables/responsive/table.phtml',
4 | [
5 | 'table' => $this->table,
6 | 'data' => $this->data,
7 | ]
8 | );
9 | ?>
10 |
--------------------------------------------------------------------------------
/module/Application/view/partial/user.phtml:
--------------------------------------------------------------------------------
1 | user; ?>
2 | getDeleted()): ?>
3 |
4 | escapeHtml($user->getDisplayName()); ?>
5 |
6 | getDeleted()): ?>
7 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fiftynine/scpperdb",
3 | "description": "Web Interface for SCP crawler database",
4 | "license": "MIT",
5 | "homepage": "https://github.com/FiftyNine/ScpperDB",
6 | "require": {
7 | "php": ">=5.5",
8 | "zendframework/zendframework": "~2.5",
9 | "ocramius/proxy-manager": "0.3.*"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/module/Application/view/partial/authors.phtml:
--------------------------------------------------------------------------------
1 | authors;
3 | $one = 1 === count($authors);
4 | ?>
5 |
6 | partial('partial/author.phtml', [
9 | 'author' => $author,
10 | 'one' => $one,
11 | 'collapsed' => $this->collapsed]);
12 | }
13 | ?>
14 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/Events.php:
--------------------------------------------------------------------------------
1 | table;
3 | $cols = $this->columns;
4 | $level = $this->level;
5 | for ($i=0; $i<$cols->getCount(); $i++) {
6 | echo $this->partial('partial/tables/responsive/column.phtml', [
7 | 'table' => $table,
8 | 'column' => $cols->getColumn($i),
9 | 'prefix' => $this->prefix."-".($i+1),
10 | 'level' => $level]);
11 | }
12 | ?>
13 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Service/SiteServiceFactory.php:
--------------------------------------------------------------------------------
1 | get('SiteMapper');
13 | return new SiteService($mapper);
14 | }
15 | }
--------------------------------------------------------------------------------
/module/Application/view/partial/tables/users.phtml:
--------------------------------------------------------------------------------
1 | row;
3 | switch($this->column->getName()) {
4 | case '#':
5 | echo $this->index;
6 | break;
7 | case 'User':
8 | echo $this->partial('partial/user.phtml', ['user' => $row]);
9 | break;
10 | case 'Membership':
11 | $res = [];
12 | foreach ($row->getMemberships() as $membership) {
13 | $res[] = strtoupper($membership->getSite()->getShortName());
14 | }
15 | echo implode(', ', $res);
16 | break;
17 | default:;
18 | }
19 | ?>
20 |
--------------------------------------------------------------------------------
/module/Application/view/partial/tables/responsive/cells.phtml:
--------------------------------------------------------------------------------
1 | columns;
3 | for ($i=0; $i<$cols->getCount(); $i++) {
4 | echo $this->partial('partial/tables/responsive/cell.phtml', [
5 | 'table' => $this->table,
6 | 'columns' => $this->columns,
7 | 'index' => $this->index,
8 | 'column' => $cols->getColumn($i),
9 | 'values' => $this->values,
10 | 'level' => $this->level,
11 | 'prefix' => $this->prefix."-".($i+1),
12 | 'data' => $this->data]);
13 | }
14 | ?>
15 |
16 |
--------------------------------------------------------------------------------
/module/Application/view/partial/page.phtml:
--------------------------------------------------------------------------------
1 | page;
3 | $title = $page->getTitle();
4 | if (is_null($title) || ($title == '')) {
5 | $title = $page->getName();
6 | }
7 | ?>
8 | getDeleted() /*&& $this->crossDeleted*/): ?>
9 |
10 | escapeHtml($title); ?>
11 | getAltTitle()): ?>
12 | escapeHtml(' - '.$page->getAltTitle()); ?>
13 |
14 |
15 | getDeleted()): ?>
16 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Model/TagInterface.php:
--------------------------------------------------------------------------------
1 | get('RevisionMapper');
13 | $userMapper = $serviceLocator->get('UserMapper');
14 | return new RevisionService($mapper, $userMapper);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Controller/IndexControllerFactory.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
14 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
15 | return new IndexController($hubService);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Service/VoteServiceFactory.php:
--------------------------------------------------------------------------------
1 | get('VoteMapper');
13 | $userMapper = $serviceLocator->get('UserMapper');
14 | $pageMapper = $serviceLocator->get('PageMapper');
15 | return new VoteService($mapper, $userMapper, $pageMapper);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Controller/Roundup2018ControllerFactory.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
14 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
15 | return new Roundup2018Controller($hubService);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Service/PageServiceFactory.php:
--------------------------------------------------------------------------------
1 | get('PageMapper');
13 | $userMapper = $serviceLocator->get('UserMapper');
14 | $authorshipMapper = $serviceLocator->get('AuthorshipMapper');
15 | return new PageService($mapper, $userMapper, $authorshipMapper);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/PostInitializationInterface.php:
--------------------------------------------------------------------------------
1 |
2 | pages as $key => $page):
5 | ?>
6 |
7 | pages) - 1):
10 | ?>
11 | getLabel(); ?>
12 |
16 | getLabel(); ?>
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbTags.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
21 | if (strtoupper($value) === $field) {
22 | return true;
23 | }
24 | };
25 | return false;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbDictStatus.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
21 | if (strtoupper($value) === $field) {
22 | return true;
23 | }
24 | };
25 | return false;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbDictAuthorship.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
21 | if (strtoupper($value) === $field) {
22 | return true;
23 | }
24 | };
25 | return false;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Prototype/SitePrototypeFactory.php:
--------------------------------------------------------------------------------
1 | current()->getSubColumns()->getCount() > 0;
21 | }
22 |
23 | public function getChildren()
24 | {
25 | return $this->current()->getSubColumns()->getIterator();
26 | }
27 | }
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbDictPageKind.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
21 | if (strtoupper($value) === $field) {
22 | return true;
23 | }
24 | };
25 | return false;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Model/AuthorshipInterface.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
22 | if (strtoupper($value) === $field) {
23 | return true;
24 | }
25 | };
26 | return false;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbPageRequests.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
22 | if (strtoupper($value) === $field) {
23 | return true;
24 | }
25 | };
26 | return false;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/Application/view/application/admin-panel/reports.phtml:
--------------------------------------------------------------------------------
1 | headTitle('Reports'); ?>
2 | headScript()->captureStart(); ?>
3 |
4 | // Anonymous self-executing function not to clutter global scope with temporary stuff
5 | (function () {
6 |
7 | function init()
8 | {
9 | scpper.tables.assignPaginatorEvents('#report-list', '/admin/reportList', {});
10 | }
11 |
12 | $(document).ready(init);
13 |
14 | }());
15 |
16 | headScript()->captureEnd(); ?>
17 | Reports
18 |
19 | table;
21 |
22 | echo $this->partial(
23 | 'partial/tables/default/table.phtml',
24 | [
25 | 'table' => $table,
26 | ]
27 | );
28 | ?>
29 |
30 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbCategories.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
22 | if (strtoupper($value) === $field) {
23 | return true;
24 | }
25 | };
26 | return false;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/PostInitializer.php:
--------------------------------------------------------------------------------
1 | PostInitialize();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/Order.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
23 | if (strtoupper($value) === $field) {
24 | return true;
25 | }
26 | };
27 | return false;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbViewPageRequests.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
23 | if (strtoupper($value) === $field) {
24 | return true;
25 | }
26 | };
27 | return false;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Model/RevisionInterface.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
24 | if (strtoupper($value) === $field) {
25 | return true;
26 | }
27 | };
28 | return false;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Prototype/RevisionPrototypeFactory.php:
--------------------------------------------------------------------------------
1 | get('UserMapper');
25 | return new Revision($userMapper);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Service/TagServiceFactory.php:
--------------------------------------------------------------------------------
1 | get('TagMapper');
24 | return new TagService($mapper);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbVotes.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
24 | if (strtoupper($value) === $field) {
25 | return true;
26 | }
27 | };
28 | return false;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/AuthorView.php:
--------------------------------------------------------------------------------
1 | roleId;
22 | }
23 | function getUser() {
24 | return $this;
25 | }
26 |
27 | public function __construct($userId, $userData, $roleId) {
28 | parent::__construct($userId, $userData);
29 | $this->roleId = $roleId;
30 | }
31 | }
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbPageStatus.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
24 | if (strtoupper($value) === $field) {
25 | return true;
26 | }
27 | };
28 | return false;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Prototype/PageReportPrototypeFactory.php:
--------------------------------------------------------------------------------
1 | get('PageMapper');
25 | return new PageReport($pageMapper);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbVoteHistory.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
24 | if (strtoupper($value) === $field) {
25 | return true;
26 | }
27 | };
28 | return false;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Controller/SearchControllerFactory.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
20 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
21 | return new SearchController($hubService);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Service/UserServiceFactory.php:
--------------------------------------------------------------------------------
1 | get('UserMapper');
14 | $membershipMapper = $serviceLocator->get('MembershipMapper');
15 | $activityMapper = $serviceLocator->get('UserActivityMapper');
16 | $authorshipMapper = $serviceLocator->get('AuthorshipMapper');
17 | $pageMapper = $serviceLocator->get('PageMapper');
18 | return new UserService($userMapper, $membershipMapper, $activityMapper, $authorshipMapper, $pageMapper);
19 | }
20 | }
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbUsers.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
24 | if (strtoupper($value) === $field) {
25 | return true;
26 | }
27 | };
28 | return false;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbViewTags.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
25 | if (strtoupper($value) === $field) {
26 | return true;
27 | }
28 | };
29 | return false;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM php:7.4-apache
2 | EXPOSE 80
3 |
4 | ENV APACHE_DOCUMENT_ROOT /var/www/scpper/public
5 |
6 | RUN apt update
7 | RUN apt install git -y
8 | RUN apt-get install -y \
9 | libzip-dev \
10 | && docker-php-ext-install zip \
11 | && docker-php-ext-install pdo_mysql
12 |
13 | RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
14 | RUN a2enmod rewrite
15 | RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
16 | RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
17 | WORKDIR /var/www/scpper
18 | RUN chown www-data:www-data /var/www/scpper
19 | RUN chmod 777 /var/www/scpper
20 | COPY . .
21 | RUN mv config/autoload/local.environment config/autoload/local.php
22 | COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
23 | RUN composer update
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbViewUsers.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
24 | if (strtoupper($value) === $field) {
25 | return true;
26 | }
27 | };
28 | return false;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/module/Application/view/partial/tables/revisions.phtml:
--------------------------------------------------------------------------------
1 | row;
3 | switch($this->column->getName()) {
4 | case '#':
5 | if ($this->collapsed) {
6 | echo "#";
7 | }
8 | echo $row->getIndex()+1;
9 | break;
10 | case 'User':
11 | echo $this->partial('partial/user.phtml', ['user' => $row->getUser()]);
12 | break;
13 | case 'Comment':
14 | if ($this->collapsed): ?>
15 |
16 | escapeHtml($row->getComments());
18 | break;
19 | case 'Time':
20 | if ($this->collapsed): ?>
21 |
22 | getDateTime()->format('Y-m-d H:i');
24 | break;
25 | default:;
26 | }
27 | ?>
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbRevisions.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
25 | if (strtoupper($value) === $field) {
26 | return true;
27 | }
28 | };
29 | return false;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/UserView.php:
--------------------------------------------------------------------------------
1 | user['dn'];
24 | }
25 | function getDeleted() {
26 | return $this->user['d'];
27 | }
28 | function getUrl() {
29 | return "/user/".$this->uid;
30 | }
31 |
32 | public function __construct($userId, $userData) {
33 | $this->uid = $userId;
34 | $this->user = $userData;
35 | }
36 | }
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Prototype/MembershipPrototypeFactory.php:
--------------------------------------------------------------------------------
1 | get('SiteMapper');
25 | $userMapper = $serviceLocator->get('UserMapper');
26 | return new Membership($siteMapper, $userMapper);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 | run();
32 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Prototype/AuthorshipPrototypeFactory.php:
--------------------------------------------------------------------------------
1 | get('UserMapper');
25 | $pageMapper = $serviceLocator->get('PageMapper');
26 | return new Authorship($userMapper, $pageMapper);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Prototype/UserPrototypeFactory.php:
--------------------------------------------------------------------------------
1 | get('UserActivityMapper');
25 | $membershipMapper = $serviceLocator->get('MembershipMapper');
26 | return new User($activityMapper, $membershipMapper);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/config/autoload/README.md:
--------------------------------------------------------------------------------
1 | About this directory:
2 | =====================
3 |
4 | By default, this application is configured to load all configs in
5 | `./config/autoload/{,*.}{global,local}.php`. Doing this provides a
6 | location for a developer to drop in configuration override files provided by
7 | modules, as well as cleanly provide individual, application-wide config files
8 | for things like database connections, etc.
9 |
10 | To use connection settings from environment variables make a copy of local.environment
11 | and rename it to local.php
12 | Default environment variables are:
13 | DB_HOST - address of the MySQL server
14 | DB_NAME - database on the server
15 | DB_USER - user account that have all necessary rights on the database
16 | DB_PASSWORD - password for the user
17 |
18 | If you want to use constant values instead of env variables, make a copy of local.environment,
19 | rename it to local.php and replace all getenv() calls with respective values.
20 |
--------------------------------------------------------------------------------
/config/autoload/global.php:
--------------------------------------------------------------------------------
1 | [
16 | 'driver' => 'Pdo',
17 | 'driver_options' => [
18 | //PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
19 | PDO::ATTR_EMULATE_PREPARES => false
20 | ],
21 | ],
22 | 'service_manager' => [
23 | 'factories' => [
24 | 'Zend\Db\Adapter\Adapter'
25 | => 'Application\Factory\Service\DbAdapterFactory',
26 | ],
27 | ],
28 | ];
29 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Controller/PageControllerFactory.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
25 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
26 | return new PageController($hubService);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Controller/UserControllerFactory.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
25 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
26 | return new UserController($hubService);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Controller/PagesControllerFactory.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
25 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
26 | return new PagesController($hubService);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Controller/UsersControllerFactory.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
25 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
26 | return new UsersController($hubService);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Controller/VotesControllerFactory.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
25 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
26 | return new VotesController($hubService);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Mapper/SiteDbSqlMapper.php:
--------------------------------------------------------------------------------
1 | Select::ORDER_ASCENDING];
29 | }
30 | return parent::findAll($conditions, $order, $paginated);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Controller/RevisionsControllerFactory.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
25 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
26 | return new RevisionsController($hubService);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Mapper/PageReportMapperInterface.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
27 | if (strtoupper($value) === $field) {
28 | return true;
29 | }
30 | };
31 | return false;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Prototype/VotePrototypeFactory.php:
--------------------------------------------------------------------------------
1 | get('UserMapper');
25 | $pageMapper = $serviceLocator->get('PageMapper');
26 | $voteMapper = $serviceLocator->get('VoteMapper');
27 | return new Vote($userMapper, $pageMapper, $voteMapper);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbUserActivity.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
27 | if (strtoupper($value) === $field) {
28 | return true;
29 | }
30 | };
31 | return false;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Controller/TagsControllerFactory.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
25 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
26 | return new TagsController($hubService);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Mapper/SimpleMapperInterface.php:
--------------------------------------------------------------------------------
1 | int) $order Associative array of field names and sorting orders (constants from \Application\Utils\Order)
21 | * @param bool $paginated
22 | * @return ResultSet|\Zend\Paginator\Paginator
23 | */
24 | public function findAll($conditions = null, $order = null, $paginated = false);
25 |
26 | /**
27 | * Returns number of all available objects
28 | *
29 | * @return int
30 | */
31 | public function countAll();
32 | }
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Mapper/VoteDbSqlMapperFactory.php:
--------------------------------------------------------------------------------
1 | get('Zend\Db\Adapter\Adapter');
16 | $hydrator = new ClassMethods();
17 | $hydrator->addStrategy(DbViewVotesAll::DATETIME, new DateTimeFormatterStrategy('Y-m-d H:i:s'));
18 | $prototype = $serviceLocator->get('VotePrototype');
19 | return new VoteDbSqlMapper($dbAdapter, $hydrator, $prototype, DbViewVotesAll::TABLE, DbViewVotesAll::__ID);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbMembership.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
27 | if (strtoupper($value) === $field) {
28 | return true;
29 | }
30 | };
31 | return false;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/QueryAggregateInterface.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
25 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
26 | return new AdminPanelController($hubService);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbPageSummary.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
27 | if (strtoupper($value) === $field) {
28 | return true;
29 | }
30 | };
31 | return false;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Service/SiteServiceInterface.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
29 | if (strtoupper($value) === $field) {
30 | return true;
31 | }
32 | };
33 | return false;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Mapper/SiteDbSqlMapperFactory.php:
--------------------------------------------------------------------------------
1 | get('Zend\Db\Adapter\Adapter');
17 | $hydrator = new ClassMethods();
18 | $names = [
19 | DbViewSites::SITEID => 'id',
20 | ];
21 | $hydrator->setNamingStrategy(new MapNamingStrategy($names));
22 | $prototype = $serviceLocator->get('SitePrototype');
23 | return new SiteDbSqlMapper($dbAdapter, $hydrator, $prototype, DbViewSites::TABLE, DbViewSites::SITEID);
24 | }
25 | }
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Controller/LoginControllerFactory.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
25 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
26 | $form = $realLocator->get('FormElementManager')->get('Application\Form\LoginForm');
27 | return new LoginController($hubService, $form);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Model/MembershipInterface.php:
--------------------------------------------------------------------------------
1 | 'id',
27 | DbViewUsers::WIKIDOTNAME => 'name'
28 | ];
29 | if ($prefix && is_string($prefix)) {
30 | $map = $this->getPrefixedMap($prefix, DbSelectColumns::USER, $map);
31 | }
32 | $this->setNamingStrategy(new MapNamingStrategy($map));
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbSites.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
29 | if (strtoupper($value) === $field) {
30 | return true;
31 | }
32 | };
33 | return false;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Controller/ActivityControllerFactory.php:
--------------------------------------------------------------------------------
1 | getServiceLocator();
25 | $hubService = $realLocator->get('Application\Service\HubServiceInterface');
26 | $form = $realLocator->get('FormElementManager')->get('Application\Form\DateIntervalForm');
27 | return new ActivityController($hubService, $form);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbViewFans.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
29 | if (strtoupper($value) === $field) {
30 | return true;
31 | }
32 | };
33 | return false;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Service/TagServiceInterface.php:
--------------------------------------------------------------------------------
1 | get('Zend\Db\Adapter\Adapter');
27 | $hydrator = new ClassMethods();
28 | return new TagDbSqlMapper($dbAdapter, $hydrator, new Tag(), DbViewTags::TABLE, DbViewTags::__ID);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Model/Tag.php:
--------------------------------------------------------------------------------
1 | tag;
36 | }
37 |
38 | /**
39 | * {@inheritDoc}
40 | */
41 | public function getPageCount()
42 | {
43 | return $this->pageCount;
44 | }
45 |
46 | public function setTag($tag)
47 | {
48 | $this->tag = $tag;
49 | }
50 |
51 | public function setPageCount($pageCount)
52 | {
53 | $this->pageCount = $pageCount;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Component/PaginatedTable/TableInterface.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
31 | if (strtoupper($value) === $field) {
32 | return true;
33 | }
34 | };
35 | return false;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbViewMembership.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
31 | if (strtoupper($value) === $field) {
32 | return true;
33 | }
34 | };
35 | return false;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/PageView.php:
--------------------------------------------------------------------------------
1 | page['t'];
24 | }
25 | public function getAltTitle() {
26 | return $this->page['at'];
27 | }
28 | public function getUrl() {
29 | return "/page/".$this->pid;
30 | }
31 | public function getDeleted() {
32 | return $this->page['d'];
33 | }
34 | public function getName() {
35 | return $this->page['u'];
36 | }
37 |
38 | public function __construct($pageId, $pageData) {
39 | $this->pid = $pageId;
40 | $this->page= $pageData;
41 | }
42 | }
--------------------------------------------------------------------------------
/module/Application/view/partial/author.phtml:
--------------------------------------------------------------------------------
1 |
2 | one || $this->collapsed || $this->author->getRole() !== \Application\Utils\AuthorRole::AUTHOR): ?>
3 | author->getRole()) {
5 | case \Application\Utils\AuthorRole::REWRITE_AUTHOR:
6 | $glyph = "glyphicon-erase";
7 | $hint = "Rewrite author";
8 | break;
9 | case \Application\Utils\AuthorRole::TRANSLATOR:
10 | $glyph = "glyphicon-globe";
11 | $hint = "Translator";
12 | break;
13 | default: /*\Application\Utils\AuthorRole::AUTHOR*/
14 | $glyph = "glyphicon-pencil";
15 | $hint = "Author";
16 | break;
17 | }
18 | ?>
19 |
20 |
21 | partial('partial/user.phtml', ['user' => $this->author->getUser()]);
23 | ?>
24 |
25 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/ReportState.php:
--------------------------------------------------------------------------------
1 | 'Pending',
24 | self::ACCEPTED => 'Accepted',
25 | self::DISMISSED => 'Dismissed',
26 | );
27 |
28 | /**
29 | * Get description for a state
30 | * @param int $state
31 | * @throws \InvalidArgumentException
32 | */
33 | static public function getDescription($state)
34 | {
35 | if (array_key_exists($state, self::STATE_DESCRIPTIONS)) {
36 | return self::STATE_DESCRIPTIONS[$state];
37 | } else {
38 | throw new \InvalidArgumentException("Unknown report state - $state");
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Prototype/UserActivityPrototypeFactory.php:
--------------------------------------------------------------------------------
1 | get('SiteMapper');
25 | $userMapper = $serviceLocator->get('UserMapper');
26 | $voteMapper = $serviceLocator->get('VoteMapper');
27 | $revisionMapper = $serviceLocator->get('RevisionMapper');
28 | $authorMapper = $serviceLocator->get('AuthorshipMapper');
29 | return new UserActivity($siteMapper, $userMapper, $voteMapper, $revisionMapper, $authorMapper);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/module/Application/view/partial/tables/editors.phtml:
--------------------------------------------------------------------------------
1 | row;
3 | switch($this->column->getName()) {
4 | case '#':
5 | if ($this->collapsed) {
6 | echo "#";
7 | }
8 | echo $this->index;
9 | break;
10 | case 'User':
11 | $deleted = $row[\Application\Utils\DbConsts\DbViewRevisions::USERDELETED];
12 | if ($deleted) { echo ""; }
13 | echo '';
16 | echo $this->escapeHtml($row[\Application\Utils\DbConsts\DbViewRevisions::USERDISPLAYNAME]);
17 | echo "";
18 | if ($deleted) { echo "";}
19 | break;
20 | case 'Revisions':
21 | if ($this->collapsed): ?>
22 |
23 | collapsed): ?>
28 | %
29 | data['total']*100, 2);
31 | break;
32 | default:;
33 | }
34 | ?>
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Service/FileEventLoggerFactory.php:
--------------------------------------------------------------------------------
1 | addFilter($filter);
32 | $logger->addWriter($writer);
33 | return new EventLogger($logger);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Hydrator/Strategy/IntStrategy.php:
--------------------------------------------------------------------------------
1 | allowEmpty = $allowEmpty;
28 | }
29 |
30 | public function extract($value)
31 | {
32 | return $value;
33 | }
34 |
35 | public function hydrate($value)
36 | {
37 | if ((is_null($value) || '' === $value) && ($this->allowEmpty)) {
38 | return null;
39 | } else if (is_int($value) || (strval(intval($value)) === $value)) {
40 | return intval($value);
41 | } else {
42 | throw new \InvalidArgumentException();
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbViewUserActivity.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
32 | if (strtoupper($value) === $field) {
33 | return true;
34 | }
35 | };
36 | return false;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Mapper/UserMapperInterface.php:
--------------------------------------------------------------------------------
1 | getPrefixedMap($prefix, DbSelectColumns::MEMBERSHIP);
28 | $this->setNamingStrategy(new MapNamingStrategy($map));
29 | $joinDateName = $prefix.'_'.$joinDateName;
30 | }
31 | $this->addStrategy($joinDateName, new DateTimeFormatterStrategy('Y-m-d H:i:s'));
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Mapper/UserActivityDbSqlMapperFactory.php:
--------------------------------------------------------------------------------
1 | get('Zend\Db\Adapter\Adapter');
26 | $hydrator = new UserActivityDbHydrator();
27 | $prototype = $serviceLocator->get('UserActivityPrototype');
28 | return new UserActivityDbSqlMapper($dbAdapter, $hydrator, $prototype, DbViewUserActivity::TABLE, '');
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Prototype/PagePrototypeFactory.php:
--------------------------------------------------------------------------------
1 | get('SiteMapper');
25 | $pageMapper = $serviceLocator->get('PageMapper');
26 | $authorMapper = $serviceLocator->get('AuthorshipMapper');
27 | $revisionMapper = $serviceLocator->get('RevisionMapper');
28 | $voteMapper = $serviceLocator->get('VoteMapper');
29 | $tagMapper = $serviceLocator->get('TagMapper');
30 | return new Page($siteMapper, $pageMapper, $authorMapper, $revisionMapper, $voteMapper, $tagMapper);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbSelectColumns.php:
--------------------------------------------------------------------------------
1 | $value) {
31 | $newmap[$prefix.'_'.$key] = $value;
32 | }
33 | foreach ($columns as $col) {
34 | $name = $prefix.'_'.$col;
35 | if (!array_key_exists($name, $newmap)) {
36 | $newmap[$name] = $col;
37 | }
38 | }
39 | return $newmap;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/module/Application/view/application/revisions/revisions.phtml:
--------------------------------------------------------------------------------
1 | headTitle('Revisions'); ?>
2 | headScript()->captureStart(); ?>
3 |
4 | // Anonymous self-executing function not to clutter global scope with temporary stuff
5 | (function () {
6 |
7 | function init()
8 | {
9 | scpper.tables.assignPaginatorEvents('#editor-list', '/revisions/editorList', {siteId: site->getId();?>});
10 | }
11 |
12 | $(document).ready(init);
13 |
14 | }());
15 |
16 | headScript()->captureEnd(); ?>
17 |
18 | partial('partial/site.phtml', ['site' => $this->site, 'link' => true]);?>
19 |
20 | getLastUpdate()): ?>
21 |
22 | Updated getLastUpdate()->format('Y-m-d H:i'); ?>
23 |
24 |
25 | Editors (table->getPaginator()->getTotalItemCount();?> total)
26 |
27 | table;
29 |
30 | echo $this->partial(
31 | 'partial/tables/default/table.phtml',
32 | [
33 | 'table' => $table,
34 | 'data' => [
35 | 'total' => $this->total
36 | ]
37 | ]
38 | );
39 | ?>
40 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Service/UtilityServiceInterface.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
34 | if (strtoupper($value) === $field) {
35 | return true;
36 | }
37 | };
38 | return false;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbViewRevisionsAll.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
34 | if (strtoupper($value) === $field) {
35 | return true;
36 | }
37 | };
38 | return false;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/module/Application/view/application/pages/pages.phtml:
--------------------------------------------------------------------------------
1 | headTitle('Pages'); ?>
2 | headScript()->captureStart(); ?>
3 |
4 | // Anonymous self-executing function not to clutter global scope with temporary stuff
5 | (function () {
6 |
7 | function init()
8 | {
9 | scpper.tables.assignPaginatorEvents('#page-list', '/pages/pageList', {
10 | siteId: site->getId();?>,
11 | deleted: 0
12 | });
13 | }
14 |
15 | $(document).ready(init);
16 |
17 | }());
18 |
19 | headScript()->captureEnd(); ?>
20 |
21 | partial('partial/site.phtml', ['site' => $this->site, 'link' => true]);?>
22 |
23 | site->getLastUpdate()): ?>
24 |
25 | Updated site->getLastUpdate()->format('Y-m-d H:i'); ?>
26 |
27 |
28 | Pages (table->getPaginator()->getTotalItemCount();?> total)
29 |
30 | table;
32 |
33 | echo $this->partial(
34 | 'partial/tables/default/table.phtml',
35 | [
36 | 'table' => $table,
37 | 'data' => ['siteId' => $this->site->getId()],
38 | ]
39 | );
40 | ?>
41 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Mapper/RevisionDbSqlMapperFactory.php:
--------------------------------------------------------------------------------
1 | get('Zend\Db\Adapter\Adapter');
16 | $hydrator = new ClassMethods();
17 | $names = [
18 | DbViewRevisionsAll::REVISIONID => 'id',
19 | DbViewRevisionsAll::REVISIONINDEX => 'index',
20 | ];
21 | $hydrator->setNamingStrategy(new MapNamingStrategy($names));
22 | $hydrator->addStrategy(DbViewRevisionsAll::DATETIME, new \Zend\Stdlib\Hydrator\Strategy\DateTimeFormatterStrategy('Y-m-d H:i:s'));
23 | $prototype = $serviceLocator->get('RevisionPrototype');
24 | return new RevisionDbSqlMapper($dbAdapter, $hydrator, $prototype, DbViewRevisionsAll::TABLE, DbViewRevisionsAll::REVISIONID);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbViewRevisionsDeleted.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
34 | if (strtoupper($value) === $field) {
35 | return true;
36 | }
37 | };
38 | return false;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/module/Application/view/application/pages/deleted.phtml:
--------------------------------------------------------------------------------
1 | headTitle('Deleted pages'); ?>
2 | headScript()->captureStart(); ?>
3 |
4 | // Anonymous self-executing function not to clutter global scope with temporary stuff
5 | (function () {
6 |
7 | function init()
8 | {
9 | scpper.tables.assignPaginatorEvents('#page-list', '/pages/pageList', {
10 | siteId: site->getId();?>,
11 | deleted: 1
12 | });
13 | }
14 |
15 | $(document).ready(init);
16 |
17 | }());
18 |
19 | headScript()->captureEnd(); ?>
20 |
21 | partial('partial/site.phtml', ['site' => $this->site, 'link' => true]);?>
22 |
23 | site->getLastUpdate()): ?>
24 |
25 | Updated site->getLastUpdate()->format('Y-m-d H:i'); ?>
26 |
27 |
28 | Deleted pages (table->getPaginator()->getTotalItemCount();?> total)
29 |
30 | table;
32 |
33 | echo $this->partial(
34 | 'partial/tables/default/table.phtml',
35 | [
36 | 'table' => $table,
37 | 'data' => ['siteId' => $this->site->getId()],
38 | ]
39 | );
40 | ?>
41 |
42 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Mapper/TagMapperInterface.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
36 | if (strtoupper($value) === $field) {
37 | return true;
38 | }
39 | };
40 | return false;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Mapper/AuthorshipDbSqlMapperFactory.php:
--------------------------------------------------------------------------------
1 | get('Zend\Db\Adapter\Adapter');
26 | $hydrator = new ClassMethods();
27 | $names = new \Zend\Stdlib\Hydrator\NamingStrategy\MapNamingStrategy([
28 | DbViewAuthors::ROLEID => 'role'
29 | ]);
30 | $hydrator->setNamingStrategy($names);
31 | $prototype = $serviceLocator->get('AuthorshipPrototype');
32 | return new AuthorshipDbSqlMapper($dbAdapter, $hydrator, $prototype, DbViewAuthors::TABLE, '');
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Utils/DbConsts/DbViewAuthors.php:
--------------------------------------------------------------------------------
1 | getConstants() as $name => $value) {
37 | if (strtoupper($value) === $field) {
38 | return true;
39 | }
40 | };
41 | return false;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Service/TagService.php:
--------------------------------------------------------------------------------
1 | mapper = $mapper;
31 | }
32 |
33 | /**
34 | * {@inheritDoc}
35 | */
36 | public function countSiteTags($siteId)
37 | {
38 | return $this->mapper->countSiteTags($siteId);
39 | }
40 |
41 | /**
42 | * {@inheritDoc}
43 | */
44 | public function find($siteId, $tag)
45 | {
46 | return $this->mapper->findTag($siteId, $tag);
47 | }
48 |
49 | /**
50 | * {@inheritDoc}
51 | */
52 | public function findSiteTags($siteId)
53 | {
54 | return $this->mapper->findSiteTags($siteId, false);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/module/Application/src/Application/Factory/Service/UtilityServiceFactory.php:
--------------------------------------------------------------------------------
1 | get('Application\Service\SiteServiceInterface');
19 | $request = $serviceLocator->get('Request');
20 | $dbAdapter = $serviceLocator->get('Zend\Db\Adapter\Adapter');
21 | $cookies = $request->getHeaders('Cookie');
22 | if ($cookies && $cookies->offsetExists(UtilityService::SITE_ID_COOKIE)) {
23 | $siteId = (int)$cookies->offsetGet(UtilityService::SITE_ID_COOKIE);
24 | } else {
25 | $siteId = UtilityService::ENGLISH_SITE_ID;
26 | }
27 | $searchForm = $serviceLocator->get('FormElementManager')->get('Application\Form\SearchForm');
28 | return new UtilityService($siteService, $dbAdapter, $searchForm, $siteId);
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/Vagrantfile:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | VAGRANTFILE_API_VERSION = '2'
5 |
6 | @script = <