Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,12 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Advertisements
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @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 24 Sep 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\core\modules\admin\promotion;
|
||||
@@ -46,8 +45,8 @@ class _advertisements extends \IPS\Dispatcher\Controller
|
||||
$table->langPrefix = 'ads_';
|
||||
|
||||
/* Columns we need */
|
||||
$table->include = array( 'word_custom', 'ad_html', 'ad_impressions', 'ad_clicks', 'ad_start', 'ad_end', 'ad_maximum_value', 'ad_active' );
|
||||
$table->mainColumn = 'ad_html';
|
||||
$table->include = array( 'word_custom', 'ad_html', 'ad_impressions', 'ad_clicks', 'ad_active' );
|
||||
$table->mainColumn = 'word_custom';
|
||||
$table->noSort = array( 'ad_images', 'ad_html' );
|
||||
$table->joins = array(
|
||||
array( 'select' => 'w.word_custom', 'from' => array( 'core_sys_lang_words', 'w' ), 'where' => "w.word_key=CONCAT( 'core_advert_', core_advertisements.ad_id ) AND w.lang_id=" . \IPS\Member::loggedIn()->language()->id )
|
||||
@@ -57,7 +56,7 @@ class _advertisements extends \IPS\Dispatcher\Controller
|
||||
$table->sortBy = $table->sortBy ?: 'ad_start';
|
||||
$table->sortDirection = $table->sortDirection ?: 'desc';
|
||||
|
||||
$table->quickSearch = 'ad_html';
|
||||
$table->quickSearch = 'word_custom';
|
||||
$table->advancedSearch = array(
|
||||
'ad_html' => \IPS\Helpers\Table\SEARCH_CONTAINS_TEXT,
|
||||
'ad_start' => \IPS\Helpers\Table\SEARCH_DATE_RANGE,
|
||||
@@ -111,44 +110,17 @@ class _advertisements extends \IPS\Dispatcher\Controller
|
||||
'ad_clicks' => function( $val, $row )
|
||||
{
|
||||
return $row['ad_html'] ? \IPS\Theme::i()->getTemplate( 'global' )->shortMessage( 'unavailable', array( 'ipsType_light' ) ) : $val;
|
||||
},
|
||||
'ad_start' => function( $val, $row )
|
||||
{
|
||||
return \IPS\DateTime::ts( $val )->localeDate();
|
||||
},
|
||||
'ad_end' => function( $val, $row )
|
||||
{
|
||||
return $val ? \IPS\DateTime::ts( $val )->localeDate() : \IPS\Theme::i()->getTemplate( 'global' )->shortMessage( 'never', array( 'ipsType_light' ) );
|
||||
},
|
||||
'ad_maximum_value' => function( $val, $row )
|
||||
{
|
||||
if( $row['ad_maximum_value'] == '-1' )
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'global' )->shortMessage( 'unlimited', array( 'ipsType_light' ) );
|
||||
}
|
||||
|
||||
if( $row['ad_maximum_unit'] == 'c' )
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack( 'ad_maximum_value_c', FALSE, array( 'pluralize' => array( $row['ad_maximum_value'] ) ) );
|
||||
}
|
||||
else if( $row['ad_maximum_unit'] == 'i' )
|
||||
{
|
||||
return \IPS\Member::loggedIn()->language()->addToStack('ad_maximum_value_i', FALSE, array( 'pluralize' => array( $row['ad_maximum_value'] ) ) );
|
||||
}
|
||||
|
||||
return $val;
|
||||
}
|
||||
);
|
||||
|
||||
/* Specify the buttons */
|
||||
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'promotion', 'advertisements_add' ) )
|
||||
{
|
||||
$table->rootButtons = array(
|
||||
'add' => array(
|
||||
'icon' => 'plus',
|
||||
'title' => 'add',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=promotion&controller=advertisements&do=form' ),
|
||||
)
|
||||
\IPS\Output::i()->sidebar['actions']['add'] = array(
|
||||
'primary' => TRUE,
|
||||
'icon' => 'plus',
|
||||
'title' => 'add',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=promotion&controller=advertisements&do=form' )
|
||||
);
|
||||
}
|
||||
|
||||
@@ -190,13 +162,11 @@ class _advertisements extends \IPS\Dispatcher\Controller
|
||||
};
|
||||
|
||||
/* Action Buttons */
|
||||
\IPS\Output::i()->sidebar['actions'] = array(
|
||||
'settings' => array(
|
||||
'title' => 'ad_settings',
|
||||
'icon' => 'cog',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=promotion&controller=advertisements&do=settings' ),
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('ad_settings') )
|
||||
)
|
||||
\IPS\Output::i()->sidebar['actions']['settings'] = array(
|
||||
'title' => 'ad_settings',
|
||||
'icon' => 'cog',
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=promotion&controller=advertisements&do=settings' ),
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('ad_settings') )
|
||||
);
|
||||
|
||||
/* If Nexus is not installed, show message */
|
||||
@@ -208,7 +178,7 @@ class _advertisements extends \IPS\Dispatcher\Controller
|
||||
/* Display */
|
||||
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'promotion/advertisements.css', 'core', 'admin' ) );
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('advertisements');
|
||||
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global' )->block( 'advertisements', (string) $table );
|
||||
\IPS\Output::i()->output .= (string) $table;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user