Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -142,13 +142,13 @@ class _ban extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Build form */
|
||||
$form = new \IPS\Helpers\Form();
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'ban_type', $current['ban_type'], TRUE, array( 'options' => array(
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'ban_type', $current ? $current['ban_type'] : NULL , TRUE, array( 'options' => array(
|
||||
'ip' => 'ban_filter_ip_select',
|
||||
'email' => 'ban_filter_email_select',
|
||||
'name' => 'ban_filter_name_select'
|
||||
) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'ban_content', $current['ban_content'], TRUE ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'ban_reason', $current['ban_reason'] ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'ban_content', $current ? $current['ban_content'] : "", TRUE ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'ban_reason', $current ? $current['ban_reason'] : "" ) );
|
||||
|
||||
/* Handle submissions */
|
||||
if ( $values = $form->values() )
|
||||
|
||||
@@ -64,18 +64,6 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
$methodTable = new \IPS\Helpers\Table\Custom( array( 'inline' => array( 'method' => \IPS\Member::loggedIn()->language()->addToStack('member_notifications_inline') ) ), \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=notifications', 'admin' ) );
|
||||
$methodTable->langPrefix = 'notificationsettings_';
|
||||
$methodTable->rowButtons = function( $row, $k ) {
|
||||
return array(
|
||||
'edit' => array(
|
||||
'title' => 'edit',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=notifications&do=method', 'admin' )->setQueryString( 'id', $k ),
|
||||
'icon' => 'pencil'
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
if( !\IPS\CIC )
|
||||
{
|
||||
@@ -100,7 +88,13 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('notifications');
|
||||
\IPS\Output::i()->output = $typeTable . $methodTable;
|
||||
|
||||
if ( ! \IPS\Notification::canUseWebPush() )
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('global')->message( 'acp_notifications_cannot_use_web_push', 'general' );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->output .= $typeTable;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,7 +130,8 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
\IPS\Task::queue( 'core', 'PruneLargeTable', array(
|
||||
'table' => 'core_follow',
|
||||
'where' => array( 'follow_member_id IN(?)', \IPS\Db::i()->select( 'member_id', 'core_members', array( 'last_activity < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . $values['prune_follows'] . 'D' ) )->getTimestamp() ) ) ),
|
||||
'where' => array( 'follow_app!=? AND follow_area!=? AND follow_member_id IN(?)', 'core', 'member', \IPS\Db::i()->select( 'member_id', 'core_members', array( 'last_activity < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . $values['prune_follows'] . 'D' ) )->getTimestamp() ) ) ),
|
||||
'setting' => 'prune_follows',
|
||||
'deleteJoin' => array(
|
||||
'column' => 'member_id',
|
||||
'table' => 'core_members',
|
||||
@@ -187,7 +182,7 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
$form->addMessage( $option['description'] );
|
||||
}
|
||||
|
||||
if ( !\in_array( 'inline', $option['disabled'] ) or ( \IPS\Settings::i()->mobile_app_id and !\in_array( 'push', $option['disabled'] ) ) or !\in_array( 'email', $option['disabled'] ) )
|
||||
if ( !\in_array( 'inline', $option['disabled'] ) or ( ( \IPS\Settings::i()->mobile_app_id || \IPS\Notification::webPushEnabled() ) and !\in_array( 'push', $option['disabled'] ) ) or !\in_array( 'email', $option['disabled'] ) )
|
||||
{
|
||||
$canEditField = new \IPS\Helpers\Form\YesNo( 'notificationsettings_editable_' . $key, $defaultConfiguration[ $key ]['editable'], FALSE, array(
|
||||
'togglesOn' => array( "member_notifications_{$key}_inline_editable", "member_notifications_{$key}_push", "member_notifications_{$key}_email_editable" ),
|
||||
@@ -212,8 +207,16 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( array( 'inline', 'push', 'email' ) as $k )
|
||||
|
||||
if ( \IPS\Notification::canUseWebPush() )
|
||||
{
|
||||
$types = array( 'inline', 'push', 'email' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$types = array( 'inline', 'email' );
|
||||
}
|
||||
foreach ( $types as $k )
|
||||
{
|
||||
if ( !\in_array( $k, $option['disabled'] ) )
|
||||
{
|
||||
@@ -278,7 +281,7 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ( !\in_array( 'inline', $option['disabled'] ) or ( \IPS\Settings::i()->mobile_app_id and !\in_array( 'push', $option['disabled'] ) ) or !\in_array( 'email', $option['disabled'] ) )
|
||||
if ( !\in_array( 'inline', $option['disabled'] ) or ( ( \IPS\Settings::i()->mobile_app_id || \IPS\Notification::webPushEnabled() ) and !\in_array( 'push', $option['disabled'] ) ) or !\in_array( 'email', $option['disabled'] ) )
|
||||
{
|
||||
$row = array(
|
||||
'notification_key' => $key,
|
||||
@@ -293,7 +296,7 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
if ( $k === 'push' )
|
||||
{
|
||||
if ( !\IPS\Settings::i()->mobile_app_id )
|
||||
if ( !\IPS\Settings::i()->mobile_app_id && !\IPS\Notification::webPushEnabled() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -349,36 +352,6 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->output = $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notification List Settings
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function method()
|
||||
{
|
||||
$form = new \IPS\Helpers\Form;
|
||||
|
||||
$form->addHeader('notification_preferences');
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'notification_prefs_sound', \IPS\Settings::i()->notification_prefs_sound ? 'default' : 'optional', FALSE, array( 'options' => array(
|
||||
'default' => 'admin_notification_pref_default',
|
||||
'optional' => 'admin_notification_pref_optional',
|
||||
) ), NULL, NULL, NULL, 'notification_prefs_sound' ) );
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
$values['notification_prefs_sound'] = ( $values['notification_prefs_sound'] === 'default' );
|
||||
|
||||
$form->saveAsSettings( $values );
|
||||
|
||||
\IPS\Session::i()->log( 'acplog__notification_settings' );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=notifications' ), 'saved' );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=notifications' ), \IPS\Member::loggedIn()->language()->addToStack( 'menu__core_membersettings_notifications' ) );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('notificationsettings');
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('global')->block( 'notificationsettings', $form, FALSE );
|
||||
}
|
||||
|
||||
/**
|
||||
* Member Auto Follow Preferences
|
||||
*
|
||||
|
||||
@@ -117,7 +117,7 @@ class _profilesettings extends \IPS\Dispatcher\Controller
|
||||
'options' => array( 'public' => 'profile_birthday_type_public', 'private' => 'profile_birthday_type_private', 'none' => 'profile_birthday_type_none' )
|
||||
), NULL, NULL, NULL, 'profile_birthday_type' ) );
|
||||
|
||||
if( !\IPS\CIC AND \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'profiles', 'member_history_prune' ) )
|
||||
if( !\IPS\CIC AND \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'member_history_prune' ) )
|
||||
{
|
||||
$form->addHeader( 'profile_member_history' );
|
||||
$form->add( new \IPS\Helpers\Form\Interval( 'prune_member_history', \IPS\Settings::i()->prune_member_history, FALSE, array( 'valueAs' => \IPS\Helpers\Form\Interval::DAYS, 'unlimited' => 0, 'unlimitedLang' => 'never' ), NULL, \IPS\Member::loggedIn()->language()->addToStack('after'), NULL, 'prune_member_history' ) );
|
||||
@@ -214,6 +214,7 @@ class _profilesettings extends \IPS\Dispatcher\Controller
|
||||
\IPS\Task::queue( 'core', 'PruneLargeTable', array(
|
||||
'table' => 'core_member_history',
|
||||
'where' => array( 'log_date < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . $values['prune_member_history'] . 'D' ) )->getTimestamp() ),
|
||||
'setting' => 'prune_member_history',
|
||||
), 4 );
|
||||
}
|
||||
|
||||
@@ -222,6 +223,7 @@ class _profilesettings extends \IPS\Dispatcher\Controller
|
||||
\IPS\Task::queue( 'core', 'PruneLargeTable', array(
|
||||
'table' => 'core_members_known_ip_addresses',
|
||||
'where' => array( 'last_seen < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . $values['prune_known_ips'] . 'D' ) )->getTimestamp() ),
|
||||
'setting' => 'prune_known_ips',
|
||||
), 4 );
|
||||
}
|
||||
|
||||
@@ -230,6 +232,7 @@ class _profilesettings extends \IPS\Dispatcher\Controller
|
||||
\IPS\Task::queue( 'core', 'PruneLargeTable', array(
|
||||
'table' => 'core_members_known_devices',
|
||||
'where' => array( 'last_seen < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . $values['prune_known_devices'] . 'D' ) )->getTimestamp() ),
|
||||
'setting' => 'prune_known_devices',
|
||||
), 4 );
|
||||
}
|
||||
|
||||
@@ -238,6 +241,7 @@ class _profilesettings extends \IPS\Dispatcher\Controller
|
||||
\IPS\Task::queue( 'core', 'PruneLargeTable', array(
|
||||
'table' => 'core_item_markers',
|
||||
'where' => array( 'item_member_id IN(?)', \IPS\Db::i()->select( 'member_id', 'core_members', array( 'last_activity < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'P' . $values['prune_item_markers'] . 'D' ) )->getTimestamp() ) ) ),
|
||||
'setting' => 'prune_item_markers',
|
||||
'deleteJoin' => array(
|
||||
'column' => 'member_id',
|
||||
'table' => 'core_members',
|
||||
|
||||
@@ -1,258 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief ranks
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 10 Apr 2013
|
||||
*/
|
||||
|
||||
namespace IPS\core\modules\admin\membersettings;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* ranks
|
||||
*/
|
||||
class _ranks extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/**
|
||||
* @brief Has been CSRF-protected
|
||||
*/
|
||||
public static $csrfProtected = TRUE;
|
||||
|
||||
/**
|
||||
* Execute
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'ranks_manage' );
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function manage()
|
||||
{
|
||||
/* Create the table */
|
||||
$table = new \IPS\Helpers\Table\Db( 'core_member_ranks', \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks' ) );
|
||||
|
||||
/* Columns */
|
||||
$table->joins = array(
|
||||
array( 'select' => 'w.word_custom', 'from' => array( 'core_sys_lang_words', 'w' ), 'where' => "w.word_key=CONCAT( 'core_member_rank_', core_member_ranks.id ) AND w.lang_id=" . \IPS\Member::loggedIn()->language()->id )
|
||||
);
|
||||
|
||||
$table->include = array( 'word_custom', 'posts', 'pips' );
|
||||
$table->langPrefix = 'member_ranks_';
|
||||
$table->mainColumn = 'title';
|
||||
$table->noSort = array( 'pips' );
|
||||
|
||||
$table->parsers = array(
|
||||
'pips' => function( $val, $row )
|
||||
{
|
||||
if ( $row['use_icon'] and $row['icon'] )
|
||||
{
|
||||
return "<img src='" . \IPS\File::get( 'core_Theme', $row['icon'] )->url . "' alt=''>";
|
||||
}
|
||||
else
|
||||
{
|
||||
return str_repeat("<span class='ipsPip'></span>", \intval($val) );
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$table->sortBy = $table->sortBy ?: 'posts';
|
||||
$table->sortDirection = $table->sortDirection ?: 'asc';
|
||||
|
||||
/* Root Buttons */
|
||||
\IPS\Output::i()->sidebar['actions'] = array(
|
||||
'add' => array(
|
||||
'primary' => TRUE,
|
||||
'icon' => 'plus',
|
||||
'title' => 'member_ranks_add',
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('member_ranks_add') ),
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks&do=form' ),
|
||||
)
|
||||
);
|
||||
|
||||
/* Row buttons */
|
||||
$table->rowButtons = function( $row )
|
||||
{
|
||||
$return = array();
|
||||
|
||||
$return['edit'] = array(
|
||||
'icon' => 'pencil',
|
||||
'title' => 'edit',
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('edit') ),
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks&do=form&id=' ) . $row['id'],
|
||||
);
|
||||
|
||||
$return['delete'] = array(
|
||||
'icon' => 'times-circle',
|
||||
'title' => 'delete',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks&do=delete&id=' ) . $row['id'],
|
||||
'data' => array( 'delete' => '' ),
|
||||
);
|
||||
|
||||
return $return;
|
||||
};
|
||||
|
||||
/* The incredibly complex search code */
|
||||
$table->quickSearch = 'word_custom';
|
||||
|
||||
/* Show a message about the setting to allow members to set their own */
|
||||
switch ( \IPS\Settings::i()->post_titlechange )
|
||||
{
|
||||
case -1:
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack('rankown_none');
|
||||
break;
|
||||
|
||||
case 0:
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack('rankown_always');
|
||||
break;
|
||||
|
||||
default:
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack( 'rankown_limit', FALSE, array( 'pluralize' => array( \IPS\Settings::i()->post_titlechange ) ) );
|
||||
break;
|
||||
}
|
||||
$message .= ' <a href="' . \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks&do=settings' ) . '" data-ipsDialog data-ipsDialog-title="' . \IPS\Member::loggedIn()->language()->addToStack('change') . '">' . \IPS\Member::loggedIn()->language()->addToStack('change') . '</a>';
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->message( $message, 'information', NULL, FALSE );
|
||||
|
||||
/* Display */
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('ranks');
|
||||
\IPS\Output::i()->output .= (string) $table;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add/Edit Rank
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function form()
|
||||
{
|
||||
$current = NULL;
|
||||
|
||||
if ( \IPS\Request::i()->id )
|
||||
{
|
||||
$current = \IPS\Db::i()->select( '*', 'core_member_ranks', array( 'id=?', \IPS\Request::i()->id ) )->first();
|
||||
}
|
||||
|
||||
/* Build form */
|
||||
$form = new \IPS\Helpers\Form();
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'member_ranks_word_custom', NULL, TRUE, array( 'app' => 'core', 'key' => ( $current ? "core_member_rank_{$current['id']}" : NULL ) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'member_ranks_posts', $current ? $current['posts'] : 0, TRUE, array( 'min' => 0 ) ) );
|
||||
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'member_use_icon', $current ? $current['use_icon'] : NULL, FALSE, array(
|
||||
'parse' => 'raw',
|
||||
'options' => array( 0 => \IPS\Member::loggedIn()->language()->addToStack('member_ranks_pip_number', FALSE, array( 'htmlsprintf' => array( "<span class='ipsPip'></span>" ) ) ), 1 => \IPS\Member::loggedIn()->language()->addToStack('member_ranks_pip_icon') ),
|
||||
'toggles' => array( 0 => array('member_ranks_pips'), 1 => array('member_ranks_icon') )
|
||||
) ) );
|
||||
|
||||
/* Pip Icon */
|
||||
$pip = NULL;
|
||||
if ( $current AND $current['icon'] )
|
||||
{
|
||||
$pip = \IPS\File::get( 'core_Theme', $current['icon'] );
|
||||
}
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'member_ranks_num_pips' , $current ? $current['pips'] : 0, FALSE, array( 'min' => 0, 'max' => 100 ), NULL, NULL, NULL, 'member_ranks_pips' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'member_ranks_icon', $pip, FALSE, array( 'image' => array( 'maxWidth' => 140, 'maxHeight' => 140 ), 'storageExtension' => 'core_Theme' ), NULL, NULL, NULL, 'member_ranks_icon' ) );
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
$save = array(
|
||||
'posts' => \intval( $values['member_ranks_posts'] ),
|
||||
'pips' => \intval( $values['member_ranks_num_pips'] ),
|
||||
'use_icon' => \intval( $values['member_use_icon'] ),
|
||||
'icon' => '',
|
||||
);
|
||||
|
||||
if ( $values['member_ranks_icon'] instanceof \IPS\File )
|
||||
{
|
||||
$save['icon'] = (string) $values['member_ranks_icon'];
|
||||
}
|
||||
|
||||
if ( $current )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_member_ranks', $save, array( 'id=?', $current['id'] ) );
|
||||
$id = $current['id'];
|
||||
\IPS\Session::i()->log( 'acplogs__rank_edited', array( $save['posts'] => FALSE ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = \IPS\Db::i()->insert( 'core_member_ranks', $save );
|
||||
\IPS\Session::i()->log( 'acplogs__rank_created', array( $save['posts'] => FALSE ) );
|
||||
}
|
||||
|
||||
\IPS\Lang::saveCustom( 'core', "core_member_rank_{$id}", $values['member_ranks_word_custom'] );
|
||||
unset( \IPS\Data\Store::i()->ranks );
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks' ), 'saved' );
|
||||
}
|
||||
|
||||
/* Display */
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( $current ? "core_member_rank_{$current['id']}" : 'add', $form, FALSE );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'ranks_manage' );
|
||||
|
||||
/* Make sure the user confirmed the deletion */
|
||||
\IPS\Request::i()->confirmedDelete();
|
||||
|
||||
try
|
||||
{
|
||||
$current = \IPS\Db::i()->select( '*', 'core_member_ranks', array( 'id=?', \IPS\Request::i()->id ) )->first();
|
||||
|
||||
\IPS\Session::i()->log( 'acplogs__rank_deleted', array( $current['posts'] => FALSE ) );
|
||||
\IPS\Db::i()->delete( 'core_member_ranks', array( 'id=?', \IPS\Request::i()->id ) );
|
||||
\IPS\Lang::deleteCustom( 'core', 'core_member_rank_' . \IPS\Request::i()->id );
|
||||
}
|
||||
catch ( \UnderflowException $e ) { }
|
||||
|
||||
unset( \IPS\Data\Store::i()->ranks );
|
||||
|
||||
/* Clear guest page caches */
|
||||
\IPS\Data\Cache::i()->clearAll();
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function settings()
|
||||
{
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'post_titlechange', \IPS\Settings::i()->post_titlechange, FALSE, array( 'unlimited' => -1, 'unlimitedLang' => 'never_allow' ) ) );
|
||||
if ( $form->values() )
|
||||
{
|
||||
$form->saveAsSettings();
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks' ), 'saved' );
|
||||
}
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( 'ranks', $form, FALSE );
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ class _reputation extends \IPS\Node\Controller
|
||||
/* Build Form */
|
||||
$form = new \IPS\Helpers\Form();
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'reputation_enabled', \IPS\Settings::i()->reputation_enabled, FALSE, array( 'togglesOn' => array( 'reputation_point_types', 'reputation_protected_groups', 'reputation_can_self_vote', 'reputation_highlight', 'reputation_show_profile', 'overall_reaction_count' ) ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'reputation_protected_groups', explode( ',', \IPS\Settings::i()->reputation_protected_groups ), FALSE, array( 'options' => \IPS\Member\Group::groups( TRUE, FALSE ), 'parse' => 'normal', 'multiple' => TRUE ), NULL, NULL, NULL, 'reputation_protected_groups' ) );
|
||||
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'reputation_protected_groups', explode( ',', \IPS\Settings::i()->reputation_protected_groups ), FALSE, array( 'options' => \IPS\Member\Group::groups( TRUE, FALSE ), 'parse' => 'normal', 'multiple' => TRUE ), NULL, NULL, NULL, 'reputation_protected_groups' ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'reputation_can_self_vote', \IPS\Settings::i()->reputation_can_self_vote, FALSE, array(), NULL, NULL, NULL, 'reputation_can_self_vote' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Number( 'reputation_highlight', \IPS\Settings::i()->reputation_highlight, FALSE, array( 'unlimited' => 0, 'unlimitedLang' => 'never' ), NULL, \IPS\Member::loggedIn()->language()->addToStack('reputation_highlight_prefix'), \IPS\Member::loggedIn()->language()->addToStack('reputation_highlight_suffix'), 'reputation_highlight' ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'reputation_show_profile', \IPS\Settings::i()->reputation_show_profile, FALSE, array(), NULL, NULL, NULL, 'reputation_show_profile' ) );
|
||||
@@ -186,7 +186,7 @@ class _reputation extends \IPS\Node\Controller
|
||||
$form = new \IPS\Helpers\Form();
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'reputation_leaderboard_on', \IPS\Settings::i()->reputation_leaderboard_on, FALSE, array( 'togglesOn' => array( 'reputation_leaderboard_default_tab', 'form_header_leaderboard_tabs_leaderboard', 'reputation_show_days_won_trophy', 'reputation_timezone', 'form_header_leaderboard_tabs_members', 'reputation_top_members_overview', 'reputation_overview_max_members', 'reputation_top_members_filters', 'reputation_max_members', 'leaderboard_excluded_groups' ) ), NULL, NULL, NULL, 'reputation_leaderboard_on' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'reputation_leaderboard_default_tab', \IPS\Settings::i()->reputation_leaderboard_default_tab, FALSE, array( 'options' => array( 'leaderboard' => 'leaderboard_tabs_leaderboard', 'history' => 'leaderboard_tabs_history', 'members' => 'leaderboard_tabs_members' ) ), NULL, NULL, NULL, 'reputation_leaderboard_default_tab' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'leaderboard_excluded_groups', explode( ',', \IPS\Settings::i()->leaderboard_excluded_groups ), FALSE, array( 'options' => \IPS\Member\Group::groups( TRUE, FALSE ), 'parse' => 'normal', 'multiple' => TRUE ), NULL, NULL, NULL, 'leaderboard_excluded_groups' ) );
|
||||
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'leaderboard_excluded_groups', explode( ',', \IPS\Settings::i()->leaderboard_excluded_groups ), FALSE, array( 'options' => \IPS\Member\Group::groups( TRUE, FALSE ), 'parse' => 'normal', 'multiple' => TRUE ), NULL, NULL, NULL, 'leaderboard_excluded_groups' ) );
|
||||
$form->addHeader('leaderboard_tabs_leaderboard');
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'reputation_show_days_won_trophy', \IPS\Settings::i()->reputation_show_days_won_trophy, FALSE, array( 'togglesOn' => array() ), NULL, NULL, NULL, 'reputation_show_days_won_trophy' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Timezone( 'reputation_timezone', \IPS\Settings::i()->reputation_timezone, FALSE, array(), NULL, NULL, NULL, 'reputation_timezone' ) );
|
||||
@@ -411,7 +411,7 @@ class _reputation extends \IPS\Node\Controller
|
||||
* @param string $lastUsedTab The tab last used in the form
|
||||
* @return void
|
||||
*/
|
||||
protected function _afterSave( \IPS\Node\Model $old = NULL, \IPS\Node\Model $new, $lastUsedTab = FALSE )
|
||||
protected function _afterSave( ?\IPS\Node\Model $old, \IPS\Node\Model $new, $lastUsedTab = FALSE )
|
||||
{
|
||||
if( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user