Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -35,7 +35,7 @@ class _Records
|
||||
foreach( \IPS\cms\Databases::databases() as $database )
|
||||
{
|
||||
$theOnlyCategory = NULL;
|
||||
if ( $database->page_id > 0 and $database->can('add') )
|
||||
if ( $database->page_id > 0 and $database->can('view') and $database->can('add') )
|
||||
{
|
||||
$catClass = '\IPS\cms\Categories' . $database->id;
|
||||
if ( $catClass::canOnAny('add') )
|
||||
@@ -47,13 +47,13 @@ class _Records
|
||||
if( $database->use_categories AND $theOnlyCategory = $catClass::theOnlyNode() )
|
||||
{
|
||||
$items[ 'cms_create_menu_records_' . $database->id ] = array(
|
||||
'link' => $theOnlyCategory->url()->setQueryString('do', 'form')
|
||||
'link' => $theOnlyCategory->url()->setQueryString( array( 'do' => 'form', 'd' => $database->id ) )
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
$items[ 'cms_create_menu_records_' . $database->id ] = array(
|
||||
'link' => $page->url()->setQueryString('do', 'form'),
|
||||
'link' => $page->url()->setQueryString( array( 'do' => 'form', 'd' => $database->id ) ),
|
||||
'extraData' => ( $database->use_categories ) ? array( 'data-ipsDialog' => true, 'data-ipsDialog-size' => "narrow" ) : array(),
|
||||
'title' => 'cms_select_category'
|
||||
);
|
||||
|
||||
@@ -48,14 +48,15 @@ class _BlockContent
|
||||
/**
|
||||
* Permission check for attachments
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param array $attachment The attachment data
|
||||
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -59,14 +59,15 @@ class _Records
|
||||
/**
|
||||
* Permission check for attachments
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param array $attachment The attachment data
|
||||
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
|
||||
{
|
||||
if ( ! $id3 )
|
||||
{
|
||||
|
||||
@@ -48,14 +48,15 @@ class _Widgets
|
||||
/**
|
||||
* Permission check for attachments
|
||||
*
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param \IPS\Member $member The member
|
||||
* @param int|null $id1 Primary ID
|
||||
* @param int|null $id2 Secondary ID
|
||||
* @param string|null $id3 Arbitrary data
|
||||
* @param array $attachment The attachment data
|
||||
* @param bool $viewOnly If true, just check if the user can see the attachment rather than download it
|
||||
* @return bool
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
|
||||
{
|
||||
if ( ! $id3 )
|
||||
{
|
||||
|
||||
@@ -12,24 +12,15 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
/**
|
||||
* Front Navigation Extension: Pages
|
||||
*/
|
||||
class _Cms extends \IPS\core\FrontNavigation\FrontNavigationAbstract
|
||||
class _Cms
|
||||
{
|
||||
/**
|
||||
* Get Title
|
||||
* @deprecated
|
||||
*
|
||||
* @return string
|
||||
* @return bool
|
||||
*/
|
||||
public function title()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Link
|
||||
*
|
||||
* @return \IPS\Http\Url
|
||||
*/
|
||||
public function link()
|
||||
final public function deprecated()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -80,6 +80,7 @@ class _RebuildCategories
|
||||
{
|
||||
$cat = $class::constructFromData( $row );
|
||||
$cat->setLastComment();
|
||||
$cat->setLastReview();
|
||||
$cat->save();
|
||||
|
||||
$parsed++;
|
||||
|
||||
@@ -84,7 +84,15 @@ class _ResyncTopicContent
|
||||
$class = '\IPS\cms\Records' . $data['databaseId'];
|
||||
$where = NULL;
|
||||
$parsed = 0;
|
||||
$database = \IPS\cms\Databases::load( $data['databaseId'] );
|
||||
try
|
||||
{
|
||||
$database = \IPS\cms\Databases::load( $data['databaseId'] );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
throw new \IPS\Task\Queue\OutOfRangeException;
|
||||
}
|
||||
|
||||
if ( ! $database->forum_record )
|
||||
{
|
||||
$cats = iterator_to_array( \IPS\Db::i()->select( 'category_id', 'cms_database_categories', array( 'category_forum_record=1 AND category_database_id=?', $data['databaseId'] ) ) );
|
||||
|
||||
@@ -43,6 +43,24 @@ class _Databases
|
||||
'sitemap_databases_priority' => new \IPS\Helpers\Form\Select( 'sitemap_databases_priority', \IPS\Settings::i()->sitemap_databases_priority, FALSE, array( 'options' => \IPS\Sitemap::$priorities, 'unlimited' => '-1', 'unlimitedLang' => 'sitemap_dont_include' ), NULL, NULL, NULL, 'sitemap_databases_priority' )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings for ACP configuration
|
||||
*
|
||||
* @param array $values Values
|
||||
* @return void
|
||||
*/
|
||||
public function saveSettings( $values )
|
||||
{
|
||||
if ( $values['sitemap_configuration_info'] )
|
||||
{
|
||||
\IPS\Settings::i()->changeValues( array( 'sitemap_databases_count' => $this->recommendedSettings['sitemap_databases_count'], 'sitemap_databases_priority' => $this->recommendedSettings['sitemap_databases_priority'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Settings::i()->changeValues( array( 'sitemap_databases_count' => $values['sitemap_databases_count'], 'sitemap_databases_priority' => $values['sitemap_databases_priority'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the sitemap filename(s)
|
||||
@@ -115,6 +133,12 @@ class _Databases
|
||||
*/
|
||||
public function generateSitemap( $filename, $sitemap )
|
||||
{
|
||||
/* We have elected to not add databases to the sitemap */
|
||||
if ( ! \IPS\Settings::i()->sitemap_databases_count )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
$tmp = explode( '_', $filename );
|
||||
$databaseId = intval( array_shift( $tmp ) );
|
||||
$database = \IPS\cms\Databases::load( $databaseId );
|
||||
@@ -165,7 +189,14 @@ class _Databases
|
||||
$totalLimit = \IPS\Settings::i()->sitemap_databases_count;
|
||||
if ( $totalLimit > -1 and ( $offset + $limit ) > $totalLimit )
|
||||
{
|
||||
$limit = $totalLimit - $offset;
|
||||
if ( $totalLimit < $limit )
|
||||
{
|
||||
$limit = $totalLimit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$limit = $totalLimit - $offset;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $class::getItemsWithPermission( $class::sitemapWhere(), NULL, array( $offset, $limit ), 'read', \IPS\Content\Hideable::FILTER_PUBLIC_ONLY, 0, new \IPS\Member, TRUE ) as $item )
|
||||
|
||||
@@ -43,6 +43,24 @@ class _Pages
|
||||
'sitemap_pages_priority' => new \IPS\Helpers\Form\Select( 'sitemap_pages_priority', \IPS\Settings::i()->sitemap_pages_priority, FALSE, array( 'options' => \IPS\Sitemap::$priorities, 'unlimited' => '-1', 'unlimitedLang' => 'sitemap_dont_include' ), NULL, NULL, NULL, 'sitemap_pages_priority' )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings for ACP configuration
|
||||
*
|
||||
* @param array $values Values
|
||||
* @return void
|
||||
*/
|
||||
public function saveSettings( $values )
|
||||
{
|
||||
if ( $values['sitemap_configuration_info'] )
|
||||
{
|
||||
\IPS\Settings::i()->changeValues( array( 'sitemap_pages_count' => $this->recommendedSettings['sitemap_pages_count'], 'sitemap_pages_priority' => $this->recommendedSettings['sitemap_pages_priority'] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Settings::i()->changeValues( array( 'sitemap_pages_count' => $values['sitemap_pages_count'], 'sitemap_pages_priority' => $values['sitemap_pages_priority'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the sitemap filename(s)
|
||||
@@ -82,6 +100,12 @@ class _Pages
|
||||
*/
|
||||
public function generateSitemap( $filename, $sitemap )
|
||||
{
|
||||
/* We have elected to not add databases to the sitemap */
|
||||
if ( ! \IPS\Settings::i()->sitemap_pages_count )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
$class = '\IPS\cms\Pages\Page';
|
||||
$count = 0;
|
||||
$member = new \IPS\Member;
|
||||
@@ -97,7 +121,14 @@ class _Pages
|
||||
$totalLimit = \IPS\Settings::i()->sitemap_pages_count;
|
||||
if ( $totalLimit > -1 and ( $offset + $limit ) > $totalLimit )
|
||||
{
|
||||
$limit = $totalLimit - $offset;
|
||||
if ( $totalLimit < $limit )
|
||||
{
|
||||
$limit = $totalLimit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$limit = $totalLimit - $offset;
|
||||
}
|
||||
}
|
||||
|
||||
$where = array( array( '(' . \IPS\Db::i()->findInSet( 'perm_' . $class::$permissionMap[ $permissionCheck ], $member->groups ) . ' OR ' . 'perm_' . $class::$permissionMap[ $permissionCheck ] . '=? )', '*' ) );
|
||||
|
||||
Reference in new issue
Block a user