-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontroller.php
More file actions
82 lines (71 loc) · 2.05 KB
/
controller.php
File metadata and controls
82 lines (71 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
namespace Concrete\Package\AuthorProfile;
use Concrete\Core\Package\Package;
use Concrete\Core\Backup\ContentImporter;
class Controller extends Package
{
/**
* @var string package handle
*/
protected $pkgHandle = 'author_profile';
/**
* @var string required concrete5 version
*/
protected $appVersionRequired = '9.0.0';
/**
* @var string package version
*/
protected $pkgVersion = '1.2.1';
/**
* @var bool remove \Src from package namespace
*/
protected $pkgAutoloaderMapCoreExtensions = true;
/**
* Returns the translated package description.
*
* @return string
*/
public function getPackageDescription()
{
return t("Author Profile Block and Author's Page List Block");
}
/**
* Returns the installed package name.
*
* @return string
*/
public function getPackageName()
{
return t('Author Profile');
}
/**
* Install process of the package.
*/
public function install()
{
$pkg = parent::install();
$ci = new ContentImporter();
$ci->importContentFile($pkg->getPackagePath() . '/config/install.xml');
}
/**
* {@inheritdoc}
*/
public function upgrade()
{
parent::upgrade();
$ci = new ContentImporter();
$ci->importContentFile($this->getPackagePath() . '/config/install.xml');
}
/**
* Startup process of the package.
*/
public function on_start()
{
/** @var \Concrete\Core\Application\Service\UserInterface\Help\BlockTypeManager $blockTypeManager */
$blockTypeManager = $this->app->make('help/block_type');
$blockTypeManager->registerMessages([
'author_profile' => [t('You can show informations about the author of current page.'), ''],
'author_page_list' => [t("Author's Page List blocks creates a navigation menu that shows pages created by the current page's author. You can also use this block on Public Profile single page."), ''],
]);
}
}