Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 23da919d3a | |||
| e33f0bd77c |
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace RomhackPlaza\Master\Pub\Controller;
|
||||
|
||||
use RomhackPlaza\Master\Helper\Laravel;
|
||||
use XF\Mvc\ParameterBag;
|
||||
use XF\Mvc\Reply\AbstractReply;
|
||||
use XF\Pub\Controller\AbstractController;
|
||||
@@ -47,4 +48,36 @@ class Entry extends AbstractController {
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public static function getActivityDetails(array $activities)
|
||||
{
|
||||
return self::getActivityDetailsForContent(
|
||||
$activities,
|
||||
\XF::phrase('viewing_romhackplaza_entry'),
|
||||
'entry_id',
|
||||
function (array $ids)
|
||||
{
|
||||
$db = Laravel::db();
|
||||
if( !$db || empty($ids) )
|
||||
return [];
|
||||
|
||||
$entries = $db->fetchAll("
|
||||
SELECT id, complete_title as title, slug, type
|
||||
FROM entries
|
||||
WHERE id IN (" . $db->quote($ids) . ")
|
||||
");
|
||||
|
||||
$data = [];
|
||||
foreach( $entries as $entry ){
|
||||
$data[$entry['id']] = [
|
||||
'title' => $entry['title'],
|
||||
'url' => \XF::options()->homePageUrl . '/' . $entry['type'] . '/' . $entry['slug'],
|
||||
];
|
||||
}
|
||||
|
||||
return $data;
|
||||
},
|
||||
\XF::phrase('viewing_romhackplaza_database')
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace RomhackPlaza\Master\Pub\Controller;
|
||||
|
||||
use RomhackPlaza\Master\Helper\Laravel;
|
||||
use XF\Mvc\ParameterBag;
|
||||
use XF\Mvc\Reply\AbstractReply;
|
||||
use XF\Pub\Controller\AbstractController;
|
||||
@@ -47,4 +48,35 @@ class News extends AbstractController {
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public static function getActivityDetails(array $activities)
|
||||
{
|
||||
return self::getActivityDetailsForContent(
|
||||
$activities,
|
||||
\XF::phrase('viewing_romhackplaza_news'),
|
||||
'news_id',
|
||||
function (array $ids)
|
||||
{
|
||||
$db = Laravel::db();
|
||||
if( !$db || empty($ids) )
|
||||
return [];
|
||||
|
||||
$entries = $db->fetchAll("
|
||||
SELECT id, slug, title FROM news
|
||||
WHERE id IN (" . $db->quote($ids) . ")
|
||||
");
|
||||
|
||||
$data = [];
|
||||
foreach( $entries as $entry ){
|
||||
$data[$entry['id']] = [
|
||||
'title' => $entry['title'],
|
||||
'url' => \XF::options()->homePageUrl . '/news/' . $entry['slug'],
|
||||
];
|
||||
}
|
||||
|
||||
return $data;
|
||||
},
|
||||
\XF::phrase('viewing_romhackplaza_database')
|
||||
);
|
||||
}
|
||||
}
|
||||
42
Pub/Controller/RomhackPlaza.php
Normal file
42
Pub/Controller/RomhackPlaza.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace RomhackPlaza\Master\Pub\Controller;
|
||||
|
||||
use XF\Entity\SessionActivity;
|
||||
use XF\Mvc\ParameterBag;
|
||||
use XF\Pub\Controller\AbstractController;
|
||||
|
||||
class RomhackPlaza extends AbstractController
|
||||
{
|
||||
public static function getActivityDetails(array $activities)
|
||||
{
|
||||
/** @var SessionActivity $activity */
|
||||
foreach ($activities as $activity) {
|
||||
switch ( $activity->controller_action ){
|
||||
case 'Drafts':
|
||||
return \XF::phrase('viewing_romhackplaza_drafts');
|
||||
break;
|
||||
case 'Reviews':
|
||||
return \XF::phrase('viewing_romhackplaza_reviews');
|
||||
break;
|
||||
case 'Mod':
|
||||
return \XF::phrase('performing_moderation_duties');
|
||||
break;
|
||||
case 'Submit':
|
||||
return \XF::phrase('viewing_romhackplaza_submit');
|
||||
break;
|
||||
case 'Edit':
|
||||
return \XF::phrase('viewing_romhackplaza_edit');
|
||||
break;
|
||||
case 'Tools':
|
||||
return \XF::phrase('viewing_romhackplaza_tools');
|
||||
break;
|
||||
case 'Play':
|
||||
return \XF::phrase('viewing_romhackplaza_play');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return \XF::phrase('viewing_romhackplaza');
|
||||
}
|
||||
}
|
||||
@@ -58,4 +58,5 @@
|
||||
<phrase title="permission.romhackplaza_canSubmitTempFile" version_id="1000000" version_string="1.0.0"><![CDATA[Can Submit Temporary File]]></phrase>
|
||||
<phrase title="permission.romhackplaza_view" version_id="1000000" version_string="1.0.0"><![CDATA[View entries]]></phrase>
|
||||
<phrase title="permission_interface.romhackplaza" version_id="1000000" version_string="1.0.0"><![CDATA[Romhack Plaza permissions]]></phrase>
|
||||
<phrase title="rebuld_entries_count" version_id="1010170" version_string="1.1.1"><![CDATA[Rebuild entries count]]></phrase>
|
||||
</phrases>
|
||||
|
||||
@@ -88,6 +88,13 @@ $0]]></replace>
|
||||
</li>
|
||||
$0]]></replace>
|
||||
</modification>
|
||||
<modification type="admin" template="tools_rebuild" modification_key="rhpz_tools_rebuild_rhpz_entry_count" description="Add RHPZ Entry count job on rebuild caches page" execution_order="10" enabled="1" action="str_replace">
|
||||
<find><![CDATA[<!--[XF:after_message_count]-->]]></find>
|
||||
<replace><![CDATA[$0
|
||||
<xf:macro id="rebuild_job"
|
||||
arg-header="{{ phrase('rebuild_entries_count') }}"
|
||||
arg-job="RomhackPlaza\Master:EntriesCount" />]]></replace>
|
||||
</modification>
|
||||
<modification type="admin" template="user_edit" modification_key="rhpz_user_edit_delete_account_codes_tab" description="Add Tab for listing delete account codes in User edit" execution_order="10" enabled="1" action="str_replace">
|
||||
<find><![CDATA[<!--[XF:tabs:end]-->]]></find>
|
||||
<replace><![CDATA[<xf:if is="$user.user_id">
|
||||
|
||||
@@ -352,5 +352,65 @@
|
||||
"version_id": 1010170,
|
||||
"version_string": "1.1.1",
|
||||
"hash": "4aacc0a0b65d374943a84f9a0c8ad173"
|
||||
},
|
||||
"viewing_romhackplaza.txt": {
|
||||
"global_cache": false,
|
||||
"version_id": 1010270,
|
||||
"version_string": "1.1.2",
|
||||
"hash": "7227f6290a7ed21eb99f9bf648271e1d"
|
||||
},
|
||||
"viewing_romhackplaza_database.txt": {
|
||||
"global_cache": false,
|
||||
"version_id": 1010270,
|
||||
"version_string": "1.1.2",
|
||||
"hash": "f5fed0a3a280a492e174885c4139b292"
|
||||
},
|
||||
"viewing_romhackplaza_drafts.txt": {
|
||||
"global_cache": false,
|
||||
"version_id": 1010270,
|
||||
"version_string": "1.1.2",
|
||||
"hash": "5fa6af4f4d92357c0702cb20a4723408"
|
||||
},
|
||||
"viewing_romhackplaza_edit.txt": {
|
||||
"global_cache": false,
|
||||
"version_id": 1010270,
|
||||
"version_string": "1.1.2",
|
||||
"hash": "3e9d8bab76d8ed750e1ebad609625ec3"
|
||||
},
|
||||
"viewing_romhackplaza_entry.txt": {
|
||||
"global_cache": false,
|
||||
"version_id": 1010270,
|
||||
"version_string": "1.1.2",
|
||||
"hash": "ddbf5cfda5b2f0fc93f9f6341cf9bba3"
|
||||
},
|
||||
"viewing_romhackplaza_news.txt": {
|
||||
"global_cache": false,
|
||||
"version_id": 1010270,
|
||||
"version_string": "1.1.2",
|
||||
"hash": "c978170b03d4f82db58b3e94649d1855"
|
||||
},
|
||||
"viewing_romhackplaza_play.txt": {
|
||||
"global_cache": false,
|
||||
"version_id": 1010270,
|
||||
"version_string": "1.1.2",
|
||||
"hash": "8b3437b63b894e8b6be5acf3949a0c6a"
|
||||
},
|
||||
"viewing_romhackplaza_reviews.txt": {
|
||||
"global_cache": false,
|
||||
"version_id": 1010270,
|
||||
"version_string": "1.1.2",
|
||||
"hash": "d45735f9e3a9b21520461e75df1eddf4"
|
||||
},
|
||||
"viewing_romhackplaza_submit.txt": {
|
||||
"global_cache": false,
|
||||
"version_id": 1010270,
|
||||
"version_string": "1.1.2",
|
||||
"hash": "0495b6c845b61f6d068d94895cf52fb2"
|
||||
},
|
||||
"viewing_romhackplaza_tools.txt": {
|
||||
"global_cache": false,
|
||||
"version_id": 1010270,
|
||||
"version_string": "1.1.2",
|
||||
"hash": "c9ad17b928695681b4752643360f4102"
|
||||
}
|
||||
}
|
||||
1
_output/phrases/viewing_romhackplaza.txt
Normal file
1
_output/phrases/viewing_romhackplaza.txt
Normal file
@@ -0,0 +1 @@
|
||||
Viewing the website
|
||||
1
_output/phrases/viewing_romhackplaza_database.txt
Normal file
1
_output/phrases/viewing_romhackplaza_database.txt
Normal file
@@ -0,0 +1 @@
|
||||
Viewing database
|
||||
1
_output/phrases/viewing_romhackplaza_drafts.txt
Normal file
1
_output/phrases/viewing_romhackplaza_drafts.txt
Normal file
@@ -0,0 +1 @@
|
||||
Viewing drafts
|
||||
1
_output/phrases/viewing_romhackplaza_edit.txt
Normal file
1
_output/phrases/viewing_romhackplaza_edit.txt
Normal file
@@ -0,0 +1 @@
|
||||
Edit an entry
|
||||
1
_output/phrases/viewing_romhackplaza_entry.txt
Normal file
1
_output/phrases/viewing_romhackplaza_entry.txt
Normal file
@@ -0,0 +1 @@
|
||||
Viewing entry
|
||||
1
_output/phrases/viewing_romhackplaza_news.txt
Normal file
1
_output/phrases/viewing_romhackplaza_news.txt
Normal file
@@ -0,0 +1 @@
|
||||
Viewing news
|
||||
1
_output/phrases/viewing_romhackplaza_play.txt
Normal file
1
_output/phrases/viewing_romhackplaza_play.txt
Normal file
@@ -0,0 +1 @@
|
||||
Play online
|
||||
1
_output/phrases/viewing_romhackplaza_reviews.txt
Normal file
1
_output/phrases/viewing_romhackplaza_reviews.txt
Normal file
@@ -0,0 +1 @@
|
||||
Viewing reviews
|
||||
1
_output/phrases/viewing_romhackplaza_submit.txt
Normal file
1
_output/phrases/viewing_romhackplaza_submit.txt
Normal file
@@ -0,0 +1 @@
|
||||
Create an entry
|
||||
1
_output/phrases/viewing_romhackplaza_tools.txt
Normal file
1
_output/phrases/viewing_romhackplaza_tools.txt
Normal file
@@ -0,0 +1 @@
|
||||
Use tools
|
||||
@@ -2,8 +2,8 @@
|
||||
"legacy_addon_id": "",
|
||||
"title": "RomhackPlaza Master Addon",
|
||||
"description": "",
|
||||
"version_id": 1010170,
|
||||
"version_string": "1.1.1",
|
||||
"version_id": 1010270,
|
||||
"version_string": "1.1.2",
|
||||
"dev": "",
|
||||
"dev_url": "",
|
||||
"faq_url": "",
|
||||
|
||||
Reference in New Issue
Block a user