Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -39,6 +39,12 @@ class _seo extends \IPS\Dispatcher\Controller
|
||||
/* Get tab content */
|
||||
$this->activeTab = \IPS\Request::i()->tab ?: 'urls';
|
||||
|
||||
\IPS\Output::i()->sidebar['actions']['rebuildsitemap'] = array(
|
||||
'link' => \IPS\Http\Url::internal( 'app=core&module=promotion&controller=seo&do=rebuildSitemap' ),
|
||||
'title' => 'rebuild_sitemap',
|
||||
'icon' => 'history'
|
||||
);
|
||||
|
||||
parent::execute();
|
||||
}
|
||||
|
||||
@@ -50,7 +56,7 @@ class _seo extends \IPS\Dispatcher\Controller
|
||||
protected function manage()
|
||||
{
|
||||
/* Work out output */
|
||||
$activeTabContents = call_user_func( array( $this, '_manage' . ucfirst( $this->activeTab ) ) );
|
||||
$activeTabContents = call_user_func( array( $this, '_manage' . mb_ucfirst( $this->activeTab ) ) );
|
||||
|
||||
/* If this is an AJAX request, just return it */
|
||||
if( \IPS\Request::i()->isAjax() )
|
||||
@@ -142,6 +148,7 @@ class _seo extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/* Init */
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$form->addMessage( 'sitemap_blurb', 'ipsMessage ipsMessage_info' );
|
||||
$form->add( new \IPS\Helpers\Form\Url( 'sitemap_url', \IPS\Settings::i()->sitemap_url ?: \IPS\Settings::i()->base_url . 'sitemap.php', FALSE ) );
|
||||
|
||||
/* Get extension settings */
|
||||
@@ -206,6 +213,7 @@ class _seo extends \IPS\Dispatcher\Controller
|
||||
|
||||
if( !$form->error )
|
||||
{
|
||||
$values['sitemap_url'] = (string) $values['sitemap_url'];
|
||||
$form->saveAsSettings( $values );
|
||||
|
||||
foreach( \IPS\Application::allExtensions( 'core', 'Sitemap', FALSE, 'core' ) as $extKey => $extension )
|
||||
@@ -223,7 +231,7 @@ class _seo extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
|
||||
return \IPS\Theme::i()->getTemplate( 'forms' )->blurb( 'sitemap_blurb' ) . $form;
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -390,7 +398,7 @@ class _seo extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
$form = new \IPS\Helpers\Form;
|
||||
$form->class = 'ipsForm_vertical';
|
||||
$form->class = 'ipsForm_vertical ipsPad';
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'metatag_url', $url, FALSE, array( 'placeholder' => 'profile/*' ), NULL, \IPS\Settings::i()->base_url ) );
|
||||
$form->hiddenValues['original_url'] = $url;
|
||||
|
||||
@@ -502,4 +510,21 @@ FILE;
|
||||
\IPS\Output::i()->sendOutput( $htaccess, 200, 'application/x-htaccess', array( 'Content-Disposition' => 'attachment; filename=.htaccess' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger the sitemap rebuild
|
||||
*/
|
||||
protected function rebuildSitemap()
|
||||
{
|
||||
/* truncate sitemap */
|
||||
\IPS\Db::i()->delete( 'core_sitemap' );
|
||||
|
||||
$extensions = \IPS\Application::allExtensions( 'core', 'Sitemap', new \IPS\Member, 'core' );
|
||||
foreach ( $extensions as $k => $extension )
|
||||
{
|
||||
\IPS\Task::queue( 'core', 'RebuildSitemap', array( 'extensionKey' => $k ), 5 );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=promotion&controller=seo" ), 'rebuild_sitemap_initialized' );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user