Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -8,6 +8,32 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
class cms_hook_Topic extends _HOOK_CLASS_
|
||||
{
|
||||
/**
|
||||
* Can view?
|
||||
*
|
||||
* @param \IPS\Member|NULL $member The member to check for or NULL for the currently logged in member
|
||||
* @return bool
|
||||
*/
|
||||
public function canView( $member=NULL )
|
||||
{
|
||||
$canView = parent::canView( $member );
|
||||
$member = $member ? $member : \IPS\Member::loggedIn();
|
||||
|
||||
/* Whitelist which types of do we allow */
|
||||
$do = array( 'editComment' );
|
||||
|
||||
if ( ! $canView )
|
||||
{
|
||||
/* Check to see if it's attached to a database record and we are not a guest */
|
||||
if ( isset( \IPS\Request::i()->do ) and in_array( \IPS\Request::i()->do, $do ) and $record = \IPS\cms\Records::getLinkedRecord( $this ) and $member->member_id )
|
||||
{
|
||||
return $record->canView();
|
||||
}
|
||||
}
|
||||
|
||||
return $canView;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do Moderator Action
|
||||
*
|
||||
|
||||
@@ -22,6 +22,16 @@ public static function hookData() {
|
||||
<li class=\'ipsMenu_item\'>
|
||||
<a href=\'{url="app=cms&module=database&controller=topic&id=$topic->tid&_new=1" base="front" seoTemplate="topic_copy" seoTitle="$topic->title_seo"}\' data-ipsDialog data-ipsDialog-size=\'narrow\' data-ipsDialog-remoteVerify=\'false\' data-ipsDialog-title=\'{lang="copy_select_database"}\'>{lang="copy_topic_to_database"}</a>
|
||||
</li>
|
||||
{{endif}}',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'selector' => '#elTopicActionsBottom_menu',
|
||||
'type' => 'add_inside_start',
|
||||
'content' => '{{if $topic->hidden() != -2 and \IPS\Member::loggedIn()->modPermission( \'can_copy_topic_database\' )}}
|
||||
<li class=\'ipsMenu_item\'>
|
||||
<a href=\'{url="app=cms&module=database&controller=topic&id=$topic->tid&_new=1" base="front" seoTemplate="topic_copy" seoTitle="$topic->title_seo"}\' data-ipsDialog data-ipsDialog-size=\'narrow\' data-ipsDialog-remoteVerify=\'false\' data-ipsDialog-title=\'{lang="copy_select_database"}\'>{lang="copy_topic_to_database"}</a>
|
||||
</li>
|
||||
{{endif}}',
|
||||
),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user